Skip to content

fix confirm close dialog + add restart confirm dialog #12761

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

Merged
merged 2 commits into from
Jun 20, 2025
Merged

Conversation

etiennejouan
Copy link
Contributor

@etiennejouan etiennejouan commented Jun 20, 2025

Test:

  • On upload > No dialog at modal closing
  • On match > Confirm cancel dialog at closing (escape, click outside, cancel cross)
  • On match > Restart dialog at Restart Import
  • On validation > Confirm cancel dialog at closing (escape, click outside, cancel cross)
  • On import > Confirm cancel dialog at closing (escape, click outside, cancel cross)
  • On import > No confirm at import end

closes : twentyhq/core-team-issues#1071

Copy link
Contributor

github-actions bot commented Jun 20, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:63338

This environment will automatically shut down when the PR is closed or after 5 hours.

@etiennejouan etiennejouan marked this pull request as ready for review June 20, 2025 12:41
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Enhanced modal dialog interactions in the spreadsheet import flow with improved UX safeguards and clearer user guidance.

  • Added confirmation dialog for restarting import in MatchColumnsStep, preventing accidental data loss with 'Restart Import' button replacing 'Back'
  • Implemented shouldCloseModalOnClickOutsideOrEscape prop in Modal component to prevent accidental closures
  • Simplified SpreadSheetImportModalCloseButton into a pure presentational component, moving dialog logic to parent
  • Added step-aware confirmation dialogs in SpreadsheetImport component, auto-closing only after import completion
  • Made onClose prop required in SpreadSheetImportModalWrapper with mobile viewport responsiveness

5 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Comment on lines 239 to 242
const handleClose = () => {
onClose?.();
closeModal(modalId);
if (shouldCloseModalOnClickOutsideOrEscape) closeModal(modalId);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: handleClose might execute onClose even when shouldCloseModalOnClickOutsideOrEscape is false, which could be unexpected. Consider moving the onClose call inside the if condition

Copy link
Contributor

@bosiraphael bosiraphael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@etiennejouan etiennejouan merged commit 19fe508 into main Jun 20, 2025
55 of 58 checks passed
@etiennejouan etiennejouan deleted the ej/1071 branch June 20, 2025 13:20
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.

Add two confirmation modals in import
2 participants