Skip to content

Commit

Permalink
Transfer groundControl from staff to admin route (#3043)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
josh1248 authored Sep 24, 2024
1 parent fe360ae commit 4924ee4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const getStaffNavlinkInfo = ({
to: `/courses/${courseId}/groundcontrol`,
icon: IconNames.SATELLITE,
text: 'Ground Control',
disabled: !isStaffOrAdmin,
disabled: !isAdmin,
hiddenInBreakpoints: ['xs', 'sm']
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,8 @@ jest.mock('react-redux', () => ({
const useSelectorMock = useTypedSelector as jest.Mock;

const assessmentTypes = ['Missions', 'Quests', 'Paths', 'Contests', 'Others'];
const staffRoutes = [
'grading',
'groundcontrol',
'sourcereel',
'gamesimulator',
'dashboard',
'teamformation'
];
const adminRoutes = ['adminpanel'];
const staffRoutes = ['grading', 'sourcereel', 'gamesimulator', 'dashboard', 'teamformation'];
const adminRoutes = ['groundcontrol', 'adminpanel'];
const courseId = 0;
const createCoursePath = (path: string) => `/courses/${courseId}/${path}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ exports[`MissionControl, GroundControl, Sourcereel, GameSimulator, Dashboard, Te
align="right"
>
<DesktopNavLink
disabled={false}
disabled={true}
hiddenInBreakpoints={
Array [
"xs",
Expand Down
8 changes: 4 additions & 4 deletions src/pages/academy/academyRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ const TeamFormationImport = () => import('./teamFormation/subcomponents/TeamForm
const Dashboard = () => import('./dashboard/Dashboard');

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

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

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

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

0 comments on commit 4924ee4

Please sign in to comment.