Skip to content

Commit 4924ee4

Browse files
authored
Transfer groundControl from staff to admin route (#3043)
* Transfer groundControl from staff to admin route * Update snapshots * Lint * Revert accidental changes to RequestsSaga * Find-replace non-admin API calls to backend * Change backend route for Admin Panel calls * Revert "Find-replace non-admin API calls to backend" This reverts commit eabc900.
1 parent fe360ae commit 4924ee4

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

src/commons/navigationBar/subcomponents/AcademyNavigationBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const getStaffNavlinkInfo = ({
9191
to: `/courses/${courseId}/groundcontrol`,
9292
icon: IconNames.SATELLITE,
9393
text: 'Ground Control',
94-
disabled: !isStaffOrAdmin,
94+
disabled: !isAdmin,
9595
hiddenInBreakpoints: ['xs', 'sm']
9696
},
9797
{

src/commons/navigationBar/subcomponents/__tests__/AcademyNavigationBar.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,8 @@ jest.mock('react-redux', () => ({
1111
const useSelectorMock = useTypedSelector as jest.Mock;
1212

1313
const assessmentTypes = ['Missions', 'Quests', 'Paths', 'Contests', 'Others'];
14-
const staffRoutes = [
15-
'grading',
16-
'groundcontrol',
17-
'sourcereel',
18-
'gamesimulator',
19-
'dashboard',
20-
'teamformation'
21-
];
22-
const adminRoutes = ['adminpanel'];
14+
const staffRoutes = ['grading', 'sourcereel', 'gamesimulator', 'dashboard', 'teamformation'];
15+
const adminRoutes = ['groundcontrol', 'adminpanel'];
2316
const courseId = 0;
2417
const createCoursePath = (path: string) => `/courses/${courseId}/${path}`;
2518

src/commons/navigationBar/subcomponents/__tests__/__snapshots__/AcademyNavigationBar.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ exports[`MissionControl, GroundControl, Sourcereel, GameSimulator, Dashboard, Te
419419
align="right"
420420
>
421421
<DesktopNavLink
422-
disabled={false}
422+
disabled={true}
423423
hiddenInBreakpoints={
424424
Array [
425425
"xs",

src/pages/academy/academyRoutes.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ const TeamFormationImport = () => import('./teamFormation/subcomponents/TeamForm
8787
const Dashboard = () => import('./dashboard/Dashboard');
8888

8989
const staffRoutes: RouteObject[] = [
90-
{ path: 'groundcontrol', lazy: GroundControl },
9190
{ path: `grading/${gradingRegExp}`, lazy: Grading },
9291
{ path: 'sourcereel', lazy: Sourcereel },
9392
{ path: 'gamesimulator', lazy: GameSimulator },
@@ -107,9 +106,10 @@ const staffRoutes: RouteObject[] = [
107106

108107
const AdminPanel = () => import('./adminPanel/AdminPanel');
109108

110-
const adminRoutes: RouteObject[] = [{ path: 'adminpanel', lazy: AdminPanel }].map(r =>
111-
new GuardedRoute(r).check(s => s.session.role === Role.Admin, notFoundPath).build()
112-
);
109+
const adminRoutes: RouteObject[] = [
110+
{ path: 'groundcontrol', lazy: GroundControl },
111+
{ path: 'adminpanel', lazy: AdminPanel }
112+
].map(r => new GuardedRoute(r).check(s => s.session.role === Role.Admin, notFoundPath).build());
113113

114114
export const getAcademyRoutes = (): RouteObject[] => {
115115
const routes: RouteObject[] = [...getCommonAcademyRoutes(), ...staffRoutes, ...adminRoutes];

0 commit comments

Comments
 (0)