From 3a5c941360af0bfe4a7165c7f12b9f8bd32be11c Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Tue, 5 Dec 2023 12:01:57 +0100 Subject: [PATCH] wip: Make linter and TS happy, fix cypress --- .../learningContentPage/feedback/FeedbackBase.vue | 3 --- .../learningContentPage/feedback/FeedbackBlockUK.vue | 2 +- .../learningContentPage/feedback/FeedbackBlockVV.vue | 7 +------ .../core/management/commands/cypress_reset.py | 2 +- server/vbv_lernwelt/learnpath/graphql/types.py | 8 ++++---- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue index 3c1d3bcc..f80269b0 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue @@ -7,7 +7,6 @@ import { useMutation } from "@urql/vue"; import { useRouteQuery } from "@vueuse/router"; import log from "loglevel"; import { computed, onMounted, reactive, ref } from "vue"; -import { useTranslation } from "i18next-vue"; import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; const props = defineProps<{ @@ -23,8 +22,6 @@ const props = defineProps<{ const courseSession = useCurrentCourseSession(); const courseSessionDetailResult = useCourseSessionDetailQuery(); -const { t } = useTranslation(); - const stepNo = useRouteQuery("step", "0", { transform: Number, mode: "push" }); const title = computed(() => `«${props.content.circle?.title}»: ${props.title}`); diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue index 7bc02cca..0c0f00e8 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockUK.vue @@ -6,7 +6,7 @@ import { RATINGS, YES_NO, } from "@/pages/learningPath/learningContentPage/feedback/feedback.constants"; -import { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; +import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; import { computed } from "vue"; import { useTranslation } from "i18next-vue"; import { useCourseSessionDetailQuery } from "@/composables"; diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue index e6ff32af..d64a3b1c 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlockVV.vue @@ -6,7 +6,7 @@ import { RATINGS, YES_NO, } from "@/pages/learningPath/learningContentPage/feedback/feedback.constants"; -import { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; +import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; import FeedbackBase from "@/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue"; import { useTranslation } from "i18next-vue"; @@ -28,11 +28,6 @@ const stepLabels = [ t("general.submission"), ]; -const introduction = t("a.feedback.introductionVV"); -const title = t("Feedback"); -const completionTitle = t("feedback.completionDescriptionVV"); -const completionDescription = t("feedback.completionDescriptionVV"); - const questionData = [ { modelKey: "satisfaction", diff --git a/server/vbv_lernwelt/core/management/commands/cypress_reset.py b/server/vbv_lernwelt/core/management/commands/cypress_reset.py index eaa99484..05fc7f4c 100644 --- a/server/vbv_lernwelt/core/management/commands/cypress_reset.py +++ b/server/vbv_lernwelt/core/management/commands/cypress_reset.py @@ -156,7 +156,7 @@ def command( print("create_feedback_responses") course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID) learning_content_feedback_page = LearningContentFeedbackUK.objects.get( - slug="test-lehrgang-lp-circle-fahrzeug-lc-feedbackuk" + slug="test-lehrgang-lp-circle-fahrzeug-lc-feedback" ) create_feedback_response_data( feedback_user=User.objects.get(id=TEST_STUDENT1_USER_ID), diff --git a/server/vbv_lernwelt/learnpath/graphql/types.py b/server/vbv_lernwelt/learnpath/graphql/types.py index 1fbb6c4b..4e12cc4b 100644 --- a/server/vbv_lernwelt/learnpath/graphql/types.py +++ b/server/vbv_lernwelt/learnpath/graphql/types.py @@ -247,7 +247,7 @@ class LearningUnitObjectType(DjangoObjectType): if hasattr(info.context, "circle_descendants"): circle_descendants = info.context.circle_descendants index = circle_descendants.index(self) - siblings = circle_descendants[index + 1:] + siblings = circle_descendants[index + 1 :] if not siblings: siblings = self.get_siblings().live().specific() @@ -280,7 +280,7 @@ class LearningSequenceObjectType(DjangoObjectType): if hasattr(info.context, "circle_descendants"): circle_descendants = info.context.circle_descendants index = circle_descendants.index(root) - siblings = circle_descendants[index + 1:] + siblings = circle_descendants[index + 1 :] if not siblings: siblings = root.get_siblings().live().specific() @@ -314,7 +314,7 @@ class CircleObjectType(DjangoObjectType): if hasattr(info.context, "learning_path_descendants"): children = info.context.learning_path_descendants circle_start_index = children.index(self) - next_children = children[circle_start_index + 1:] + next_children = children[circle_start_index + 1 :] next_circle_index = find_first_index( next_children, pred=lambda child: child.specific_class == Circle, @@ -353,7 +353,7 @@ class TopicObjectType(DjangoObjectType): if hasattr(info.context, "learning_path_descendants"): learning_path_descendants = info.context.learning_path_descendants index = learning_path_descendants.index(root) - siblings = learning_path_descendants[index + 1:] + siblings = learning_path_descendants[index + 1 :] if not siblings: siblings = root.get_next_siblings().live().specific()