Remove typecheck errors
This commit is contained in:
parent
c8824763f6
commit
9e92a2a521
|
|
@ -55,7 +55,6 @@ function learninPathSlug(): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDropdownSelect(data: DropdownData) {
|
function handleDropdownSelect(data: DropdownData) {
|
||||||
log.debug("Selected action:", data.action);
|
|
||||||
switch (data.action) {
|
switch (data.action) {
|
||||||
case "settings":
|
case "settings":
|
||||||
router.push("/profile");
|
router.push("/profile");
|
||||||
|
|
@ -76,25 +75,21 @@ onMounted(() => {
|
||||||
log.debug("MainNavigationBar mounted");
|
log.debug("MainNavigationBar mounted");
|
||||||
});
|
});
|
||||||
|
|
||||||
const profileDropdownData: DropdownListItem[][] = [
|
const profileDropdownData: DropdownListItem[] = [
|
||||||
[
|
{
|
||||||
{
|
title: "Kontoeinstellungen",
|
||||||
title: "Kontoeinstellungen",
|
icon: IconSettings as Component,
|
||||||
icon: IconSettings as Component,
|
data: {
|
||||||
data: {
|
action: "settings",
|
||||||
action: "settings",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
[
|
{
|
||||||
{
|
title: "Abmelden",
|
||||||
title: "Abmelden",
|
icon: IconLogout as Component,
|
||||||
icon: IconLogout as Component,
|
data: {
|
||||||
data: {
|
action: "logout",
|
||||||
action: "logout",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -102,7 +97,6 @@ const profileDropdownData: DropdownListItem[][] = [
|
||||||
<div>
|
<div>
|
||||||
<Teleport to="body">
|
<Teleport to="body">
|
||||||
<MobileMenu
|
<MobileMenu
|
||||||
:user-store="userStore"
|
|
||||||
:show="state.showMenu"
|
:show="state.showMenu"
|
||||||
:learning-path-slug="learninPathSlug()"
|
:learning-path-slug="learninPathSlug()"
|
||||||
:learning-path-name="learningPathName()"
|
:learning-path-name="learningPathName()"
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,14 @@
|
||||||
import IconLogout from "@/components/icons/IconLogout.vue";
|
import IconLogout from "@/components/icons/IconLogout.vue";
|
||||||
import IconSettings from "@/components/icons/IconSettings.vue";
|
import IconSettings from "@/components/icons/IconSettings.vue";
|
||||||
import ItFullScreenModal from "@/components/ui/ItFullScreenModal.vue";
|
import ItFullScreenModal from "@/components/ui/ItFullScreenModal.vue";
|
||||||
|
import { useUserStore } from "@/stores/user";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
show: boolean;
|
show: boolean;
|
||||||
userStore: object;
|
|
||||||
learningPathName: string;
|
learningPathName: string;
|
||||||
learningPathSlug: string;
|
learningPathSlug: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ interface Props {
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
criteria: undefined,
|
|
||||||
showState: false,
|
showState: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ const props = withDefaults(defineProps<Props>(), {
|
||||||
<div>
|
<div>
|
||||||
<h4 class="mb-2 text-bold">{{ title }}</h4>
|
<h4 class="mb-2 text-bold">{{ title }}</h4>
|
||||||
<p class="mb-2">{{ description }}</p>
|
<p class="mb-2">{{ description }}</p>
|
||||||
<media-link :to="url" :blank="openWindow" class="link">
|
<MediaLink :to="url" :blank="openWindow" class="link">
|
||||||
<span class="inline">{{ linkText }}</span>
|
<span class="inline">{{ linkText }}</span>
|
||||||
</media-link>
|
</MediaLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@
|
||||||
// https://vueschool.io/articles/vuejs-tutorials/extending-vue-router-links-in-vue-3/
|
// https://vueschool.io/articles/vuejs-tutorials/extending-vue-router-links-in-vue-3/
|
||||||
|
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { RouterLink } from "vue-router";
|
import type { RouterLinkProps } from "vue-router";
|
||||||
|
|
||||||
const props = defineProps({
|
export interface Props extends RouterLinkProps {
|
||||||
...RouterLink.props, // @ts-ignore
|
blank?: boolean;
|
||||||
blank: {
|
}
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
},
|
blank: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const isExternalLink = computed(
|
const isExternalLink = computed(
|
||||||
|
|
@ -24,7 +24,7 @@ const isExternalLink = computed(
|
||||||
v-if="isExternalLink"
|
v-if="isExternalLink"
|
||||||
:target="props.blank ? '_blank' : '_self'"
|
:target="props.blank ? '_blank' : '_self'"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
:href="props.to"
|
:href="(props.to as string)"
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ import type { DropdownListItem } from "@/types";
|
||||||
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
|
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
buttonClasses: [string];
|
buttonClasses: [string] | [];
|
||||||
listItems: [[DropdownListItem]];
|
listItems: DropdownListItem[];
|
||||||
align: "left" | "right";
|
align: "left" | "right";
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: "select", data: object): void;
|
(e: "select", data: any): void;
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -33,20 +33,18 @@ const emit = defineEmits<{
|
||||||
class="absolute mt-2 px-6 w-56 w-max-full origin-top-right divide-y divide-gray-500 bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
|
class="absolute mt-2 px-6 w-56 w-max-full origin-top-right divide-y divide-gray-500 bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
|
||||||
:class="[align === 'left' ? 'left-0' : 'right-0']"
|
:class="[align === 'left' ? 'left-0' : 'right-0']"
|
||||||
>
|
>
|
||||||
<div v-for="section in listItems" :key="section" class="">
|
<div v-for="item in listItems" :key="item.title" class="px-1 py-1">
|
||||||
<div v-for="item in section" :key="item" class="px-1 py-1">
|
<MenuItem>
|
||||||
<MenuItem>
|
<button
|
||||||
<button
|
class="text-black group flex w-full items-center px-0 py-2 text-sm"
|
||||||
class="text-black group flex w-full items-center px-0 py-2 text-sm"
|
@click="$emit('select', item.data)"
|
||||||
@click="$emit('select', item.data)"
|
>
|
||||||
>
|
<span class="inline-block pr-2">
|
||||||
<span class="inline-block pr-2">
|
<component :is="item.icon" v-if="item.icon"></component>
|
||||||
<component :is="item.icon" v-if="item.icon"></component>
|
</span>
|
||||||
</span>
|
{{ item.title }}
|
||||||
{{ item.title }}
|
</button>
|
||||||
</button>
|
</MenuItem>
|
||||||
</MenuItem>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</MenuItems>
|
</MenuItems>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ export function setI18nLanguage(i18n: any, locale: string) {
|
||||||
*
|
*
|
||||||
* axios.defaults.headers.common['Accept-Language'] = locale
|
* axios.defaults.headers.common['Accept-Language'] = locale
|
||||||
*/
|
*/
|
||||||
document.querySelector("html").setAttribute("lang", locale);
|
document.querySelector("html")?.setAttribute("lang", locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function loadLocaleMessages(i18n: any, locale: any) {
|
export async function loadLocaleMessages(i18n: any, locale: any) {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,11 @@ const userStore = useUserStore();
|
||||||
<form
|
<form
|
||||||
class="bg-white p-4 lg:p-8"
|
class="bg-white p-4 lg:p-8"
|
||||||
@submit.prevent="
|
@submit.prevent="
|
||||||
userStore.handleLogin(state.username, state.password, route.query.next)
|
userStore.handleLogin(
|
||||||
|
state.username,
|
||||||
|
state.password,
|
||||||
|
route.query.next as string
|
||||||
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
|
|
||||||
|
|
@ -27,29 +27,25 @@ const state = reactive({
|
||||||
});
|
});
|
||||||
|
|
||||||
const dropdownData = [
|
const dropdownData = [
|
||||||
[
|
{
|
||||||
{
|
title: "Option 1",
|
||||||
title: "Option 1",
|
icon: IconLogout,
|
||||||
icon: IconLogout,
|
data: {},
|
||||||
data: {},
|
},
|
||||||
|
{
|
||||||
|
title: "Option 2",
|
||||||
|
icon: IconLogout,
|
||||||
|
data: {
|
||||||
|
test: 12,
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: "Option 2",
|
{
|
||||||
icon: null,
|
title: "Option 3",
|
||||||
data: {
|
icon: IconSettings,
|
||||||
test: 12,
|
data: {
|
||||||
},
|
amount: 34,
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
[
|
|
||||||
{
|
|
||||||
title: "Option 3",
|
|
||||||
icon: IconSettings,
|
|
||||||
data: {
|
|
||||||
amount: 34,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// TODO: die CSS-Klasse für die Farben wird hier in der StyleGuideView.vue generiert.
|
// TODO: die CSS-Klasse für die Farben wird hier in der StyleGuideView.vue generiert.
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ const competenceStore = useCompetenceStore();
|
||||||
<nav class="py-4 lg:pb-8">
|
<nav class="py-4 lg:pb-8">
|
||||||
<router-link
|
<router-link
|
||||||
class="btn-text inline-flex items-center pl-0"
|
class="btn-text inline-flex items-center pl-0"
|
||||||
|
v-if="competenceStore.competenceProfilePage"
|
||||||
:to="competenceStore.competenceProfilePage?.frontend_url"
|
:to="competenceStore.competenceProfilePage?.frontend_url"
|
||||||
>
|
>
|
||||||
<it-icon-arrow-left />
|
<it-icon-arrow-left />
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ let competencePage: CompetencePage | undefined;
|
||||||
const findCriteria = () => {
|
const findCriteria = () => {
|
||||||
for (const page of competenceStore.competenceProfilePage
|
for (const page of competenceStore.competenceProfilePage
|
||||||
?.children as CompetencePage[]) {
|
?.children as CompetencePage[]) {
|
||||||
for (let criteria of page.children) {
|
for (const criteria of page.children) {
|
||||||
if (criteria.slug === route.params["criteriaSlug"]) {
|
if (criteria.slug === route.params["criteriaSlug"]) {
|
||||||
currentQuestion = criteria;
|
currentQuestion = criteria;
|
||||||
competencePage = page;
|
competencePage = page;
|
||||||
|
|
@ -63,7 +63,7 @@ findCriteria();
|
||||||
@back="router.back()"
|
@back="router.back()"
|
||||||
@next="router.back()"
|
@next="router.back()"
|
||||||
>
|
>
|
||||||
<div class="container-medium">
|
<div class="container-medium" v-if="currentQuestion">
|
||||||
<div class="mt-4 lg:mt-8 p-6 lg:p-12 border">
|
<div class="mt-4 lg:mt-8 p-6 lg:p-12 border">
|
||||||
<h2 class="heading-2">
|
<h2 class="heading-2">
|
||||||
{{ currentQuestion.competence_id }} {{ currentQuestion.title }}
|
{{ currentQuestion.competence_id }} {{ currentQuestion.title }}
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,11 @@ onMounted(async () => {
|
||||||
const learningUnits = circleStore.circle?.learningSequences.flatMap(
|
const learningUnits = circleStore.circle?.learningSequences.flatMap(
|
||||||
(ls) => ls.learningUnits
|
(ls) => ls.learningUnits
|
||||||
);
|
);
|
||||||
wagtailPage = learningUnits.find((lu) => {
|
if (learningUnits) {
|
||||||
return lu.slug.endsWith(slugEnd);
|
wagtailPage = learningUnits.find((lu) => {
|
||||||
});
|
return lu.slug.endsWith(slugEnd);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (wagtailPage) {
|
if (wagtailPage) {
|
||||||
document
|
document
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ const mediaList = computed(() => {
|
||||||
return contentCollection.value.contents[0].type === "learn_media";
|
return contentCollection.value.contents[0].type === "learn_media";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(learnMediaCollection);
|
|
||||||
return learnMediaCollection?.value;
|
return learnMediaCollection?.value;
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
@ -35,7 +34,7 @@ const mediaList = computed(() => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="mediaCategory"
|
v-if="mediaCategory && mediaStore.mediaLibraryPage && mediaList"
|
||||||
class="fixed top-0 overflow-y-scroll bg-white h-full w-full"
|
class="fixed top-0 overflow-y-scroll bg-white h-full w-full"
|
||||||
>
|
>
|
||||||
<div class="bg-gray-200">
|
<div class="bg-gray-200">
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import type {
|
||||||
LearningContent,
|
LearningContent,
|
||||||
LearningUnit,
|
LearningUnit,
|
||||||
LearningUnitPerformanceCriteria,
|
LearningUnitPerformanceCriteria,
|
||||||
|
PerformanceCriteria,
|
||||||
} from "@/types";
|
} from "@/types";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
|
|
||||||
|
|
@ -85,16 +86,22 @@ export const useCircleStore = defineStore({
|
||||||
return learningUnit;
|
return learningUnit;
|
||||||
},
|
},
|
||||||
async markCompletion(
|
async markCompletion(
|
||||||
page: LearningContent | LearningUnitPerformanceCriteria,
|
page:
|
||||||
|
| LearningContent
|
||||||
|
| LearningUnitPerformanceCriteria
|
||||||
|
| PerformanceCriteria
|
||||||
|
| undefined,
|
||||||
completion_status: CourseCompletionStatus = "success"
|
completion_status: CourseCompletionStatus = "success"
|
||||||
) {
|
) {
|
||||||
const completionStore = useCompletionStore();
|
const completionStore = useCompletionStore();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
page.completion_status = completion_status;
|
if (page) {
|
||||||
const completionData = await completionStore.markPage(page);
|
page.completion_status = completion_status;
|
||||||
if (this.circle) {
|
const completionData = await completionStore.markPage(page);
|
||||||
this.circle.parseCompletionData(completionData);
|
if (this.circle) {
|
||||||
|
this.circle.parseCompletionData(completionData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import type { Component } from "vue";
|
||||||
|
|
||||||
export type CourseCompletionStatus = "unknown" | "fail" | "success";
|
export type CourseCompletionStatus = "unknown" | "fail" | "success";
|
||||||
|
|
||||||
|
|
||||||
export interface BaseCourseWagtailPage {
|
export interface BaseCourseWagtailPage {
|
||||||
readonly id: number;
|
readonly id: number;
|
||||||
readonly title: string;
|
readonly title: string;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue