Reduce duplicate code for modals#1046
Conversation
Introduces a generic modal component and replaces existing modal code with the new component. This intention here is to reduce code duplication and to make future generic changes to modals (i.e. focus trapping) easier.
|
This pull request is deployed at test.admin-interface.opencast.org/1046/2025-01-23_15-56-31/ . |
|
Use Run test server using develop.opencast.org as backend: Specify a different backend like stable.opencast.org: It may take a few seconds for the interface to spin up. |
|
This pull request has conflicts ☹ |
The introduction of the new modal component broke the confirmation modal that appeared when you had unsaved changes in your events or series details access policy tab. Should now be restored.
Adds a confirmation modal that warns about unsaved changes to the following tabs of the event details: Metadata, Extended Metadata, Scheduling (for scheduled events), Workflows (for scheduled events). Thereby this fixes opencast#982. Includes opencast#1046, because I was expecting this to be tightly related to modals and did not want to write it twice. The general coding approach would be the same though. Speaking of approach, I would like feedback on if this makes for a good approach, or if there are better alternatives I've missed. If people agree with this approach it could then be extended to other modals (e.g. series) as well.
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
|
I found a bug. You can skip the stepper by clicking on the steps, at least for the events: modal-bug.webm |
|
I can reproduce the bug you showcased on the |
geichelberger
left a comment
There was a problem hiding this comment.
LGTM, I clicked through a lot of modals, and they were all working as expected or broken like before :)
Introduces a generic modal component and replaces existing modal code with the new component. This intention here is to reduce code duplication and to make future generic changes to modals (i.e. focus trapping) easier.
How to test this
No special dependencies or configuration necessary, can be tested as is. Just click through every modal (i.e. "Event Details") you can find and check if it still properly opens and closes, and still looks like expected.