Implement Vue substitution frontend #211
Labels
No labels
Security
TeX
auto-update
board
done
board
ready
board
todo
check
delete-eslint-rc-js
check
update-builddeps-package-json
check
update-eslint-rc-js
check
update-gitignore
check
update-merge-request-template
check
update-prettier-ignore
check
update-pyproject-toml
check
update-renovate-json
check
update-tox-ini
part
backend
part
ci
part
docs
part
frontend
part
i18n
part
non-technical
part
packaging
prio
1
prio
2
prio
3
release-mr-5.x
size
large
size
medium
size
small
source
customer
source
customer::fsmw
source
customer::fss
source
customer::teckids
source
downstream
type
breaking
type
bug
type
feature
type
refactoring
workflow
blocked
workflow
confirmed
workflow
current-todo
workflow
discussing
workflow
new-app
workflow
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aleksis/AlekSIS-App-Chronos#211
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a user has the required permission(*), lessons in the timetable should have a "manage" or "substituion" or something like that, button. Clicking on it should open a dialog (?), in which subject, teachers and room can be altered and an option to mark the lesson as cancelled and to write a comment are provided.
*: See rules.py in Chronos. There are things like
chronos.edit_substitution_rulethat can be used and (if necessary) be adjusted.assigned to @permcu
changed the description
changed the description
changed the description
created branch
211-implement-vue-substitution-frontendto address this issuementioned in merge request !614
@magicfelix: The rules you mentioned are from Lesrooster. I think we should stay in Chronos. Could you update them please.
changed the description
Updated
The substitution frontend (via amend LessonEvents) works now. Backend
and LessonEvent handling is finished.
This leaves us with a few more TODOs:
TODO: PRIO (@yuha ) Currently selectedEvent is only updated
in backend & frontend has to wait for
poll. Instead selectedEvent should
update immediatly on any changes in
substitution frontend.
TODO: (@hansegucker ) Display of cancelled lessons is
broken. Only cancelled, all other
amends seem to work. Cancelled lesson
is displayed without subject. Pls
fix.
TODO: @hansegucker Timezones
TODO: Beautify the DialogObjectForm:
TODO: PRIO: Only show amend button if chronos.edit_substitution_rule permission.
TODO: PRIO: Either substituted or cancelled in frontend!
TODO: Add cancel (shortcut) button.
TODO: Add remove substitution button.
TODO: Show error messages
permcu: I do not understand which error not shown
MAYBE: Select only teachers instead of all persons (Use same solution in cursus as well!)
FIXME/TODO: Fix default value for autocomplete for subject, teachers & rooms
See
5161437cf9commit msg for more context.Default value is id, as was before, does not semm to work work.
MAYBE: Move substitution component from LessonDetails to own component?
@yuha & @hansegucker do think we could ship the subfrontend? It
is my understanding that there is someone waiting on it.
Imho if PRIO is done we could ship it if needed.
I could do the button (s?) at the end of this week if still
necessary.
Auto-updating after save of amended lesson is now working
The comment field is also bigger now; but is beautifying the DialogObjectForm in order to make its column count configurable really necessary? Please note that in case the device width is rather small (like on mobile phones) the column count is automatically set to 1 and the DIalogObjectForm is expanded to cover the full screen, so it should already be guaranteed that the form is not too cramped.
@permcu We also need an option to delete a substitution.
It is not necessary. My rationale was to visually link the cancelled toggle and the comment textfield since I think they belong together. The two column layout puts them in two different columns.
Also I just happen to like the one column look for this Form:

But MAYBE, as @hansegucker mentioned in the chat, we should not do a one off solution here, but instead think more generally about DialogObjectForm usecases and appearance.
I thought just leaving an empty substitution would be OK in this case. To delete a substitution you just remove the fields in the substitution menu. This does not expose to the user that there is a substitution LessonEvent.
Other solution could be: Use a delete mutation and add a del/rem button if a LessonEvent is amended.
Do you strongly prefer the second option? Or did you have something else in mind?
Not for me. See above.
Regarding a substitution is either substituted or cancelled in frontend!
On @hansegucker initiative I changed the frontend to only allow subject, teachers, rooms substitution if the lesson is not cancelled.
But currently if there was aready a new room it is still passed as default (edit-item) to the amendLessonMutation. This needs the TODO above to be shown to the user.
But more importantly we have to decide how the data model should look like. Or if @hansegucker has already something in mind. Please explain it to me.
Originally I thought substitutions would stack. = for every change you add a new substitution lessonevent. But apparantly there should only ever be one substitution per lesson. This means the first substitution creates the amend event which is thereafter mutated. Is this correct?
This means susbstituted information is lost each time a substitution changes.
Imho it is OK for a cancelled lesson to have a new room the same way it is okay for it to have an old room.
This is correct.
How?
Yeah, well, but if you say: This event is the new status. There is a new room, but the lesson isn't actually happening – that's unnecessarily confusing in my opinion.
Second option is preferred.
First substitute with teacher A, then substitute again with teacher B (maybe A got ill or something)
Now the information that teacher A was the first substitute is lost. It was mutated. But maybe this does not matter much? I would prefer for a substitution to leave a record and not vanish.
The confusion is avoided if cancel overrides. That means a cancelled lesson does not need to highlight that it was amended otherwise. But if the user clicks on the cancelled lesson for more information I think amened info should still be shown. It would be more confusing otherwise. Ie was the original lesson cancelled or the substituted.
@hansegucker cancelling does remove the class from the calendar & removing cancel does not put it back. Also even an empty amend lessonEvent does leave the calendar event orange. I am beginning to understand why you want a delete substitution option. Since only this clears the UI.
.
Should be fixed now – the details are now updated correctly (using https://edugit.org/AlekSIS/official/AlekSIS-Core/-/merge_requests/1318)
Nice :) I already thought I'd have to do it myself;)
created branch
211-implement-vue-substitution-frontend-2to address this issuementioned in commit
210217945funassigned @permcu