Fixes issue where users see warning modal even after saving changes
Closes [insert issue #]
Solution
updating/saving/syncing state logic seems quite convoluted on the FE
However, frontend is indeed updating editor content after the POST request returns (see useUpdatePageHook in EditPageLayout)
issue is that /update endpoints are not returning the updated frontmatter and pageContent to the client
This seems like the simplest solution to fixing this bug, i.e returning updated pageContent to the client,
but would be good to refactor/simplify the FE logic next time
Breaking Changes
[ ] Yes - this PR contains breaking changes
Details ...
[x] No - this PR is backwards compatible with ALL of the following feature flags in this doc
Features:
Details ...
Improvements:
Details ...
Bug Fixes:
Details ...
Before & After Screenshots
BEFORE:
AFTER:
Tests
Go to Prod CMS, edit a page to leave trailing whitespace then save changes
Click Back on the navbar -> should see the unsaved changes modal
Go to Staging CMS, edit a page to leave trailing whitespace then save changes
After saving, should see that trailing whitespace is removed from the editor (to match backend)
Click Back on the navbar -> should not see the modal
Deploy Notes
New environment variables:
env var : env var details
[ ] added env var to 1PW + SSM script (fetch_ssm_parameters.sh)
Problem
https://opengovproducts.slack.com/archives/CK68JNFHR/p1709007514442959?thread_ts=1708332491.637599&cid=CK68JNFHR
Fixes issue where users see warning modal even after saving changes
Closes [insert issue #]
Solution
useUpdatePageHook
inEditPageLayout
)/update
endpoints are not returning the updatedfrontmatter
andpageContent
to the clientThis seems like the simplest solution to fixing this bug, i.e returning updated
pageContent
to the client, but would be good to refactor/simplify the FE logic next timeBreaking Changes
Features:
Improvements:
Bug Fixes:
Before & After Screenshots
BEFORE:
AFTER:
Tests
Deploy Notes
New environment variables:
env var
: env var detailsfetch_ssm_parameters.sh
)New scripts:
script
: script detailsNew dependencies:
dependency
: dependency detailsNew dev dependencies:
dependency
: dependency details