Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace browser alert/confirm with generic withConfirm wrapper in Questionary and StepView #806

Merged

Conversation

Junjiequan
Copy link
Contributor

@Junjiequan Junjiequan commented Oct 7, 2024

Description

This PR replaces the browser alert/confirm with a generic withConfirm wrapper in Questionary and StepView components.

Motivation and Context

The change is required to ensure a unified user experience across the application and to replace the default browser alert/confirm components, which are not user-friendly, with a custom-styled confirmation dialog.

Changes

  1. In Questionary.tsx and QuestionaryStepView.tsx, the window.confirm has been replaced with the withConfirm wrapper.
  2. The QuestionarySubmissionState.ts and useEventHandlers.ts files have been updated to handle the new confirm prop passed to the BACK_CLICKED, RESET_CLICKED, and GO_TO_STEP_CLICKED actions.
  3. The Questionary and QuestionaryStepView components are now wrapped with withConfirm at export.

This change ensures that all confirmations within the Questionary and StepView components are handled in a consistent and user-friendly manner.

How Has This Been Tested?

Fixes Jira Issue

https://jira.esss.lu.se/browse/SWAP-3346

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@Junjiequan Junjiequan requested a review from a team as a code owner October 7, 2024 11:55
@Junjiequan Junjiequan requested review from mehta-pooja123 and removed request for a team October 7, 2024 11:55
@Junjiequan Junjiequan force-pushed the SWAP-3346-uo-in-proposal-review-trigger-back-button-shows-u branch from 79ade84 to 2ba2519 Compare October 7, 2024 13:10
@Scott-James-Hurley Scott-James-Hurley requested review from Scott-James-Hurley and removed request for mehta-pooja123 October 9, 2024 19:29
@Junjiequan Junjiequan merged commit 627cf18 into develop Oct 17, 2024
19 checks passed
@Junjiequan Junjiequan deleted the SWAP-3346-uo-in-proposal-review-trigger-back-button-shows-u branch October 17, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants