Skip to content

Commit

Permalink
Move academic session select (#110)
Browse files Browse the repository at this point in the history
* Remove box and whisker and standard deviation bar graphs

* Prettier

* Average calc fix

* Remove average graph, move to expandableSearchGrid

* Revert subtitle addition

* Prettier

* Add question mark tooltip disclaimer

* Prettier

* Revert autocomplete_graph.json

* Don't show question mark on loading

* Move time range picker

* Lint fix
  • Loading branch information
TyHil authored Oct 19, 2023
1 parent 2685972 commit 502e0d7
Showing 1 changed file with 44 additions and 31 deletions.
75 changes: 44 additions & 31 deletions pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {
Card,
FormControl,
FormHelperText,
Grid,
InputLabel,
LinearProgress,
Expand Down Expand Up @@ -398,8 +400,35 @@ export const Dashboard: NextPage = () => {
gradesPage = (
<>
<div className="h-full m-4">
<Card className="h-96 p-4 m-4">
<GraphChoice
form="Bar"
title="Grades"
xaxisLabels={[
'A+',
'A',
'A-',
'B+',
'B',
'B-',
'C+',
'C',
'C-',
'D+',
'D',
'D-',
'F',
'W',
]}
yaxisFormatter={(value) => Number(value).toFixed(0) + '%'}
series={gradesData}
/>
</Card>
<div className="flex justify-center gap-2">
<div>
<FormControl
error={startingSession > endingSession}
variant="standard"
>
<InputLabel id="startingSessionLabel">From</InputLabel>
<Select
labelId="startingSessionLabel"
Expand All @@ -417,51 +446,35 @@ export const Dashboard: NextPage = () => {
),
)}
</Select>
</div>
<div>
</FormControl>
<FormControl
error={startingSession > endingSession}
variant="standard"
>
<InputLabel id="endingSessionLabel">To</InputLabel>
<Select
labelId="endingSessionLabel"
defaultValue={9999}
onChange={(e) => setEndingSession(e.target.value as number)}
>
<MenuItem key="Last available" value="9999">
Last available
</MenuItem>
{possibleAcademicSessions.map(
(session: academicSessionType) => (
<MenuItem key={session.name} value={session.place}>
{session.name}
</MenuItem>
),
)}
<MenuItem key="Last available" value="9999">
Last available
</MenuItem>
</Select>
</div>
</FormControl>
</div>
<Card className="h-96 p-4 m-4" elevation={darkModeElevation}>
<GraphChoice
form="Bar"
title="Grades"
xaxisLabels={[
'A+',
'A',
'A-',
'B+',
'B',
'B-',
'C+',
'C',
'C-',
'D+',
'D',
'D-',
'F',
'W',
]}
yaxisFormatter={(value) => Number(value).toFixed(0) + '%'}
series={gradesData}
/>
</Card>
{startingSession > endingSession ? (
<FormHelperText className="text-center" error={true}>
Starting academic session must be before ending academic session
</FormHelperText>
) : null}
</div>
</>
);
Expand Down

0 comments on commit 502e0d7

Please sign in to comment.