Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics now automatically update with new semesters #186

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading