From 850167d169b9c191b774a5b006e1a4af747b54b4 Mon Sep 17 00:00:00 2001 From: Julian Leucker <leuckerj@gmail.com> Date: Sat, 6 Jul 2024 14:48:30 +0200 Subject: [PATCH] Display name of person in success message --- .../coursebook/absences/ManageStudentsDialog.vue | 14 ++++++++++++-- aleksis/apps/alsijil/frontend/messages/en.json | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue index c0764f8f3..9bba651a8 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue @@ -47,6 +47,8 @@ export default { showAlert: false, num: 0, reason: "no reason", + name: "nobody", + personIds: [], }, }; }, @@ -78,8 +80,16 @@ export default { this.$set(this.selected, []); this.$refs.iterator.selected = []; }, - activateFullDayDialog() { - // Separate method as there may be additional logic here in the future + activateFullDayDialog({ data: { updateParticipationStatuses: { items }}}) { + const itemIds = items.map(item => item.id); + const participations = this.documentation.participations.filter(part => itemIds.includes(part.id)); + + if (this.markAsAbsentDay.num === 1) { + this.markAsAbsentDay.name = participations[0].person.firstName; + } + + this.$set(this.markAsAbsentDay.personIds, itemIds); + this.markAsAbsentDay.showAlert = true; } }, diff --git a/aleksis/apps/alsijil/frontend/messages/en.json b/aleksis/apps/alsijil/frontend/messages/en.json index 91b3646df..7bb2946c1 100644 --- a/aleksis/apps/alsijil/frontend/messages/en.json +++ b/aleksis/apps/alsijil/frontend/messages/en.json @@ -113,7 +113,7 @@ "warning": "The following lessons are in the selected time period. Please check that you want to register the absences for these lessons before confirming." }, "mark_as_absent_day": { - "title": "Error: no person | Successfully marked as '{reason}' | Successfully marked {n} people as '{reason}'", + "title": "Error: no person | Successfully marked {name} as '{reason}' | Successfully marked {n} people as '{reason}'", "description": "Do you want to mark them as '{reason}' for the rest of their day?", "action_button": "Extend absence" } -- GitLab