From 142d0f374ec7d3af738861ae1291e12e0d70d63f Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Tue, 17 Jan 2023 08:09:00 +0100 Subject: [PATCH] Add feedback completion --- client/src/components/FeedbackForm.vue | 44 +++++++++++++------ client/src/components/MobileMenu.vue | 1 + .../learningPath/FeedbackCompletition.vue | 41 +++++++++++++++++ .../components/learningPath/FeedbackIntro.vue | 10 ++--- .../learningPath/LearningContent.vue | 1 - .../learningPath/LearningContentContainer.vue | 4 +- .../LearningContentNavigation.vue | 9 ++-- .../learningPath/SelfEvaluation.vue | 2 +- client/src/components/ui/ItRadioGroup.vue | 4 +- client/src/components/ui/ItTextarea.vue | 2 +- client/src/locales/de.json | 8 +++- cypress/e2e/circle.cy.js | 2 + cypress/e2e/mediaLibrary.cy.js | 2 +- 13 files changed, 99 insertions(+), 31 deletions(-) create mode 100644 client/src/components/learningPath/FeedbackCompletition.vue diff --git a/client/src/components/FeedbackForm.vue b/client/src/components/FeedbackForm.vue index db722028..db983244 100644 --- a/client/src/components/FeedbackForm.vue +++ b/client/src/components/FeedbackForm.vue @@ -3,7 +3,11 @@ + + + :show-back-button="stepNo > 0" + :show-next-button="stepNo > 0 && stepNo < MAX_STEPS - 1" + :question-index="stepNo" + :max-question-index="MAX_STEPS" + @back="previousStep" + @continue="nextStep" + >
      satisfaction {{ satisfaction }}
@@ -112,14 +129,15 @@ import {
   RATINGS,
   YES_NO,
 } from "@/components/learningPath/feedback.constants";
-import ItRadioGroup from "@/components/ui/ItRadioGroup.vue";
-import ItTextarea from "@/components/ui/ItTextarea.vue";
+import FeedbackCompletition from "@/components/learningPath/FeedbackCompletition.vue";
 import FeedbackIntro from "@/components/learningPath/FeedbackIntro.vue";
 import LearningContentNavigation from "@/components/learningPath/LearningContentNavigation.vue";
+import ItRadioGroup from "@/components/ui/ItRadioGroup.vue";
+import ItTextarea from "@/components/ui/ItTextarea.vue";
 import { graphql } from "@/gql/";
 import type { SendFeedbackInput } from "@/gql/graphql";
-import { useCourseSessionsStore } from "@/stores/courseSessions";
 import { useCircleStore } from "@/stores/circle";
+import { useCourseSessionsStore } from "@/stores/courseSessions";
 import type { LearningContent } from "@/types";
 import { useMutation } from "@urql/vue";
 import log from "loglevel";
@@ -134,7 +152,7 @@ onMounted(async () => {
 });
 
 const stepNo = ref(0);
-const MAX_STEPS = 10;
+const MAX_STEPS = 12;
 
 const sendFeedbackMutation = graphql(`
   mutation SendFeedbackMutation($input: SendFeedbackInput!) {
diff --git a/client/src/components/MobileMenu.vue b/client/src/components/MobileMenu.vue
index 5ae62fcc..f21503f8 100644
--- a/client/src/components/MobileMenu.vue
+++ b/client/src/components/MobileMenu.vue
@@ -80,6 +80,7 @@ const clickLink = (to: string | undefined) => {
               
               
  • +

    + + {{ $t("feedback.feedbackSent") }} +

    + + + + + + diff --git a/client/src/components/learningPath/FeedbackIntro.vue b/client/src/components/learningPath/FeedbackIntro.vue index f5410ca9..7804adf3 100644 --- a/client/src/components/learningPath/FeedbackIntro.vue +++ b/client/src/components/learningPath/FeedbackIntro.vue @@ -1,10 +1,10 @@ @@ -12,7 +12,7 @@ interface Props { title: string; intro: string; -}; +} const _props = withDefaults(defineProps(), { title: "", diff --git a/client/src/components/learningPath/LearningContent.vue b/client/src/components/learningPath/LearningContent.vue index ed9c116d..aa1799bd 100644 --- a/client/src/components/learningPath/LearningContent.vue +++ b/client/src/components/learningPath/LearningContent.vue @@ -52,7 +52,6 @@ const component = computed(() => { const showNavigationBorder = computed(() => { return block.value?.type !== "feedback"; }); -