diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/Coursebook.vue b/aleksis/apps/alsijil/frontend/components/coursebook/Coursebook.vue index aed34488e6cf200f9b1c6c4ae051a845feef0c87..9aa082419edc04af6158e1cb492bb1fb21ca15a4 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/Coursebook.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/Coursebook.vue @@ -70,7 +70,10 @@ </template> </infinite-scrolling-date-sorted-c-r-u-d-iterator> <v-scale-transition> - <absence-creation-dialog v-if="pageType === 'absences'" /> + <absence-creation-dialog + v-if="pageType === 'absences'" + :absence-reasons="absenceReasons" + /> </v-scale-transition> </div> </template> diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue index 7a6b4c73f5e3dbe6b6dbfa86df69b96b4a8d74a2..7a4b17c803ac4193f70ef413e913bd4a330c5733 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue @@ -30,6 +30,7 @@ :end-date="endDate" :comment="comment" :absence-reason="absenceReason" + :absence-reasons="absenceReasons" @valid="formValid = $event" @persons="persons = $event" @start-date="startDate = $event" @@ -121,6 +122,12 @@ export default { absenceReason: "", }; }, + props: { + absenceReasons: { + type: Array, + required: true, + }, + }, mounted() { this.addPermissions(["alsijil.view_register_absence_rule"]); this.clearForm(); diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationForm.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationForm.vue index 239c83d6bbd48700773c024967636a82f3d3c4a8..74f07cc4dcc9c24ccd42c0c8345182e5e60c6a9b 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationForm.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationForm.vue @@ -61,6 +61,7 @@ <absence-reason-group-select :rules="$rules().required.build()" :value="absenceReason" + :custom-absence-reasons="absenceReasons" @input="$emit('absence-reason', $event)" /> </div> @@ -115,6 +116,10 @@ export default { type: String, required: true, }, + absenceReasons: { + type: Array, + required: true, + }, }, computed: { maxStartTime() { diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/absenceReasons.graphql b/aleksis/apps/alsijil/frontend/components/coursebook/absences/absenceReasons.graphql deleted file mode 100644 index a86f608ec78d1bbc50bf558b5e0650cba5b5e8a7..0000000000000000000000000000000000000000 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/absenceReasons.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query absenceReasons($orderBy: [String], $filters: JSONString) { - items: coursebookAbsenceReasons(orderBy: $orderBy, filters: $filters) { - id - shortName - name - colour - default - canEdit - canDelete - } -} diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/coursebook.graphql b/aleksis/apps/alsijil/frontend/components/coursebook/coursebook.graphql index a49b73f149129fa86e131b804e027908c84f65db..6ae9ba9dae7e2f1de386c9b433f73ae2ae9f3a11 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/coursebook.graphql +++ b/aleksis/apps/alsijil/frontend/components/coursebook/coursebook.graphql @@ -111,7 +111,6 @@ query documentationsForCoursebook( oldId canEdit futureNotice - canDelete futureNoticeParticipationStatus canEditParticipationStatus canViewParticipationStatus