From 31852e33e5e92192bd59c509641a64e5e52964d6 Mon Sep 17 00:00:00 2001 From: Tuyisenge Tito <159807244+Tuyisenge2@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:10:53 +0200 Subject: [PATCH] (fix): add coordinator dashboard page (#608) --- src/components/DataTable.tsx | 2 +- src/pages/CoordinatorDashboard.tsx | 235 ++++ src/pages/Dashboard.tsx | 3 +- src/pages/coordinatorTraineDashboard.tsx | 1587 ++++++++++++++++++++++ src/queries/ratings.queries.tsx | 10 + tests/components/Calendar.test.tsx | 2 +- 6 files changed, 1836 insertions(+), 3 deletions(-) create mode 100644 src/pages/CoordinatorDashboard.tsx create mode 100644 src/pages/coordinatorTraineDashboard.tsx diff --git a/src/components/DataTable.tsx b/src/components/DataTable.tsx index d99c38696..1b222d9bd 100644 --- a/src/components/DataTable.tsx +++ b/src/components/DataTable.tsx @@ -68,7 +68,7 @@ function DataTable({ data, columns, title, loading, className }: TableData) { return (
Error loading data
; + } + + const traineeAverages = data?.fetchAllRatings.reduce( + (acc: Record+ {cohort.cohortName} +
++ Average Rating: {cohort.averageRating.toFixed(2)} +
++ {trainee.profile?.firstName}{' '} + {trainee.profile?.lastName} +
+ {/*+ Average Rating: {trainee.average.toFixed(2)} +
*/} ++ {trainee.email} +
++ {trainee.profile?.firstName}{' '} + {trainee.profile?.lastName} +
+ {/*+ Average Rating: {trainee.average.toFixed(2)} +
*/} ++ {trainee.email} +
+