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

List one LessonDocumentation per week if enabled

parent 2dfe44de
No related branches found
No related tags found
1 merge request!284Draft: Redesign entering of lesson documentation
......@@ -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