From 1f163e243afb79c2126a78de53051a90b6de3efd Mon Sep 17 00:00:00 2001
From: Julian Leucker <leuckerj@gmail.com>
Date: Tue, 11 Jun 2024 16:20:58 +0200
Subject: [PATCH] Cleanup and reformat

---
 .../absences/ManageStudentsDialog.vue         | 24 -------------------
 .../absences/ManageStudentsTrigger.vue        |  2 --
 .../coursebook/documentation/LessonNotes.vue  | 15 +++++++-----
 3 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue
index a9f4fb0c7..3af1db588 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue
@@ -71,30 +71,6 @@ export default {
 
           return storedDocumentations;
         },
-        // {
-        //   optimisticResponse: {
-        //     updateParticipationStatuses: {
-        //       items: [
-        //         {
-        //           id: participation.id,
-        //           isOptimistic: true,
-        //           relatedDocumentation: {
-        //             id: this.documentation.id,
-        //             __typename: "DocumentationType",
-        //           },
-        //           absenceReason: value === "present" ? null : {
-        //             id: value,
-        //             name: "",
-        //             shortName: "",
-        //             __typename: "AbsenceReasonType",
-        //           },
-        //           __typename: "ParticipationStatusType",
-        //         },
-        //       ],
-        //       __typename: "ParticipationStatusBatchPatchMutation",
-        //     },
-        //   },
-        // },
       );
     },
     handleMultipleAction(absenceReasonId) {
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue
index 739ff4217..572036c67 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue
@@ -41,8 +41,6 @@ export default {
         },
         (storedDocumentations, incoming) => {
           // ID may be different now
-          console.log("incoming:", incoming);
-
           return storedDocumentations.map((doc) =>
             doc.id === this.documentation.id
               ? Object.assign(doc, incoming, { oldId: doc.id })
diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonNotes.vue b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonNotes.vue
index 880e92f4c..4c4c24675 100644
--- a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonNotes.vue
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonNotes.vue
@@ -7,16 +7,15 @@ import AbsenceReasonChip from "aleksis.apps.kolego/components/AbsenceReasonChip.
     class="d-flex align-center justify-space-between justify-md-end flex-wrap gap"
   >
     <v-chip dense color="success" outlined v-if="total > 0">
-      {{ $t("alsijil.coursebook.present_number", { present, total })}}
+      {{ $t("alsijil.coursebook.present_number", { present, total }) }}
     </v-chip>
     <absence-reason-chip
       v-for="participation in absences"
+      :key="'absence-' + participation.id"
       :absence-reason="participation.absenceReason"
       dense
     >
-      <template #prepend>
-        {{ participation.person.fullName }}:
-      </template>
+      <template #prepend> {{ participation.person.fullName }}: </template>
     </absence-reason-chip>
 
     <manage-students-trigger v-bind="documentationPartProps" />
@@ -36,11 +35,15 @@ export default {
       return this.documentation.participations.length;
     },
     present() {
-      return this.documentation.participations.filter(p => p.absenceReason === null).length;
+      return this.documentation.participations.filter(
+        (p) => p.absenceReason === null,
+      ).length;
     },
     absences() {
       // Get all course attendants who have an absence reason
-      return this.documentation.participations.filter(p => p.absenceReason !== null);
+      return this.documentation.participations.filter(
+        (p) => p.absenceReason !== null,
+      );
     },
   },
 };
-- 
GitLab