53 lines
1.5 KiB
Vue
53 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import { useCockpitStore } from "@/stores/cockpit";
|
|
import { useCompetenceStore } from "@/stores/competence";
|
|
import { useCourseSessionsStore } from "@/stores/courseSessions";
|
|
import { useLearningPathStore } from "@/stores/learningPath";
|
|
import { useUserStore } from "@/stores/user";
|
|
import * as log from "loglevel";
|
|
import { onMounted } from "vue";
|
|
|
|
log.debug("CockpitParentPage created");
|
|
|
|
const props = defineProps<{
|
|
courseSlug: string;
|
|
}>();
|
|
|
|
const cockpitStore = useCockpitStore();
|
|
const competenceStore = useCompetenceStore();
|
|
const learningPathStore = useLearningPathStore();
|
|
const courseSessionStore = useCourseSessionsStore();
|
|
|
|
onMounted(async () => {
|
|
log.debug("CockpitParentPage mounted", props.courseSlug);
|
|
|
|
try {
|
|
const currentCourseSession = courseSessionStore.currentCourseSession;
|
|
if (currentCourseSession?.id) {
|
|
await cockpitStore.loadCourseSessionUsers(currentCourseSession.id);
|
|
cockpitStore.courseSessionUsers?.forEach((csu) => {
|
|
competenceStore.loadCompetenceProfilePage(
|
|
props.courseSlug + "-competence",
|
|
csu.user_id
|
|
);
|
|
|
|
learningPathStore.loadLearningPath(props.courseSlug + "-lp", csu.user_id);
|
|
});
|
|
learningPathStore.loadLearningPath(props.courseSlug + "-lp", useUserStore().id);
|
|
}
|
|
} catch (error) {
|
|
log.error(error);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="bg-gray-200">
|
|
<main>
|
|
<router-view></router-view>
|
|
</main>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|