From 44ed1548146edc36d269a54c08d69ffd0c9255f0 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Wed, 25 Jan 2023 14:41:29 +0100 Subject: [PATCH] Add summary component --- .../components/feedback/feedbackSummary.vue | 77 +++++++++++++++++++ client/src/components/ui/ItModal.vue | 1 - client/src/components/ui/ItPersonRow.vue | 22 +++--- client/src/components/ui/ItRow.vue | 20 +++++ client/src/locales/de.json | 5 +- client/src/pages/cockpit/CockpitIndexPage.vue | 30 ++++---- server/config/urls.py | 11 ++- .../commands/create_default_courses.py | 14 ++++ .../course/tests/test_document_uploads.py | 1 + .../feedback/creators/__init__.py | 0 .../feedback/creators/create_demo_feedback.py | 8 ++ server/vbv_lernwelt/feedback/factories.py | 29 +++++++ .../feedback/tests/test_feedback_api.py | 57 +++++++++----- server/vbv_lernwelt/feedback/views.py | 31 +++++--- 14 files changed, 243 insertions(+), 63 deletions(-) create mode 100644 client/src/components/feedback/feedbackSummary.vue create mode 100644 client/src/components/ui/ItRow.vue create mode 100644 server/vbv_lernwelt/feedback/creators/__init__.py create mode 100644 server/vbv_lernwelt/feedback/creators/create_demo_feedback.py diff --git a/client/src/components/feedback/feedbackSummary.vue b/client/src/components/feedback/feedbackSummary.vue new file mode 100644 index 00000000..1eafbdf5 --- /dev/null +++ b/client/src/components/feedback/feedbackSummary.vue @@ -0,0 +1,77 @@ + + + diff --git a/client/src/components/ui/ItModal.vue b/client/src/components/ui/ItModal.vue index e697c8c1..baf715c9 100644 --- a/client/src/components/ui/ItModal.vue +++ b/client/src/components/ui/ItModal.vue @@ -1,6 +1,5 @@ diff --git a/client/src/components/ui/ItRow.vue b/client/src/components/ui/ItRow.vue new file mode 100644 index 00000000..079c762c --- /dev/null +++ b/client/src/components/ui/ItRow.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/client/src/locales/de.json b/client/src/locales/de.json index 2bac4a3e..5f1dab21 100644 --- a/client/src/locales/de.json +++ b/client/src/locales/de.json @@ -131,7 +131,10 @@ "completionTitle": "Schicke dein Feedback an {name}", "completionDescription": "Dein Feedback ist anonym. Dein Vor- und Nachname werden bei deiner Trainer/-in nicht angezeigt.", "sendFeedback": "Feedback abschicken", - "feedbackSent": "Dein Feedback wurde abgeschickt" + "feedbackSent": "Dein Feedback wurde abgeschickt", + "circleFeedback": "Feedback zum Circle", + "showDetails": "Details anzeigen", + "sentByUsers": "Von {count} Teilnehmern ausgefüllt" }, "constants": { "yes": "Ja", diff --git a/client/src/pages/cockpit/CockpitIndexPage.vue b/client/src/pages/cockpit/CockpitIndexPage.vue index c064ea6b..00121bdc 100644 --- a/client/src/pages/cockpit/CockpitIndexPage.vue +++ b/client/src/pages/cockpit/CockpitIndexPage.vue @@ -2,6 +2,7 @@ import LearningPathDiagram from "@/components/learningPath/LearningPathDiagram.vue"; import ItPersonRow from "@/components/ui/ItPersonRow.vue"; import ItProgress from "@/components/ui/ItProgress.vue"; +import FeedbackSummary from "@/components/feedback/feedbackSummary.vue"; import type { LearningPath } from "@/services/learningPath"; import { useCockpitStore } from "@/stores/cockpit"; @@ -10,6 +11,7 @@ import { useLearningPathStore } from "@/stores/learningPath"; import { useUserStore } from "@/stores/user"; import log from "loglevel"; import { computed } from "vue"; +import { useCourseSessionsStore } from "@/stores/courseSessions"; const props = defineProps<{ courseSlug: string; @@ -21,6 +23,7 @@ const userStore = useUserStore(); const cockpitStore = useCockpitStore(); const competenceStore = useCompetenceStore(); const learningPathStore = useLearningPathStore(); +const courseSessionStore = useCourseSessionsStore(); function userCountStatus(userId: number) { return competenceStore.calcStatusCount( @@ -92,8 +95,8 @@ function setActiveClasses(translationKey: string) { -
-
+
+

@@ -106,18 +109,7 @@ function setActiveClasses(translationKey: string) {

- {{ $t("general.feedback", 2) }} -

-
- -
-

{{ $t("cockpit.feedbacksDone") }}

-
-
-

{{ $t("general.examResult", 2) }}

@@ -127,6 +119,13 @@ function setActiveClasses(translationKey: string) {

{{ $t("cockpit.examsDone") }}

+ +
@@ -140,7 +139,7 @@ function setActiveClasses(translationKey: string) { >