Skip to content

Commit

Permalink
Merge pull request #186 from cornell-dti/sp24-metric
Browse files Browse the repository at this point in the history
Metrics now automatically update with new semesters
  • Loading branch information
JustKong13 authored Feb 16, 2024
2 parents b773c27 + 86c7523 commit b979fd2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions frontend/src/modules/Metrics/Components/Metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -46,7 +48,7 @@ export const Metrics = () => {
)
}

const [selectedRoster, setSelectedRoster] = useState<string>('SP23')
const [selectedRoster, setSelectedRoster] = useState<string>(currRoster)
const studentsInSemester = new Map<
string,
{ semester: string; groups: GroupMembership[]; college: string }
Expand Down Expand Up @@ -292,12 +294,11 @@ export const Metrics = () => {
alignSelf: 'flex-end',
}}
>
<MenuItem value="SU22">Summer 2022</MenuItem>
<MenuItem value="FA22">Fall 2022</MenuItem>
<MenuItem value="WI23">Winter 2023</MenuItem>
<MenuItem value="SP23">Spring 2023</MenuItem>
<MenuItem value="SU23">Summer 2023</MenuItem>
<MenuItem value="WI24:">Winter 2024</MenuItem>
{semesters.map((sem) => (
<MenuItem key={sem} value={sem}>
{sem}
</MenuItem>
))}
</DropdownSelect>
</Box>
<MetricsTable
Expand Down

0 comments on commit b979fd2

Please sign in to comment.