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 { ...@@ -71,30 +71,6 @@ export default {
return storedDocumentations; 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) { handleMultipleAction(absenceReasonId) {
......
...@@ -41,8 +41,6 @@ export default { ...@@ -41,8 +41,6 @@ export default {
}, },
(storedDocumentations, incoming) => { (storedDocumentations, incoming) => {
// ID may be different now // ID may be different now
console.log("incoming:", incoming);
return storedDocumentations.map((doc) => return storedDocumentations.map((doc) =>
doc.id === this.documentation.id doc.id === this.documentation.id
? Object.assign(doc, incoming, { oldId: doc.id }) ? Object.assign(doc, incoming, { oldId: doc.id })
......
...@@ -7,16 +7,15 @@ import AbsenceReasonChip from "aleksis.apps.kolego/components/AbsenceReasonChip. ...@@ -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" class="d-flex align-center justify-space-between justify-md-end flex-wrap gap"
> >
<v-chip dense color="success" outlined v-if="total > 0"> <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> </v-chip>
<absence-reason-chip <absence-reason-chip
v-for="participation in absences" v-for="participation in absences"
:key="'absence-' + participation.id"
:absence-reason="participation.absenceReason" :absence-reason="participation.absenceReason"
dense dense
> >
<template #prepend> <template #prepend> {{ participation.person.fullName }}: </template>
{{ participation.person.fullName }}:
</template>
</absence-reason-chip> </absence-reason-chip>
<manage-students-trigger v-bind="documentationPartProps" /> <manage-students-trigger v-bind="documentationPartProps" />
...@@ -36,11 +35,15 @@ export default { ...@@ -36,11 +35,15 @@ export default {
return this.documentation.participations.length; return this.documentation.participations.length;
}, },
present() { present() {
return this.documentation.participations.filter(p => p.absenceReason === null).length; return this.documentation.participations.filter(
(p) => p.absenceReason === null,
).length;
}, },
absences() { absences() {
// Get all course attendants who have an absence reason // 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