Skip to content

Conversation

@jpople
Copy link
Contributor

@jpople jpople commented Dec 11, 2025

Ticket ENG-2177

Description Of Changes

Fixes a bug where repeatedly clicking on the "delete" button in the confirmation modal on deleting a custom field would create separate delete requests, resulting in a bunch of error toasts after the redirect.

Code Changes

  • Switches old ConfirmationModal to use new Ant hook-based confirmation modal
  • Also changes the redirect on deletion to be immediate instead of waiting for success toast to expire (no longer necessary with the new message hook's global messageContext)

Steps to Confirm

  1. Create and save a custom field
  2. Open it in the edit view
  3. Click "delete", then in the confirmation modal, rapidly click "delete"
  4. Modal should close immediately on first click
  5. Should see a success toast and be redirected to the main custom fields page

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@jpople jpople requested a review from a team as a code owner December 11, 2025 23:33
@jpople jpople requested review from gilluminate and removed request for a team December 11, 2025 23:33
@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Dec 11, 2025 11:59pm
fides-privacy-center Ignored Ignored Dec 11, 2025 11:59pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 11, 2025

Greptile Overview

Greptile Summary

Fixes a bug where repeatedly clicking "Delete" in the confirmation modal would trigger multiple delete requests, resulting in error toasts after the first successful deletion.

Key changes:

  • Replaced the Chakra-based ConfirmationModal with Ant Design's useAntModal hook, which automatically closes on the first click and prevents multiple triggers
  • Changed navigation to occur immediately after success message instead of waiting for toast expiration, leveraging the global messageContext
  • Removed useState for modal open state since the hook manages this internally

The approach follows existing patterns in the codebase (e.g., useFieldActions.tsx, useBulkActions.tsx).

Confidence Score: 4/5

  • Safe to merge after addressing the minor missing punctuation issue
  • The change is well-scoped and follows established patterns in the codebase. One minor text issue found (missing question mark). The core bug fix using useAntModal is correctly implemented.
  • No files require special attention - the punctuation fix is straightforward

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/custom-fields/CustomFieldForm.tsx 4/5 Switches from ConfirmationModal to Ant Design's useAntModal hook to fix repeat-click bug. Minor issue: missing question mark in confirmation dialog text.

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.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

title: "Delete custom field?",
content: (
<Typography.Paragraph>
Are you sure you want to delete <strong>{initialField?.name}</strong>{" "}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing the ?

Suggested change
Are you sure you want to delete <strong>{initialField?.name}</strong>{" "}
Are you sure you want to delete <strong>{initialField?.name}</strong>?{" "}

@jpople jpople enabled auto-merge December 11, 2025 23:41
@jpople jpople added this pull request to the merge queue Dec 12, 2025
Merged via the queue into main with commit fe551fd Dec 12, 2025
47 checks passed
@jpople jpople deleted the jpople/eng-2177/repeat-click-delete-custom-field branch December 12, 2025 00:21
@greptile-apps greptile-apps bot mentioned this pull request Dec 12, 2025
18 tasks
@jpople jpople mentioned this pull request Dec 17, 2025
18 tasks
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.

3 participants