Skip to content

Add CONFIRM dialog guard for Run Migration button in Dev Tools#420

Merged
CasperL1218 merged 2 commits into
mainfrom
dev-tools-safety
Apr 20, 2026
Merged

Add CONFIRM dialog guard for Run Migration button in Dev Tools#420
CasperL1218 merged 2 commits into
mainfrom
dev-tools-safety

Conversation

@CasperL1218
Copy link
Copy Markdown
Contributor

Summary

  • Replaced window.confirm() on the "Run Migration" button with a MUI Dialog that requires the admin to type
    CONFIRM before proceeding
  • Prevents accidental batch-writes to all apartment records in the database
  • No new dependencies or imports needed

Test Plan

  1. Go to Admin → Dev Tools → Schema Migration
  2. Click "Run Migration" — confirm dialog should open
  3. Verify the "Run Migration" button inside the dialog is disabled until CONFIRM is typed exactly
  4. Verify Cancel closes the dialog without running anything
  5. Type CONFIRM → button enables → migration runs as before

Notes

This PR should be merged after PR #418 (phase1-all-merges), which introduced the Dev Tools tab. Base branch is set
to phase1-all-merges for that reason — retarget to main once #418 merges.

Breaking Changes

@dti-github-bot
Copy link
Copy Markdown
Member

dti-github-bot commented Mar 23, 2026

[diff-counting] Significant lines: 0.

Copy link
Copy Markdown

@bryanshao07 bryanshao07 left a comment

Choose a reason for hiding this comment

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

Looks good! Adding the "CONFIRM" button feature is a good safeguarding feature. One small thing might be making the confirmation check case-insensitive with .toUpperCase() for usability, or making it super clear that it must be in all caps. Good overall.

Base automatically changed from phase1-all-merges to main April 10, 2026 21:51
Copy link
Copy Markdown
Collaborator

@Natk21 Natk21 left a comment

Choose a reason for hiding this comment

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

Looks good. Right now it looks like you want the user to explicitly type "CONFIRM" in all caps, which is a fine design choice.

@CasperL1218 CasperL1218 merged commit 9dc472a into main Apr 20, 2026
4 checks passed
@CasperL1218 CasperL1218 deleted the dev-tools-safety branch April 20, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants