Skip to content
Snippets Groups Projects
Commit 002c25a5 authored by Julian's avatar Julian
Browse files

Allow extending the LessonDetails content slot

parent 4f600ec2
No related branches found
No related tags found
1 merge request!408Draft: Resolve "Extensible LessonEvent Calendar Dialog"
Pipeline #196466 failed
...@@ -100,6 +100,18 @@ ...@@ -100,6 +100,18 @@
</v-list-item-title> </v-list-item-title>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
<template v-for="detail in additionalDetails">
<v-divider inset />
<v-list-item>
<v-list-item-content>
<component
:is="detail.component"
:key="detail.key"
:lesson="selectedEvent"
/>
</v-list-item-content>
</v-list-item>
</template>
<v-card-actions class="flex-wrap" style="gap: 0.5em"> <v-card-actions class="flex-wrap" style="gap: 0.5em">
<amend-lesson <amend-lesson
v-if="selectedEvent" v-if="selectedEvent"
...@@ -149,6 +161,11 @@ export default { ...@@ -149,6 +161,11 @@ export default {
(action) => action.shouldDisplay.call(this, this.selectedEvent), (action) => action.shouldDisplay.call(this, this.selectedEvent),
); );
}, },
additionalDetails() {
return collections.chronosLessonEventCalendarAdditionalDetails.items.filter(
(detail) => detail.shouldDisplay.call(this, this.selectedEvent),
);
},
}, },
}; };
</script> </script>
export default {
props: {
lesson: {
type: Object,
required: true,
},
},
};
...@@ -24,6 +24,26 @@ export const collections = [ ...@@ -24,6 +24,26 @@ export const collections = [
name: "lessonEventCalendarAdditionalActions", name: "lessonEventCalendarAdditionalActions",
type: Object, type: Object,
}, },
/**
* List of components that show additional details for Lessons
* and Substitutions in the timetable/calendar.
*
* An object in this list looks like this:
* ```js
* {
* component: () => import("foo.vue"),
* shouldDisplay: (lessonEvent) => true || false,
* key: "shouldBeUnique",
* }
* ```
*
* Please use the lessonEventAdditionalDetailsMixin
* as a base for the component.
*/
{
name: "lessonEventCalendarAdditionalDetails",
type: Object,
},
]; ];
export default { export default {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment