Skip to content
Snippets Groups Projects
Commit 1f163e24 authored by Julian's avatar Julian
Browse files

Cleanup and reformat

parent 5344062a
No related branches found
No related tags found
1 merge request!360Resolve "Add absence management to course book student dialog"
Pipeline #189535 failed
......@@ -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) {
......
......@@ -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 })
......
......@@ -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,
);
},
},
};
......
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