-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate declarative use of Modal to openModal #9992
Comments
…ure that the form errors are propagated to the modal for other ListPanels
…some other modals for more consistent naming
…tor Dialog to expose the props for docs
…d to openSideModal
@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! |
* pkp/pkp-lib#9992 Migrate Announcements to SideModal * pkp/pkp-lib#9992 clean up announcements moved to SideModal * pkp/pkp-lib#9992 Composer modals migrated to SideModal * pkp/pkp-lib#9992 FileAttacher modal clean up * pkp/pkp-lib#9992 Migrate issue stats modal to SideModal * pkp/pkp-lib#9992 publication stats migrated to side modal * pkp/pkp-lib#9992 users stats export modal migrated to side modal * pkp/pkp-lib#9992 wizard modal migrated to side modal * pkp/pkp-lib#9992 FieldPreparedContent migrated to side modal * pkp/pkp-lib#9992 InstitutionsListPanel migrated to side modal, make sure that the form errors are propagated to the modal for other ListPanels * pkp/pkp-lib#9992 Migrate SubmissionFilesEditModal to openSideModal * pkp/pkp-lib#9992 HighlightsListPanel migrated to side modal * pkp/pkp-lib#9992 Migrate ContributorsListPanel to side panel, rename some other modals for more consistent naming * pkp/pkp-lib#9992 Migrate CatalogListPanel to side modal * pkp/pkp-lib#9992 Migrate doi list panel to side modal * pkp/pkp-lib#9992 migrate workflow page to side modal * pkp/pkp-lib#9992 migrate manageEmails to side modal * pkp/pkp-lib#9992 Migrate error doi message modals to useDialog * pkp/pkp-lib#9992 clean up modals in stories, copied over the tpl files * pkp/pkp-lib#9992 move title directly to modal component when its not dynamic * pkp/pkp-lib#9992 Update documentation for SideModal and Dialog, refactor Dialog to expose the props for docs * pkp/pkp-lib#9992 Clean up * pkp/pkp-lib#9992 Fix SideModal stories template * pkp/pkp-lib#9992 Address code review feedback
* #9992 Migration to side modal for context stats * #9992 Migration to side modal for publication stats * #9992 users stats export modal migrated to side modal * #9992 wizard modal migrated to side modal * #9992 Migrate ContributorsListPanel to side panel, migrated translations * #9992 migrate manageEmails to side modal * #9992 adjust cypress tests for side modal * #9992 Adjust cypress tests for side modal migration
* pkp/pkp-lib#9992 Migrate issue stats modal to side modal * pkp/pkp-lib#9992 Migrate workflow page modal to side modal * pkp/pkp-lib#9992 Update locale keys * pkp/pkp-lib#9992 adjust cypress tests for side modal
* pkp/pkp-lib#9992 Remove legacy modal from workflow.tpl as its migrated to openSideModal * pkp/pkp-lib#9992 Cypress tests update for side modal
@ewhanson Thank you for the review.. issues addressed and its merged now. Two issues related to linting I will look into separately. |
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: pkp/ojs#4339
omp: pkp/omp#1608
ops: pkp/ops#717
ui-library: pkp/ui-library#366
pkp-lib: #10124
The text was updated successfully, but these errors were encountered: