fix(frontend): Alleen fetchen bij open

This commit is contained in:
Tibo De Peuter 2025-05-20 15:33:40 +02:00
parent a88390f46b
commit 4ca57d8b8c
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
2 changed files with 39 additions and 39 deletions

View file

@ -13,42 +13,33 @@
activeObjectId: string;
}>();
const learningObjectsQuery = useLearningObjectListForPathQuery(props.path);
const learningObjects = useLearningObjectListForPathQuery(props.path);
</script>
<template>
<v-expansion-panel :value="props.path.hruid">
<v-expansion-panel-title>
{{ path.title }}
</v-expansion-panel-title>
<v-expansion-panel-text>
<v-lazy>
<using-query-result
:query-result="learningObjectsQuery"
v-slot="learningObjects: { data: LearningObject[] }"
>
<template
v-for="node in learningObjects.data"
:key="node.key"
>
<v-list-item
link
:to="{
path: `/discussion-reload/${props.path.hruid}/${node.language}/${node.key}`,
query: route.query,
}"
:title="node.title"
:active="node.key === props.activeObjectId"
>
<template v-slot:append>
<QuestionNotification :node="node"></QuestionNotification>
</template>
</v-list-item>
</template>
</using-query-result>
</v-lazy>
</v-expansion-panel-text>
</v-expansion-panel>
<using-query-result
:query-result="learningObjects"
v-slot="learningObjects: { data: LearningObject[] }"
>
<template
v-for="node in learningObjects.data"
:key="node.key"
>
<v-list-item
link
:to="{
path: `/discussion-reload/${props.path.hruid}/${node.language}/${node.key}`,
query: route.query,
}"
:title="node.title"
:active="node.key === props.activeObjectId"
>
<template v-slot:append>
<QuestionNotification :node="node"></QuestionNotification>
</template>
</v-list-item>
</template>
</using-query-result>
</template>
<style scoped></style>

View file

@ -43,12 +43,21 @@
:query-result="allLearningPathsResult"
v-slot="learningPaths: { data: LearningPath[] }"
>
<DiscussionSideBarElement
v-for="learningPath in learningPaths.data"
:path="learningPath"
:activeObjectId="props.learningObjectHruid"
:key="learningPath.hruid"
/>
<v-expansion-panel v-for="learningPath in learningPaths.data"
:key="learningPath.hruid"
:value="learningPath.hruid">
<v-expansion-panel-title>
{{ learningPath.title }}
</v-expansion-panel-title>
<v-expansion-panel-text>
<v-lazy>
<DiscussionSideBarElement
:path="learningPath"
:activeObjectId="props.learningObjectHruid"
/>
</v-lazy>
</v-expansion-panel-text>
</v-expansion-panel>
</using-query-result>
</v-expansion-panels>
</div>