Skip to content

Commit 4d383ae

Browse files
committed
block gantt page for non app admins
1 parent 55b8c56 commit 4d383ae

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/frontend/src/app/AppAuthenticated.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ import SetUserPreferences from '../pages/HomePage/SetUserPreferences';
2323
import Finance from '../pages/FinancePage/Finance';
2424
import Sidebar from '../layouts/Sidebar/Sidebar';
2525
import { Box } from '@mui/system';
26-
import { Container } from '@mui/material';
26+
import { Container, Typography } from '@mui/material';
2727
import ErrorPage from '../pages/ErrorPage';
28-
import { Role, isGuest } from 'shared';
28+
import { Role, RoleEnum, isGuest } from 'shared';
2929
import Calendar from '../pages/CalendarPage/Calendar';
3030
import { useState } from 'react';
31+
import PageBlock from '../layouts/PageBlock';
3132

3233
interface AppAuthenticatedProps {
3334
userId: number;
@@ -49,6 +50,14 @@ const AppAuthenticated: React.FC<AppAuthenticatedProps> = ({ userId, userRole })
4950
}
5051
}
5152

53+
const Maintainenance = () => {
54+
return (
55+
<PageBlock>
56+
<Typography>This Page is Currently Undergoing Maintainenance</Typography>
57+
</PageBlock>
58+
);
59+
};
60+
5261
return userSettingsData.slackId || isGuest(userRole) ? (
5362
<AppContextUser>
5463
<Box display={'flex'}>
@@ -58,7 +67,7 @@ const AppAuthenticated: React.FC<AppAuthenticatedProps> = ({ userId, userRole })
5867
<Route path={routes.PROJECTS} component={Projects} />
5968
<Redirect from={routes.CR_BY_ID} to={routes.CHANGE_REQUESTS_BY_ID} />
6069
<Route path={routes.CHANGE_REQUESTS} component={ChangeRequests} />
61-
<Route path={routes.GANTT} component={GanttChartPage} />
70+
<Route path={routes.GANTT} component={userRole === RoleEnum.APP_ADMIN ? GanttChartPage : Maintainenance} />
6271
<Route path={routes.TEAMS} component={Teams} />
6372
<Route path={routes.SETTINGS} component={Settings} />
6473
<Route path={routes.ADMIN_TOOLS} component={AdminTools} />

0 commit comments

Comments
 (0)