diff --git a/aleksis/apps/chronos/frontend/components/AmendLesson.vue b/aleksis/apps/chronos/frontend/components/AmendLesson.vue index aae3630e00d9c0a1baca177e401f7315d68fcca5..f43faa3a31d0b4d44a8459a63a0b99ae68228743 100644 --- a/aleksis/apps/chronos/frontend/components/AmendLesson.vue +++ b/aleksis/apps/chronos/frontend/components/AmendLesson.vue @@ -2,26 +2,26 @@ <v-card-actions v-if="checkPermission('chronos.edit_substitution_rule')"> <edit-button i18n-key="chronos.event.amend.edit_button" - @click="amendEvent.open = true" + @click="edit = true" /> <delete-button v-if="selectedEvent.meta.amended" i18n-key="chronos.event.amend.delete_button" - @click="amendEvent.delete = true" + @click="delete = true" /> <dialog-object-form - v-model="amendEvent.open" - :fields="amendEvent.fields" + v-model="edit" + :fields="fields" :is-create="!selectedEvent.meta.amended" createItemI18nKey="chronos.event.amend.title" - :gql-create-mutation="amendEvent.gqlCreateMutation" + :gql-create-mutation="gqlCreateMutation" :get-create-data="transformCreateData" - :default-item="amendEvent.default" + :default-item="default" editItemI18nKey="chronos.event.amend.title" - :gql-patch-mutation="amendEvent.gqlPatchMutation" + :gql-patch-mutation="gqlPatchMutation" :get-patch-data="transformPatchData" :edit-item="initPatchData" - @cancel="amendEvent.open = false" + @cancel="open = false" @save="updateOnSave()" > <template #subject.field="{ attrs, on, item }"> @@ -69,8 +69,8 @@ </dialog-object-form> <delete-dialog deleteSuccessMessageI18nKey="chronos.event.amend.delete_success" - :gql-mutation="amendEvent.gqlDeleteMutation" - v-model="amendEvent.delete" + :gql-mutation="gqlDeleteMutation" + v-model="delete" :item="selectedEvent.meta" @success="updateOnSave()" > @@ -107,39 +107,37 @@ export default { mixins: [permissionsMixin], data() { return { - amendEvent: { - open: false, - fields: [ - { - text: this.$t("chronos.event.amend.subject"), - value: "subject", - }, - { - text: this.$t("chronos.event.amend.teachers"), - value: "teachers", - }, - { - text: this.$t("chronos.event.amend.rooms"), - value: "rooms", - }, - { - text: this.$t("chronos.event.amend.cancelled"), - value: "cancelled", - }, - { - text: this.$t("chronos.event.amend.comment"), - value: "comment", - }, - ], - default: { - cancelled: this.selectedEvent.meta.cancelled, - comment: this.selectedEvent.meta.comment, + edit: false, + fields: [ + { + text: this.$t("chronos.event.amend.subject"), + value: "subject", }, - gqlCreateMutation: createAmendLesson, - gqlPatchMutation: patchAmendLesson, - delete: false, - gqlDeleteMutation: deleteAmendLesson, + { + text: this.$t("chronos.event.amend.teachers"), + value: "teachers", + }, + { + text: this.$t("chronos.event.amend.rooms"), + value: "rooms", + }, + { + text: this.$t("chronos.event.amend.cancelled"), + value: "cancelled", + }, + { + text: this.$t("chronos.event.amend.comment"), + value: "comment", + }, + ], + default: { + cancelled: this.selectedEvent.meta.cancelled, + comment: this.selectedEvent.meta.comment, }, + gqlCreateMutation: createAmendLesson, + gqlPatchMutation: patchAmendLesson, + delete: false, + gqlDeleteMutation: deleteAmendLesson, }; }, methods: {