diff --git a/client/src/components/dashboard/CoursePanel.vue b/client/src/components/dashboard/CoursePanel.vue index 15f2d093..26c04b7d 100644 --- a/client/src/components/dashboard/CoursePanel.vue +++ b/client/src/components/dashboard/CoursePanel.vue @@ -8,6 +8,7 @@ import MentorOpenTasksCount from "@/components/dashboard/MentorOpenTasksCount.vu import MentorMenteeCount from "@/components/dashboard/MentorMenteeCount.vue"; import MentorCompetenceSummary from "@/components/dashboard/MentorCompetenceSummary.vue"; import { getLearningPathUrl } from "@/utils/utils"; +import UkStatistics from "@/components/dashboard/UkStatistics.vue"; const mentorWidgets = [ "MentorTasksWidget", @@ -135,6 +136,12 @@ function hasActionButton(): boolean { :course-id="courseConfig.course_id" > +
+ +
+import { useDashboardStore } from "@/stores/dashboard"; +import { computed } from "vue"; +import AttendanceSummaryBox from "@/components/dashboard/AttendanceSummaryBox.vue"; +import type { CourseStatisticsType } from "@/gql/graphql"; +import AssignmentSummaryBox from "@/components/dashboard/AssignmentSummaryBox.vue"; +import FeedbackSummaryBox from "@/components/dashboard/FeedbackSummaryBox.vue"; +import CompetenceSummaryBox from "@/components/dashboard/CompetenceSummaryBox.vue"; + +const dashboardStore = useDashboardStore(); + +const statistics = computed(() => { + return dashboardStore.currentDashBoardData as CourseStatisticsType; +}); + +const attendanceDayPresences = computed(() => { + return statistics.value.attendance_day_presences.summary; +}); + +const assigmentSummary = computed(() => { + return statistics.value.assignments.summary; +}); + +const competenceSummary = computed(() => { + return statistics.value.competences.summary; +}); + +const feebackSummary = computed(() => { + return statistics.value.feedback_responses.summary; +}); + + + diff --git a/client/src/services/dashboard.ts b/client/src/services/dashboard.ts index 7b18955e..04489a51 100644 --- a/client/src/services/dashboard.ts +++ b/client/src/services/dashboard.ts @@ -34,7 +34,8 @@ export type WidgetType = | "MentorTasksWidget" | "MentorPersonWidget" | "MentorCompetenceWidget" - | "CompetenceCertificateWidget"; + | "CompetenceCertificateWidget" + | "UKStatisticsWidget"; export type DashboardPersonCourseSessionType = { id: number; diff --git a/server/vbv_lernwelt/dashboard/tests/test_views.py b/server/vbv_lernwelt/dashboard/tests/test_views.py index 50692b86..ddd0d248 100644 --- a/server/vbv_lernwelt/dashboard/tests/test_views.py +++ b/server/vbv_lernwelt/dashboard/tests/test_views.py @@ -233,6 +233,9 @@ class GetDashboardConfig(TestCase): ], ) + # test supervisor + # test expert + class GetMenteeCountTestCase(TestCase): def setUp(self): diff --git a/server/vbv_lernwelt/dashboard/views.py b/server/vbv_lernwelt/dashboard/views.py index 4cfddc6a..fa60cac3 100644 --- a/server/vbv_lernwelt/dashboard/views.py +++ b/server/vbv_lernwelt/dashboard/views.py @@ -29,6 +29,7 @@ class WidgetType(Enum): MENTOR_PERSON_WIDGET = "MentorPersonWidget" MENTOR_COMPETENCE_WIDGET = "MentorCompetenceWidget" COMPETENCE_CERTIFICATE_WIDGET = "CompetenceCertificateWidget" + UK_STATISTICS_WIDGET = "UKStatisticsWidget" class RoleKeyType(Enum): @@ -241,6 +242,9 @@ def get_widgets_for_course( if is_uk: widgets.append(WidgetType.COMPETENCE_CERTIFICATE_WIDGET.value) + if role_key == RoleKeyType.SUPERVISOR: + widgets.append(WidgetType.UK_STATISTICS_WIDGET.value) + if is_mentor: widgets.append(WidgetType.MENTOR_PERSON_WIDGET.value) if is_vv: @@ -379,8 +383,10 @@ def get_mentor_open_tasks_count(request, course_id: str): return Response( status=200, data={ - "open_task_count": _get_mentor_open_tasks_count(course_id, request.user) - }, # noqa + "open_task_count": _get_mentor_open_tasks_count( + course_id, request.user + ) # noqa + }, ) except PermissionDenied as e: raise e