Skip to content
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

Closed
jardakotesovec opened this issue May 29, 2024 · 3 comments
Closed

Migrate declarative use of Modal to openModal #9992

jardakotesovec opened this issue May 29, 2024 · 3 comments
Assignees
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day. UI/UX Issues affecting the user interface/user experience
Milestone

Comments

@jardakotesovec
Copy link
Contributor

jardakotesovec commented May 29, 2024

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 of openModal from useModal 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

@jardakotesovec jardakotesovec added Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day. UI/UX Issues affecting the user interface/user experience labels May 29, 2024
@jardakotesovec jardakotesovec added this to the 3.5 Internal milestone May 29, 2024
@jardakotesovec jardakotesovec self-assigned this May 29, 2024
jardakotesovec added a commit to jardakotesovec/pkp-lib that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/pkp-lib that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
…ure that the form errors are propagated to the modal for other ListPanels
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/pkp-lib that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/pkp-lib that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 20, 2024
…some other modals for more consistent naming
jardakotesovec added a commit to jardakotesovec/pkp-lib that referenced this issue Jun 20, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 24, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 24, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 24, 2024
jardakotesovec added a commit to jardakotesovec/ojs that referenced this issue Jun 24, 2024
jardakotesovec added a commit to jardakotesovec/ojs that referenced this issue Jun 24, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ojs that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ojs that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ojs that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/omp that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/pkp-lib that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ojs that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/omp that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ops that referenced this issue Jun 25, 2024
@jardakotesovec
Copy link
Contributor Author

jardakotesovec commented Jun 25, 2024

@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!

jardakotesovec added a commit to jardakotesovec/pkp-lib that referenced this issue Jun 25, 2024
jardakotesovec added a commit to jardakotesovec/ops that referenced this issue Jun 25, 2024
@ewhanson
Copy link
Collaborator

Thanks @jardakotesovec. There's a lot of really good stuff here! 👍 Only a few minor comments and questions. Otherwise, looks good!

jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jul 2, 2024
jardakotesovec added a commit to pkp/ui-library that referenced this issue Jul 2, 2024
* 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
jardakotesovec added a commit that referenced this issue Jul 2, 2024
* #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
jardakotesovec added a commit to pkp/ojs that referenced this issue Jul 2, 2024
* 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
jardakotesovec added a commit to pkp/omp that referenced this issue Jul 2, 2024
* 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
@jardakotesovec
Copy link
Contributor Author

@ewhanson Thank you for the review.. issues addressed and its merged now. Two issues related to linting I will look into separately.

jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jul 2, 2024
jardakotesovec added a commit to jardakotesovec/ui-library that referenced this issue Jul 2, 2024
jardakotesovec added a commit to pkp/ui-library that referenced this issue Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day. UI/UX Issues affecting the user interface/user experience
Projects
None yet
Development

No branches or pull requests

2 participants