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

create modals as needed rather than in advance #1202

Open
huss opened this issue Apr 4, 2024 · 2 comments
Open

create modals as needed rather than in advance #1202

huss opened this issue Apr 4, 2024 · 2 comments
Assignees
Labels
p-medium-priority t-enhancement This issues tracks a potential improvement to the software
Milestone

Comments

@huss
Copy link
Member

huss commented Apr 4, 2024

Is your feature request related to a problem? Please describe.

The modals now present on many admin pages are all created when the page is loaded. For example, all the edit modals for all cards. It would be faster an more efficient to create the modals as needed since most are not used at any given time. While it should not matter, it may help with keeping state up-to-date.

Describe the solution you'd like

Find a mechanism to do this.

Describe alternatives you've considered

Leave as is

Additional context

None

@huss huss added t-enhancement This issues tracks a potential improvement to the software p-medium-priority labels Apr 4, 2024
@huss huss added this to the 1.x milestone Apr 4, 2024
@huss
Copy link
Member Author

huss commented Apr 4, 2024

Another issue with modals is that some take props for show and the close function. Hopefully the changes for this issue could also eliminate those and maybe all props.

@ChrisMart21
Copy link
Contributor

ChrisMart21 commented Jun 11, 2024

The same idea has also occured to me, and I've got some changes to admin pages undergoing tentative development that address this concept.
With the migration to rtk, react-router was also updated to v6. This introduced <Outlets/> which is currently being utilized for the admin pages.
The approach I've begin to look into is using a single modal, who's contents get dynamically swapped depending on the page, etc.
This differs with the current approach that creates a modal for each entity view.

This Admin Outlet has a SharedModal between all admin pages.
The only real difference to the current implementation of the current the admin pages, is that the entity views only return the body contents instead of a full modal. While there are minor changes to the admin pages, the functionality is largely the same, except for the return value which now returns the modal 'body, only. The new approch would still use react-state, but will also be saving backedup local edits to the redux state. So previous code will likely not change much for many of the components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p-medium-priority t-enhancement This issues tracks a potential improvement to the software
Projects
None yet
Development

No branches or pull requests

2 participants