From 4152dec63a5fac196e75328eb23661fa1c08a6f0 Mon Sep 17 00:00:00 2001 From: Dudrie Date: Tue, 11 Feb 2020 22:11:32 +0100 Subject: [PATCH] Change Studentoverview to show current schein status (again). --- .../student-overview/Studentoverview.tsx | 6 ++--- .../components/StudentRow.tsx | 8 ++++++ .../student-store/StudentStore.reducers.ts | 25 +++++++++++++++---- .../student-store/StudentStore.tsx | 3 +++ 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/client/src/view/studentmanagement/student-overview/Studentoverview.tsx b/client/src/view/studentmanagement/student-overview/Studentoverview.tsx index d14771e37..97fc2ea42 100644 --- a/client/src/view/studentmanagement/student-overview/Studentoverview.tsx +++ b/client/src/view/studentmanagement/student-overview/Studentoverview.tsx @@ -3,7 +3,6 @@ import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'; import { AccountSearch as SearchIcon } from 'mdi-material-ui'; import { useSnackbar } from 'notistack'; import React, { ChangeEvent, useState } from 'react'; -import { ScheinCriteriaSummary } from 'shared/dist/model/ScheinCriteria'; import { Student } from 'shared/dist/model/Student'; import { Tutorial } from 'shared/dist/model/Tutorial'; import { getNameOfEntity } from 'shared/dist/util/helpers'; @@ -44,8 +43,6 @@ const useStyles = makeStyles((theme: Theme) => }) ); -type SummariesByStudent = { [studentId: string]: ScheinCriteriaSummary }; - interface Props { tutorials?: Tutorial[]; allowChangeTutorial?: boolean; @@ -63,7 +60,7 @@ function Studentoverview({ const [sortOption, setSortOption] = useState(StudentSortOption.ALPHABETICAL); const dialog = useDialog(); - const [{ students, teams, tutorialId, isInitialized }, dispatch] = useStudentStore(); + const [{ students, teams, tutorialId, isInitialized, summaries }, dispatch] = useStudentStore(); const { enqueueSnackbar } = useSnackbar(); const handlerParams: HandlerParams = { tutorialId, dispatch, enqueueSnackbar }; @@ -187,6 +184,7 @@ function Studentoverview({ @@ -39,6 +41,7 @@ interface Props extends PaperTableRowProps { onDelete: StudentCallback; onChangeTutorial?: StudentCallback; subtextPrefix?: string; + scheinStatus?: ScheinCriteriaSummary; } interface GetSubtextParams { @@ -63,6 +66,7 @@ function StudentRow({ onEdit, onDelete, onChangeTutorial, + scheinStatus, ...props }: Props): JSX.Element { const classes = useStyles(); @@ -102,6 +106,10 @@ function StudentRow({ /> } > + + + +