From 659684f25bae8849dff9de507b3ee0b6526723da Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Wed, 28 Sep 2022 16:51:10 +0200 Subject: [PATCH] Fix some type errors --- client/src/components/circle/CircleOverview.vue | 4 ++-- client/src/components/circle/LearningContent.vue | 3 --- client/src/stores/circle.ts | 2 ++ client/src/stores/learningPath.ts | 2 ++ client/src/views/CircleView.vue | 6 +----- client/src/views/LearningPathView.vue | 10 +++++----- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/client/src/components/circle/CircleOverview.vue b/client/src/components/circle/CircleOverview.vue index cf181b89..4b9fb922 100644 --- a/client/src/components/circle/CircleOverview.vue +++ b/client/src/components/circle/CircleOverview.vue @@ -3,7 +3,7 @@ import type { Circle } from '@/services/circle' import ItFullScreenModal from '@/components/ui/ItFullScreenModal.vue' const props = defineProps<{ - circle: Circle + circle: Circle | undefined show: boolean }>() @@ -12,7 +12,7 @@ const props = defineProps<{ diff --git a/client/src/stores/circle.ts b/client/src/stores/circle.ts index 41b82367..e44235c8 100644 --- a/client/src/stores/circle.ts +++ b/client/src/stores/circle.ts @@ -9,6 +9,7 @@ import { useLearningPathStore } from '@/stores/learningPath' export type CircleStoreState = { circle: Circle | undefined + page: 'INDEX' | 'OVERVIEW' } export const useCircleStore = defineStore({ @@ -16,6 +17,7 @@ export const useCircleStore = defineStore({ state: () => { return { circle: undefined, + page: 'INDEX', } as CircleStoreState; }, getters: { diff --git a/client/src/stores/learningPath.ts b/client/src/stores/learningPath.ts index d04cfb75..778c25c8 100644 --- a/client/src/stores/learningPath.ts +++ b/client/src/stores/learningPath.ts @@ -4,6 +4,7 @@ import { LearningPath } from '@/services/learningPath' export type LearningPathStoreState = { learningPath: LearningPath | undefined + page: 'INDEX' | 'OVERVIEW' } export const useLearningPathStore = defineStore({ @@ -11,6 +12,7 @@ export const useLearningPathStore = defineStore({ state: () => { return { learningPath: undefined, + page: 'INDEX', } as LearningPathStoreState; }, getters: {}, diff --git a/client/src/views/CircleView.vue b/client/src/views/CircleView.vue index 88aed09e..63b72a79 100644 --- a/client/src/views/CircleView.vue +++ b/client/src/views/CircleView.vue @@ -3,7 +3,6 @@ import * as log from 'loglevel' import LearningSequence from '@/components/circle/LearningSequence.vue' import CircleOverview from '@/components/circle/CircleOverview.vue' import CircleDiagram from '@/components/circle/CircleDiagram.vue' -import LearningContent from '@/components/circle/LearningContent.vue' import { computed, onMounted } from 'vue' import { useCircleStore } from '@/stores/circle' @@ -65,10 +64,7 @@ onMounted(async () => { /> -
- -
-
+
diff --git a/client/src/views/LearningPathView.vue b/client/src/views/LearningPathView.vue index 902856ba..90f9717e 100644 --- a/client/src/views/LearningPathView.vue +++ b/client/src/views/LearningPathView.vue @@ -7,7 +7,7 @@ import { useUserStore } from '@/stores/user' import LearningPathDiagram from '@/components/circle/LearningPathDiagram.vue' import LearningPathViewVertical from '@/views/LearningPathViewVertical.vue' -import { LearningPath } from '@/services/learningPath' +import type { LearningPath } from '@/services/learningPath' log.debug('LearningPathView created') @@ -28,7 +28,7 @@ onMounted(async () => { } }) -const createContinueUrl = (learningPath: LearningPath) => { +const createContinueUrl = (learningPath: LearningPath): [string, boolean] => { if (learningPath.nextLearningContent) { const circle = learningPath.nextLearningContent.parentCircle const lsShortSlug = learningPath.nextLearningContent.parentLearningSequence?.slug.replace(`${circle.slug}-`, '') @@ -77,14 +77,14 @@ const createContinueUrl = (learningPath: LearningPath) => { class="bg-white m-6 lg:m-12 p-8 flex flex-col lg:flex-row divide-y lg:divide-y-0 lg:divide-x divide-gray-500 justify-start" >
-

Willkommmen zurück, {{ userStore.first_name }}

+

Willkommmen zurück, {{ userStore.first_name }}

-
+
Nächster Schritt

{{ learningPathStore.learningPath.nextLearningContent.parentCircle.title }}: - {{ learningPathStore.learningPath.nextLearningContent.parentLearningSequence.title }} + {{ learningPathStore.learningPath.nextLearningContent.parentLearningSequence?.title }}