wip: Make linter and TS happy, fix cypress

This commit is contained in:
Christian Cueni 2023-12-05 12:01:57 +01:00
parent d1166ed507
commit 3a5c941360
5 changed files with 7 additions and 15 deletions

View File

@ -7,7 +7,6 @@ import { useMutation } from "@urql/vue";
import { useRouteQuery } from "@vueuse/router"; import { useRouteQuery } from "@vueuse/router";
import log from "loglevel"; import log from "loglevel";
import { computed, onMounted, reactive, ref } from "vue"; import { computed, onMounted, reactive, ref } from "vue";
import { useTranslation } from "i18next-vue";
import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables"; import { useCourseSessionDetailQuery, useCurrentCourseSession } from "@/composables";
const props = defineProps<{ const props = defineProps<{
@ -23,8 +22,6 @@ const props = defineProps<{
const courseSession = useCurrentCourseSession(); const courseSession = useCurrentCourseSession();
const courseSessionDetailResult = useCourseSessionDetailQuery(); const courseSessionDetailResult = useCourseSessionDetailQuery();
const { t } = useTranslation();
const stepNo = useRouteQuery("step", "0", { transform: Number, mode: "push" }); const stepNo = useRouteQuery("step", "0", { transform: Number, mode: "push" });
const title = computed(() => `«${props.content.circle?.title}»: ${props.title}`); const title = computed(() => `«${props.content.circle?.title}»: ${props.title}`);

View File

@ -6,7 +6,7 @@ import {
RATINGS, RATINGS,
YES_NO, YES_NO,
} from "@/pages/learningPath/learningContentPage/feedback/feedback.constants"; } from "@/pages/learningPath/learningContentPage/feedback/feedback.constants";
import { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types"; import type { LearningContentFeedbackUK, LearningContentFeedbackVV } from "@/types";
import { computed } from "vue"; import { computed } from "vue";
import { useTranslation } from "i18next-vue"; import { useTranslation } from "i18next-vue";
import { useCourseSessionDetailQuery } from "@/composables"; import { useCourseSessionDetailQuery } from "@/composables";

View File

@ -6,7 +6,7 @@ import {
RATINGS, RATINGS,
YES_NO, YES_NO,
} from "@/pages/learningPath/learningContentPage/feedback/feedback.constants"; } 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 FeedbackBase from "@/pages/learningPath/learningContentPage/feedback/FeedbackBase.vue";
import { useTranslation } from "i18next-vue"; import { useTranslation } from "i18next-vue";
@ -28,11 +28,6 @@ const stepLabels = [
t("general.submission"), 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 = [ const questionData = [
{ {
modelKey: "satisfaction", modelKey: "satisfaction",

View File

@ -156,7 +156,7 @@ def command(
print("create_feedback_responses") print("create_feedback_responses")
course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID) course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID)
learning_content_feedback_page = LearningContentFeedbackUK.objects.get( 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( create_feedback_response_data(
feedback_user=User.objects.get(id=TEST_STUDENT1_USER_ID), feedback_user=User.objects.get(id=TEST_STUDENT1_USER_ID),

View File

@ -247,7 +247,7 @@ class LearningUnitObjectType(DjangoObjectType):
if hasattr(info.context, "circle_descendants"): if hasattr(info.context, "circle_descendants"):
circle_descendants = info.context.circle_descendants circle_descendants = info.context.circle_descendants
index = circle_descendants.index(self) index = circle_descendants.index(self)
siblings = circle_descendants[index + 1:] siblings = circle_descendants[index + 1 :]
if not siblings: if not siblings:
siblings = self.get_siblings().live().specific() siblings = self.get_siblings().live().specific()
@ -280,7 +280,7 @@ class LearningSequenceObjectType(DjangoObjectType):
if hasattr(info.context, "circle_descendants"): if hasattr(info.context, "circle_descendants"):
circle_descendants = info.context.circle_descendants circle_descendants = info.context.circle_descendants
index = circle_descendants.index(root) index = circle_descendants.index(root)
siblings = circle_descendants[index + 1:] siblings = circle_descendants[index + 1 :]
if not siblings: if not siblings:
siblings = root.get_siblings().live().specific() siblings = root.get_siblings().live().specific()
@ -314,7 +314,7 @@ class CircleObjectType(DjangoObjectType):
if hasattr(info.context, "learning_path_descendants"): if hasattr(info.context, "learning_path_descendants"):
children = info.context.learning_path_descendants children = info.context.learning_path_descendants
circle_start_index = children.index(self) 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_circle_index = find_first_index(
next_children, next_children,
pred=lambda child: child.specific_class == Circle, pred=lambda child: child.specific_class == Circle,
@ -353,7 +353,7 @@ class TopicObjectType(DjangoObjectType):
if hasattr(info.context, "learning_path_descendants"): if hasattr(info.context, "learning_path_descendants"):
learning_path_descendants = info.context.learning_path_descendants learning_path_descendants = info.context.learning_path_descendants
index = learning_path_descendants.index(root) index = learning_path_descendants.index(root)
siblings = learning_path_descendants[index + 1:] siblings = learning_path_descendants[index + 1 :]
if not siblings: if not siblings:
siblings = root.get_next_siblings().live().specific() siblings = root.get_next_siblings().live().specific()