From 033886f00bdf4cdad72807df9f71f149c9f09ecc Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Mon, 17 Jun 2024 16:32:27 +0200 Subject: [PATCH] Add frontend export --- .../dashboard/StatisticFilterList.vue | 16 ++--- .../dashboard/statistic/AssignmentList.vue | 18 ++++++ .../dashboard/statistic/AttendanceList.vue | 18 ++++++ .../dashboard/statistic/FeedbackList.vue | 18 ++++++ client/src/services/dashboard.ts | 30 ++++----- client/src/types.ts | 17 +++++ client/src/utils/export.ts | 62 +++++++++++++++++-- server/config/urls.py | 3 +- 8 files changed, 155 insertions(+), 27 deletions(-) diff --git a/client/src/components/dashboard/StatisticFilterList.vue b/client/src/components/dashboard/StatisticFilterList.vue index 7ec9b451..cda10a88 100644 --- a/client/src/components/dashboard/StatisticFilterList.vue +++ b/client/src/components/dashboard/StatisticFilterList.vue @@ -3,21 +3,17 @@ import { computed, ref, watch } from "vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; import { useTranslation } from "i18next-vue"; import type { StatisticsCourseSessionPropertiesType } from "@/gql/graphql"; +import type { StatisticsFilterItem } from "@/types"; const { t } = useTranslation(); -interface Item { - _id: string; - course_session_id: string; - generation: string; - circle_id: string; -} - const props = defineProps<{ - items: Item[]; + items: StatisticsFilterItem[]; courseSessionProperties: StatisticsCourseSessionPropertiesType; }>(); +defineExpose({ getFilteredItems }); + const sessionFilter = computed(() => { const f = props.courseSessionProperties.sessions.map((session) => ({ name: `${t("a.Durchfuehrung")}: ${session.name}`, @@ -71,6 +67,10 @@ const filteredItems = computed(() => { return sessionMatch && generationMatch && circleMatch; }); }); + +function getFilteredItems() { + return filteredItems.value; +}