Skip to content

Transfer groundControl from staff to admin route #3043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 24, 2024
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
Loading