From 2281ed62f4a6e1fa4db21d29b2d0b4ddc20b31b8 Mon Sep 17 00:00:00 2001 From: Justin Kong Date: Tue, 13 Feb 2024 11:50:55 -0500 Subject: [PATCH 1/2] manually added and fixed metric semesters --- frontend/src/modules/Metrics/Components/Metrics.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/modules/Metrics/Components/Metrics.tsx b/frontend/src/modules/Metrics/Components/Metrics.tsx index f12f7dad..6e08ed35 100644 --- a/frontend/src/modules/Metrics/Components/Metrics.tsx +++ b/frontend/src/modules/Metrics/Components/Metrics.tsx @@ -297,7 +297,9 @@ export const Metrics = () => { Winter 2023 Spring 2023 Summer 2023 - Winter 2024 + Fall 2023 + Winter 2024 + Spring 2024 Date: Thu, 15 Feb 2024 00:20:43 -0500 Subject: [PATCH 2/2] implemented automatically adding semesters to metrics page --- .../modules/Metrics/Components/Metrics.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/modules/Metrics/Components/Metrics.tsx b/frontend/src/modules/Metrics/Components/Metrics.tsx index 6e08ed35..dccedd87 100644 --- a/frontend/src/modules/Metrics/Components/Metrics.tsx +++ b/frontend/src/modules/Metrics/Components/Metrics.tsx @@ -12,9 +12,11 @@ import { DASHBOARD_PATH } from '@core/Constants' import { Link } from 'react-router-dom' import { GroupMembership } from '@core' import survey from '@core/Questions/Questions.json' +import { useSettingsValue } from '@context/SettingsContext' export const Metrics = () => { - const { courses } = useCourseValue() + const { currRoster } = useSettingsValue() + const { courses, semesters } = useCourseValue() const { students } = useStudentValue() //checks if date is within the week (beginning of the day Sunday to end of day Saturday) @@ -46,7 +48,7 @@ export const Metrics = () => { ) } - const [selectedRoster, setSelectedRoster] = useState('SP23') + const [selectedRoster, setSelectedRoster] = useState(currRoster) const studentsInSemester = new Map< string, { semester: string; groups: GroupMembership[]; college: string } @@ -292,14 +294,11 @@ export const Metrics = () => { alignSelf: 'flex-end', }} > - Summer 2022 - Fall 2022 - Winter 2023 - Spring 2023 - Summer 2023 - Fall 2023 - Winter 2024 - Spring 2024 + {semesters.map((sem) => ( + + {sem} + + ))}