Open jardakotesovec opened 1 month ago
@ewhanson May I ask you for code review on this one?
Its one of these annoying PRs, where I migrated probably more than 20 modals. I did test each of them individually. Hopefully fixed more bugs than introduced along the way. There were some mistakes from the vue3 migration.
So apart from just scanning through if you can spot something silly - could you specifically tests Doi functionality that you are very familiar with? The trivial modals which just show some error feedback I migrated to use openDialog, and the more complex one to openSideModal.
I also added more documentation for Dialog and SideModal to document better the Dialog Props and purpose.
I am still waiting for OPS/OMP tests to pass - they still might need couple of cypress tests tweaks.. but OJS are passing now, so I think its good time to get into it.
Thanks!
Thanks @jardakotesovec. There's a lot of really good stuff here! 👍 Only a few minor comments and questions. Otherwise, looks good!
Describe the issue When migrated to vue3 - simple declarative way to control modals was used - example . These cases can be easily found by searching for
<modal>
tag. Since than we moved to centrally controlled modals, as it allowed to consolidate old and new modals to appear the same, allows to combine legacy and new ones and have correct behaviour when closing etc.Another reason to use centrally controlled modals is to compensate for headless-ui limitation, which currently requires to define modals in nested fashion to work correctly. Which does not work very well for cases when the modal needs to be opened sometime on first level but sometime also on top another modal. Typical use case is to display modal with network error, when the communication with API fails.
Solution Migrate existing
<modal>
declaration to use ofopenModal
fromuseModal
composable. This would require to define modals as separate components. If that would make the transition too cumbersome, as alternative its possible to create<ModalInline>
component, that would still let the component define inline, but it still would be controlled via openModal using the modal name.What application are you using? OJS, OMP or OPS version main
PRs: ojs: https://github.com/pkp/ojs/pull/4339 omp: https://github.com/pkp/omp/pull/1608 ops: https://github.com/pkp/ops/pull/717 ui-library: https://github.com/pkp/ui-library/pull/366 pkp-lib: https://github.com/pkp/pkp-lib/pull/10124