diff --git a/src/frontend/src/app/AppAuthenticated.tsx b/src/frontend/src/app/AppAuthenticated.tsx index c67546853c..e131cf73ab 100644 --- a/src/frontend/src/app/AppAuthenticated.tsx +++ b/src/frontend/src/app/AppAuthenticated.tsx @@ -29,6 +29,7 @@ import Statistics from '../pages/StatisticsPage/Statistics'; import RetrospectiveGanttChartPage from '../pages/RetrospectivePage/Retrospective'; import Calendar from '../pages/CalendarPage/Calendar'; import GuestEventPage from '../pages/GuestEventPage/GuestEventPage'; +import ProjectManagementPage from '../pages/ProjectManagementPage/ProjectManagementPage'; import SidebarLayout from '../layouts/SidebarLayout'; interface AppAuthenticatedProps { @@ -79,6 +80,7 @@ const AppAuthenticated: React.FC = ({ userId, userRole }) + diff --git a/src/frontend/src/layouts/Sidebar/NavPageLink.tsx b/src/frontend/src/layouts/Sidebar/NavPageLink.tsx index 30d438f44b..438f4f2755 100644 --- a/src/frontend/src/layouts/Sidebar/NavPageLink.tsx +++ b/src/frontend/src/layouts/Sidebar/NavPageLink.tsx @@ -3,7 +3,7 @@ * See the LICENSE file in the repository root folder for details. */ -import { NavLink } from 'react-router-dom'; +import { NavLink, useHistory } from 'react-router-dom'; import { LinkItem } from '../../utils/types'; import { routes } from '../../utils/routes'; import { Box, Typography, useTheme, Collapse } from '@mui/material'; @@ -28,6 +28,7 @@ const NavPageLink: React.FC = ({ isClickableWithSubitems }) => { const theme = useTheme(); + const history = useHistory(); const renderLink = () => { const content = ( @@ -47,6 +48,7 @@ const NavPageLink: React.FC = ({ return ( history.push(route)} sx={{ textDecoration: 'none', color: theme.palette.text.primary, diff --git a/src/frontend/src/layouts/Sidebar/Sidebar.tsx b/src/frontend/src/layouts/Sidebar/Sidebar.tsx index 1c471eeb04..a960364d72 100644 --- a/src/frontend/src/layouts/Sidebar/Sidebar.tsx +++ b/src/frontend/src/layouts/Sidebar/Sidebar.tsx @@ -85,7 +85,7 @@ const Sidebar = ({ drawerOpen, setDrawerOpen, moveContent, setMoveContent }: Sid : { name: 'Project Management', icon: , - route: routes.PROJECTS, + route: routes.PROJECT_MANAGEMENT, subItems: [ { name: 'Gantt', diff --git a/src/frontend/src/pages/ProjectManagementPage/ProjectManagementCard.tsx b/src/frontend/src/pages/ProjectManagementPage/ProjectManagementCard.tsx new file mode 100644 index 0000000000..4124f59a6b --- /dev/null +++ b/src/frontend/src/pages/ProjectManagementPage/ProjectManagementCard.tsx @@ -0,0 +1,57 @@ +import { Box, Card, CardContent, Icon, Link, Typography, useTheme } from '@mui/material'; +import { GuestDefinition } from 'shared'; +import { NERButton } from '../../components/NERButton'; +import { Link as RouterLink } from 'react-router-dom'; + +interface ProjectManagementCardProps { + definition: GuestDefinition; +} + +const ProjectManagementCard: React.FC = ({ definition }) => { + const theme = useTheme(); + + return ( + + + + {definition.icon && {definition.icon}} + + {definition.term} + + + + {definition.description} + + {definition.buttonText && definition.buttonLink && ( + + + {definition.buttonText} + + + )} + + + ); +}; + +export default ProjectManagementCard; diff --git a/src/frontend/src/pages/ProjectManagementPage/ProjectManagementPage.tsx b/src/frontend/src/pages/ProjectManagementPage/ProjectManagementPage.tsx new file mode 100644 index 0000000000..ab2bb106c8 --- /dev/null +++ b/src/frontend/src/pages/ProjectManagementPage/ProjectManagementPage.tsx @@ -0,0 +1,34 @@ +import { Grid } from '@mui/material'; +import { GuestDefinitionType } from 'shared'; +import PageLayout from '../../components/PageLayout'; +import ProjectManagementCard from './ProjectManagementCard'; +import { useAllGuestDefinitions } from '../../hooks/recruitment.hooks'; +import LoadingIndicator from '../../components/LoadingIndicator'; +import ErrorPage from '../ErrorPage'; + +const ProjectManagementPage: React.FC = () => { + const { data: definitions, isLoading, isError, error } = useAllGuestDefinitions(); + + if (isError) { + return ; + } + if (isLoading || !definitions) return ; + + const filteredDefinitions = definitions.filter((definition) => definition.type === GuestDefinitionType.PROJECT_MANAGEMENT); + + return ( + + + {filteredDefinitions + .sort((a, b) => a.order - b.order) + .map((definition) => ( + + + + ))} + + + ); +}; + +export default ProjectManagementPage; diff --git a/src/frontend/src/utils/routes.ts b/src/frontend/src/utils/routes.ts index fece77773b..cef7fa3d6b 100644 --- a/src/frontend/src/utils/routes.ts +++ b/src/frontend/src/utils/routes.ts @@ -30,6 +30,7 @@ const COMPANIES = FINANCE + `/companies`; /**************** Projects Section ****************/ const PROJECTS = `/projects`; +const PROJECT_MANAGEMENT = `/project-management`; const PROJECTS_OVERVIEW = PROJECTS + '/overview'; const PROJECTS_ALL = PROJECTS + '/all'; const PROJECTS_BY_WBS = PROJECTS + `/:wbsNum`; @@ -100,6 +101,7 @@ export const routes = { GANTT, PROJECTS, + PROJECT_MANAGEMENT, PROJECTS_OVERVIEW, PROJECTS_ALL, PROJECTS_BY_WBS,