Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Commits
4d72eafe
Commit
4d72eafe
authored
3 months ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Fix displaying of teachers of documentationbs based on substitution lessons
parent
358a543d
No related branches found
No related tags found
1 merge request
!454
Resolve "Room substitutions are not shown correctly"
Pipeline
#194569
failed
3 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue
+33
-20
33 additions, 20 deletions
...components/coursebook/documentation/LessonInformation.vue
with
33 additions
and
20 deletions
aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue
+
33
−
20
View file @
4d72eafe
...
...
@@ -89,22 +89,14 @@ import SubjectChipSelectField from "aleksis.apps.cursus/components/SubjectChipSe
}"
>
<person-chip
v-for=
"teacher in
documentation.teacher
s"
v-for=
"teacher in
teachersWithStatu
s"
:key=
"documentation.id + '-teacher-' + teacher.id"
:person=
"teacher"
:no-link=
"compact"
v-bind=
"compact ? dialogActivator.attrs : {}"
v-on=
"compact ? dialogActivator.on : {}"
/>
<person-chip
v-for=
"teacher in amendedTeachers"
:key=
"documentation.id + '-amendedTeacher-' + teacher.id"
:person=
"teacher"
:no-link=
"compact"
v-bind=
"compact ? dialogActivator.attrs : {}"
v-on=
"compact ? dialogActivator.on : {}"
class=
"text-decoration-line-through"
disabled
:class=
"{ 'text-decoration-line-through': teacher?.removed }"
:disabled=
"teacher?.removed"
/>
</div>
</div>
...
...
@@ -142,16 +134,37 @@ export default {
largeGrid
()
{
return
this
.
compact
&&
!
this
.
$vuetify
.
breakpoint
.
mobile
;
},
amendedTeachers
()
{
if
(
this
.
documentation
?.
amends
?.
amends
?.
teachers
&&
this
.
documentation
.
amends
.
amends
.
teachers
.
length
)
{
return
this
.
documentation
.
amends
.
amends
.
teachers
.
filter
(
(
at
)
=>
!
this
.
documentation
.
teachers
.
includes
((
t
)
=>
t
.
id
===
at
.
id
),
);
// Group teachers by their substitution status (regular, removed)
teachersWithStatus
()
{
if
(
this
.
documentation
?.
amends
?.
amends
)
{
// Only do grouping if documentation is based on substitution and substitution
// has teachers linked with it.
if
(
this
.
documentation
.
teachers
.
length
>
0
)
{
// IDs of teachers of amended lesson
const
oldIds
=
this
.
documentation
.
amends
.
amends
.
teachers
.
map
(
(
teacher
)
=>
teacher
.
id
,
);
// IDs of teachers of new substitution lesson
const
newIds
=
this
.
documentation
.
teachers
.
map
((
teacher
)
=>
teacher
.
id
);
const
allTeachers
=
new
Set
(
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
)
)
{
// Mark teacher as being removed if they are only linked to the amended lesson
removed
=
true
;
}
return
{
...
teacher
,
removed
:
removed
};
});
return
teachersWithStatus
;
}
return
this
.
documentation
.
amends
.
amends
.
teachers
}
return
[]
;
return
this
.
documentation
.
teachers
;
},
slotNumberStart
()
{
if
(
this
.
documentation
?.
amends
?.
amends
?.
slotNumberStart
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment