GCTC-NTGC / gc-digital-talent

GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numรฉriques du GC est la nouvelle plateforme de recrutement pour les emplois numรฉriques et technologiques au gouvernement du Canada.
https://talent.canada.ca
GNU Affero General Public License v3.0
22 stars 8 forks source link

๐Ÿ› Submitting inline form on Edit Job page triggers full page refresh #11741

Open tristan-orourke opened 1 week ago

tristan-orourke commented 1 week ago

๐Ÿ› Bug

On the Edit Job page, submitting an inline form causes the whole page to refresh and be hidden under a spinner. This seems to bypass one of the reasons to use inline forms, which is to not disrupt the overall page when editing a section.

๐Ÿฆ‹ Expected Behaviour

After submitting an inline form, that form should show a pending state until its data is submitted and refreshed. The rest of the page should not be affected.

๐Ÿ•ต๏ธ Details

QUESTION: Are there other pages with inline forms where this happens as well?

๐Ÿ“‹ Steps to Reproduce

  1. Create or edit a pool as an admin role
  2. edit a specific section and submit
  3. See the whole page disappear under the spinner, and you end up back at the top of the page when its done.

๐Ÿ“ธ Screenshot

๐Ÿ™‹โ€โ™€๏ธ Proposed Solution

I assume this is because we are loading pool data at the root of the page component (for things like header and breadcrumb information) and this data is invalidated when an inline form updates the pool.

I suspect the solution would be to change when we show the pending component (spinner) in that root component. Instead of doing it whenever a request is pending, we can do it only when we have no data at all.

We'll need to do something similar but different for individual forms. By default, each inline form's data will be invalidated when any pool form submits. Again, we don't have to show the pending state while its refreshing. But we'll need some other way to trigger the pending state for the form which HAS just submitted.

โœ… Acceptance Criteria