You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1312 results in some regressions which we've decided to handle as separate issues. This is one of those.
React contexts (such as asset-admin and possibly campaign-admin) used to have a "You have unsaved changes" confirm dialog which would be triggered if you tried to navigate away without saving your changes. This was part of react-router, but that functionality is not included with react-router 6.x - so we need to implement it another way.
Acceptance criteria
When a user has unsaved changes and tries to navigate in a react context, a confirm dialog is presented asking if they way to navigate away or not
If the user selects "no" or "cancel" they do not navigate away and can save their changes
If the user selects "yes" or "ok" they are navigated away and lose their changes
Notes
react-router uses history under the hood. We may be able to utilise its blocking transitions functionality. It looks like despite saying they use this under the hood, they don't actually use this.
react-beforeunload is another possible way to implement this This might be useful in addition to any solution we come up with, but it doesn't actually handle routing within the app, only out of it.
There is a lot of discussion about this along with other potential solutions in this issue thread which is where the above options came from
Seems like they've added support for this in 6.7 which wasn't available when I did the original upgrade. Lets go with that.
Yes we can technically downgrade to the previous version, however while that version is still maintained for now it doesn't get the same attention as v6. It's better for us to keep the upgrade if we can.
#1312 results in some regressions which we've decided to handle as separate issues. This is one of those.
React contexts (such as asset-admin and possibly campaign-admin) used to have a "You have unsaved changes" confirm dialog which would be triggered if you tried to navigate away without saving your changes. This was part of react-router, but that functionality is not included with react-router 6.x - so we need to implement it another way.
Acceptance criteria
Notes
react-router uses history under the hood. We may be able to utilise its blocking transitions functionality.It looks like despite saying they use this under the hood, they don't actually use this.react-beforeunload is another possible way to implement thisThis might be useful in addition to any solution we come up with, but it doesn't actually handle routing within the app, only out of it.PRs
The text was updated successfully, but these errors were encountered: