Skip to content
Snippets Groups Projects
Verified Commit 06db77e5 authored by magicfelix's avatar magicfelix
Browse files

List one LessonDocumentation per week if enabled

parent ae6866c8
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@
</v-dialog>
<v-data-table
:headers="headers"
:items="lessonDocumentations"
:items="computedLessonDocumentations"
@click:row="editLessonDocumentation"
class="elevation-1"
>
......@@ -71,6 +71,7 @@
],
lessonDocumentationEdit: {},
selectedLessonperiodDatetime: {},
recordedWeeks: [],
}
},
computed: {
......@@ -78,8 +79,20 @@
let currentDatetime = new Date()
return this.plannedLessonperiodsDatetimes.filter(lp => new Date(lp.datetimeStart) > currentDatetime)
},
computedLessonDocumentations() {
return this.lessonDocumentations.filter(ld => this.recordDocumentation(ld))
},
},
methods: {
recordDocumentation(item) {
if (this.documentLessonTopicsByWeek === "True") {
if (this.recordedWeeks.includes(item.week)) {
return false
}
this.recordedWeeks.push(item.week)
}
return true
},
async loadLessonDocumentation(item) {
const result = await this.$apollo.mutate({
mutation: require("./LessonDocumentation.graphql"),
......
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