Block page navigation when uploading custom UI assets in sign-in experience page. In order to achieve this, the following refactoring are needed:
Refactor FileUploader component to emit event when upload starts
Add a new SignInExperienceContextProvider to wrap up SIE pages, so that when file upload happens in the children element, the outer parent component PageContent can be notified and render the navigation blocker confirm dialog.
Refactor useApi hook to support abort signal, so that an ongoing request can be aborted on demand.
Refactor CustomUiAssetsUploader to support upload abortion. When the user decides to navigate to another page, or simply click "Discard" button, the ongoing upload will be aborted.
Summary
Block page navigation when uploading custom UI assets in sign-in experience page. In order to achieve this, the following refactoring are needed:
FileUploader
component to emit event when upload startsSignInExperienceContextProvider
to wrap up SIE pages, so that when file upload happens in the children element, the outer parent componentPageContent
can be notified and render the navigation blocker confirm dialog.useApi
hook to supportabort signal
, so that an ongoing request can be aborted on demand.CustomUiAssetsUploader
to support upload abortion. When the user decides to navigate to another page, or simply click "Discard" button, the ongoing upload will be aborted.Testing
Locally tested
Checklist
- [ ].changeset
- [ ] unit tests- [ ] integration tests- [ ] necessary TSDoc comments