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

View file

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