Skip to content

Commit 79828b3

Browse files
committed
Merge branch 'develop' into Weekly-Availability-Times
2 parents 975ece6 + 5731362 commit 79828b3

8 files changed

Lines changed: 42 additions & 98 deletions

File tree

src/backend/src/prisma/seed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,12 +1947,12 @@ const performSeed: () => Promise<void> = async () => {
19471947
{
19481948
linkId: '1',
19491949
linkTypeName: 'Confluence',
1950-
url: 'https://google.com'
1950+
url: 'https://confluence.com'
19511951
},
19521952
{
19531953
linkId: '2',
19541954
linkTypeName: 'Bill of Materials',
1955-
url: 'https://apple.com'
1955+
url: 'https://docs.google.com'
19561956
}
19571957
]);
19581958
};

src/backend/src/routes/projects.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import ProjectsController from '../controllers/projects.controllers';
1212

1313
const projectRouter = express.Router();
1414

15-
projectRouter.get('/:deleted', ProjectsController.getAllProjects);
15+
projectRouter.get('/all/:deleted', ProjectsController.getAllProjects);
1616

1717
/* Link Types */
1818
projectRouter.get('/link-types', ProjectsController.getAllLinkTypes);

src/frontend/src/pages/CalendarPage/DesignReviewDetailPage/AvailabilityView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ const AvailabilityView: React.FC<AvailabilityViewProps> = ({
6161

6262
const convertTimeSlotToDate = (index: number) => {
6363
const day = Math.floor(index / 12);
64-
const time = index % 12;
6564
const date = new Date(startDateRange);
6665
date.setDate(date.getDate() + day);
67-
date.setHours(time + startTime);
6866
return date;
6967
};
7068

src/frontend/src/pages/CalendarPage/DesignReviewSummaryModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DesignReview, DesignReviewStatus, TeamType } from 'shared';
1+
import { DesignReview, DesignReviewStatus, TeamType, isAdmin } from 'shared';
22
import NERModal from '../../components/NERModal';
33
import { Box, Chip, IconButton, Typography } from '@mui/material';
44
import EditIcon from '@mui/icons-material/Edit';
@@ -74,7 +74,7 @@ const DRCSummaryModal: React.FC<DRCSummaryModalProps> = ({ open, onHide, designR
7474
showCloseButton
7575
titleChildren={
7676
<Box position="absolute" right="52px" top="12px">
77-
{isDesignReviewCreator && (
77+
{(isDesignReviewCreator || isAdmin(user.role)) && (
7878
<>
7979
<IconButton onClick={() => setShowDeleteModal(true)}>
8080
<DeleteIcon />

src/frontend/src/pages/HomePage/UsefulLinks.tsx

Lines changed: 34 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -4,102 +4,48 @@
44
*
55
*/
66

7-
import { useTheme } from '@mui/material';
7+
import { Icon, useTheme } from '@mui/material';
88
import Typography from '@mui/material/Typography';
9-
import { ShoppingCart, Settings, Receipt, CurrencyExchange, AttachMoney, CalendarMonth, Info } from '@mui/icons-material';
109
import Link from '@mui/material/Link';
1110
import { Grid } from '@mui/material';
1211
import PageBlock from '../../layouts/PageBlock';
1312
import React from 'react';
13+
import { useAllUsefulLinks } from '../../hooks/projects.hooks';
14+
import LoadingIndicator from '../../components/LoadingIndicator';
15+
import ErrorPage from '../ErrorPage';
1416

1517
const UsefulLinks: React.FC = () => {
1618
const theme = useTheme();
17-
const links = [
18-
<>
19-
<ShoppingCart sx={{ fontSize: 17, color: theme.palette.text.primary }} />
20-
<Link
21-
href="https://docs.google.com/document/d/1M5Ldy9L1BifBo18tdKpv3CH-frRneyEK26hUXbtMg7Q/edit"
22-
target="_blank"
23-
underline="hover"
24-
fontSize={19}
25-
sx={{ pl: 1 }}
26-
>
27-
Purchasing Guidelines
28-
</Link>
29-
</>,
30-
<>
31-
<CurrencyExchange sx={{ fontSize: 17, color: theme.palette.text.primary }} />
32-
<Link
33-
href="https://docs.google.com/document/d/1DbT_--TrrQqhUQFA0ReyBydVLSojGW0QPWussvfOxNA/edit"
34-
target="_blank"
35-
underline="hover"
36-
fontSize={19}
37-
sx={{ pl: 1 }}
38-
>
39-
Reimbursement Guidelines
40-
</Link>
41-
</>,
42-
<>
43-
<Receipt sx={{ fontSize: 17, color: theme.palette.text.primary }} />
44-
<Link
45-
href="https://docs.google.com/spreadsheets/d/1kqpnw8jZDx2GO5NFUtqefRXqT1XX46iMx5ZI4euPJgY/edit"
46-
target="_blank"
47-
underline="hover"
48-
fontSize={19}
49-
sx={{ pl: 1 }}
50-
>
51-
McMaster Order Sheet
52-
</Link>
53-
</>,
54-
<>
55-
<Settings sx={{ fontSize: 17, color: theme.palette.text.primary }} />
56-
<Link
57-
href="https://nerdocs.atlassian.net/wiki/spaces/NER/pages/4554841/Hardware+Guidelines"
58-
target="_blank"
59-
underline="hover"
60-
fontSize={19}
61-
sx={{ pl: 1 }}
62-
>
63-
Hardware Guidelines
64-
</Link>
65-
</>,
66-
<>
67-
<CalendarMonth sx={{ fontSize: 17, color: theme.palette.text.primary }} />
68-
<Link
69-
href="https://nerdocs.atlassian.net/wiki/spaces/NER/pages/6619279/Calendars"
70-
target="_blank"
71-
underline="hover"
72-
fontSize={19}
73-
sx={{ pl: 1 }}
74-
>
75-
Calendars
76-
</Link>
77-
</>,
78-
<>
79-
<Info sx={{ fontSize: 17, color: theme.palette.text.primary }} />
80-
<Link
81-
href="https://nerdocs.atlassian.net/wiki/spaces/NER/overview"
82-
target="_blank"
83-
underline="hover"
84-
fontSize={19}
85-
sx={{ pl: 1 }}
86-
>
87-
Confluence
88-
</Link>
89-
</>,
90-
<>
91-
<AttachMoney sx={{ fontSize: 17, color: theme.palette.text.primary }} />
92-
<Link
93-
href="https://docs.google.com/forms/d/e/1FAIpQLSfLu2tRjlolDEYbVtClJspnSjbHcQt59f3bUZIRnky_uOL9HA/viewform"
94-
target="_blank"
95-
underline="hover"
96-
fontSize={19}
97-
sx={{ pl: 1 }}
98-
>
99-
Sponsorship Form
100-
</Link>
101-
</>
102-
];
19+
const {
20+
data: usefulLinks,
21+
isLoading: usefulLinksIsLoading,
22+
error: usefulLinksError,
23+
isError: usefulLinksIsError
24+
} = useAllUsefulLinks();
25+
26+
if (!usefulLinks || usefulLinksIsLoading) return <LoadingIndicator />;
27+
if (usefulLinksIsError) return <ErrorPage message={usefulLinksError.message} />;
28+
29+
const links = usefulLinks.map((link) => {
30+
return (
31+
<>
32+
<Icon
33+
sx={{
34+
fontSize: 22,
35+
marginRight: 1,
36+
position: 'relative',
37+
top: 3,
38+
color: theme.palette.text.primary
39+
}}
40+
>
41+
{link.linkType.iconName}
42+
</Icon>
43+
<Link href={link.url} target="_blank" underline="hover" fontSize={19}>
44+
{link.linkType.name}
45+
</Link>
46+
</>
47+
);
48+
});
10349

10450
// gets the text wrapped in the React element, used here to generate keys
10551
const rawText = (component: React.ReactElement | string): string => {

src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectGantt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface ProjectGanttProps {
2222
}
2323

2424
const ProjectGantt: React.FC<ProjectGanttProps> = ({ workPackages }) => {
25-
const rows = workPackages.map((wp) => [wp.id, wp.name, wp.startDate, wp.endDate, wp.duration, null]);
25+
const rows = workPackages.map((wp) => [wp.id, wp.name, wp.startDate, wp.endDate, wp.duration, 100, null]);
2626
const data = [ganttAllColumns, ...rows];
2727
const options = {
2828
height: 30 * rows.length + 50,

src/frontend/src/utils/gantt.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ export const aggregateGanttChanges = (ganttChanges: GanttChange[], allWbsElement
559559
const newWorkPackage = changeEvents.some((change) => change.type === 'create-work-package');
560560

561561
const change: RequestEventChange = {
562-
changeId: updatedEvent.id,
562+
changeId: wbsPipe(wbsElement.wbsNum),
563563
prevStart: isProject(wbsElement.wbsNum) ? new Date() : (wbsElement as WorkPackage).startDate,
564564
prevEnd: isProject(wbsElement.wbsNum) ? new Date() : (wbsElement as WorkPackage).endDate,
565565
newStart: start,

src/frontend/src/utils/urls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const userScheduleSettingsSet = () => `${users()}/schedule-settings/set`;
2727

2828
/**************** Projects Endpoints ****************/
2929
const projects = () => `${API_URL}/projects`;
30-
const allProjects = (includeDeleted: boolean) => `${projects()}/${includeDeleted ? 'true' : 'false'}`;
30+
const allProjects = (includeDeleted: boolean) => `${projects()}/all/${includeDeleted ? 'true' : 'false'}`;
3131
const projectsByWbsNum = (wbsNum: string) => `${projects()}/${wbsNum}`;
3232
const projectsCreate = () => `${projects()}/create`;
3333
const projectsEdit = () => `${projects()}/edit`;

0 commit comments

Comments
 (0)