Skip to content
Snippets Groups Projects
Commit 9f636abc authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Reformat

parent 4d72eafe
No related branches found
No related tags found
1 merge request!454Resolve "Room substitutions are not shown correctly"
Pipeline #194570 failed
......@@ -16,14 +16,10 @@ import SubjectChipSelectField from "aleksis.apps.cursus/components/SubjectChipSe
'ml-2 slot-number-mobile': !largeGrid,
}"
>
<span
v-if="slotNumberStart == slotNumberEnd"
>
<span v-if="slotNumberStart == slotNumberEnd">
{{ slotNumberStart }}.
</span>
<span v-else>
{{ slotNumberStart }}.–{{slotNumberEnd}}.
</span>
<span v-else> {{ slotNumberStart }}.–{{ slotNumberEnd }}. </span>
</div>
<div :class="{ 'text-right d-flex flex-column fit-content': largeGrid }">
<time :datetime="documentation.datetimeStart" class="text-no-wrap">
......@@ -145,16 +141,17 @@ export default {
(teacher) => teacher.id,
);
// IDs of teachers of new substitution lesson
const newIds = this.documentation.teachers.map((teacher) => teacher.id);
const newIds = this.documentation.teachers.map(
(teacher) => teacher.id,
);
const allTeachers = new Set(
this.documentation.amends.amends.teachers.concat(this.documentation.teachers),
this.documentation.amends.amends.teachers.concat(
this.documentation.teachers,
),
);
let teachersWithStatus = Array.from(allTeachers).map((teacher) => {
let removed = false;
if (
!newIds.includes(teacher.id) &&
oldIds.includes(teacher.id)
) {
if (!newIds.includes(teacher.id) && oldIds.includes(teacher.id)) {
// Mark teacher as being removed if they are only linked to the amended lesson
removed = true;
}
......@@ -162,7 +159,7 @@ export default {
});
return teachersWithStatus;
}
return this.documentation.amends.amends.teachers
return this.documentation.amends.amends.teachers;
}
return this.documentation.teachers;
},
......
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