Skip to content

Optimize table section reloads after closing an unsaved modal#853

Open
blesildaramirez wants to merge 14 commits into
pkp:mainfrom
blesildaramirez:optimize-table-reloads
Open

Optimize table section reloads after closing an unsaved modal#853
blesildaramirez wants to merge 14 commits into
pkp:mainfrom
blesildaramirez:optimize-table-reloads

Conversation

@blesildaramirez
Copy link
Copy Markdown
Contributor

@blesildaramirez blesildaramirez commented Mar 25, 2026

Details of the changes:

  • In some areas, we directly call triggerDataChange(). Passing an empty param to the triggerDataChange() function will always trigger all the callbacks. Example where we use this is when Uploading Files, where there are multiple ajax legacy modals steps that only pass the dataChanged at the last step. Skipping midway prevents the reload of the files, so we need to always ensure that opening File Uploads always refreshes the list. Adding new Galley also opens the File Uploads in the process, so this one also requires this approach.
  • Some other sections in our app doesn't use triggerDataChange api and manually refetches some list, so manual checks were added: shouldTriggerDataChange(closeData)
  • Removed bunch of wrapper functions when calling triggerDataChange, so all params sent to it will propagate directly to triggerDataChange api.

@blesildaramirez blesildaramirez force-pushed the optimize-table-reloads branch 3 times, most recently from 96bc98e to 4297cc7 Compare March 25, 2026 22:00
Copy link
Copy Markdown
Contributor

@jardakotesovec jardakotesovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets discuss this further on catch up. One of the goals I think was to reload the data before closing the modal, which per my testing is not happening (tried it on the task template manager).
Otherwise conceptually I think its good idea.

Comment thread src/composables/useFetch.js Outdated
// Auto-track data changes for mutations inside modals
if (
['POST', 'PUT', 'DELETE'].includes(options.method) &&
modalStore.dialogLevel > 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be used the modalLevel which is available above?

Might not make difference but dialogLevel was made intentionally to guide dialogs on which levels to show up.

@blesildaramirez blesildaramirez force-pushed the optimize-table-reloads branch from 78e82f8 to 20b9700 Compare April 14, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants