-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) Show discard changes confirmation modal when fields get touched
This PR tweaks the logic for showing the discard changes confirmation modal in the patient registration form. Previously, the modal was being shown in cases where the user had not made any changes. Now, the modal will only be shown when the user has made changes and attempts to navigate away from the form. This is done by checking whether any of the form fields have been [touched](https://formik.org/docs/api/formik#touched--field-string-boolean-). This aligns with the expected behavior of the form and provides a better user experience. Also, this PR refactors the `DeleteIdentifierConfirmationModal` to leverage Carbon's ModalHeader, ModalBody, and ModalFooter components. It also refactors its registration in the `routes.json` file so it leverages the `modal` property of the route definition. This aligns with our best practices for registering modals.
- Loading branch information
1 parent
17dc81b
commit 1efe5e2
Showing
10 changed files
with
57 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 22 additions & 15 deletions
37
packages/esm-patient-registration-app/src/widgets/delete-identifier-confirmation.modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
packages/esm-patient-registration-app/src/widgets/delete-identifier-confirmation.scss
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters