Skip to content

ENG-177: Migrate rich toasts to useNotification#7702

Merged
gilluminate merged 5 commits intomainfrom
gill/ENG-177/notification-migration
Mar 20, 2026
Merged

ENG-177: Migrate rich toasts to useNotification#7702
gilluminate merged 5 commits intomainfrom
gill/ENG-177/notification-migration

Conversation

@gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Mar 19, 2026

Ticket ENG-177

Description Of Changes

Migrates all "rich" toast calls (those with action links like View, Navigate) from Chakra useToast to Ant Design useNotification, and simple success/error feedback to useMessage. This is 3 of 4 in the ENG-177 toast migration series.

Code Changes

  • Rewrote useDSRErrorAlert to use useNotification with persistent duration: 0 and key-based cleanup
  • Migrated RegulationManagement and LocationManagement success toasts with "View" action links to useNotification
  • Migrated useSystemFormTabs success toast with "View data map" / "Add privacy declarations" actions to useNotification
  • Migrated action center files (useDiscoveredSystemAggregateTable, useDiscoveredAssetsTable, DiscoveredAssetActionsCell, DiscoveredSystemAggregateActionsCell) to useNotification for action-link toasts and useMessage for simple toasts
  • Deleted unused SuccessToastContent.tsx helper
  • Fixed deprecated btn -> actions prop across all notification calls (including pre-existing AssessmentTaskStatusIndicator)
  • Inlined useAPIHelper for 3 conflict-resolved files (ConnectorParameters, DSRCustomizationModal, ManualProcessingList)
  • Added shouldShowNotification Cypress helper to ant-support.ts

Steps to Confirm

  1. Save a system and verify the notification appears with "View data map" and "Add privacy declarations" action links
  2. Save regulation/location settings and verify notification appears with view link
  3. In action center, add/ignore an asset or system and verify notification shows with "View" link
  4. Verify simple success/error toasts still appear as message banners (e.g. bulk assign system, bulk ignore)
  5. Check browser console for absence of btn deprecation warnings

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:
    • No migrations
  • Documentation:
    • No documentation updates required

🤖 Generated with Claude Code

…useMessage

Replace Chakra useToast with Ant Design useNotification for toasts with
action links (View, navigate) and useMessage for simple success/error
feedback. Delete unused SuccessToastContent helper. Fix deprecated `btn`
prop to `actions` across all notification calls. Inline useAPIHelper
logic for conflict-resolved files. Add shouldShowNotification Cypress helper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gilluminate gilluminate requested a review from a team as a code owner March 19, 2026 16:44
@gilluminate gilluminate requested review from lucanovera and removed request for a team March 19, 2026 16:44
@vercel
Copy link
Contributor

vercel bot commented Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Mar 19, 2026 8:17pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Mar 19, 2026 8:17pm

Request Review

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gilluminate gilluminate marked this pull request as draft March 19, 2026 16:45
@gilluminate gilluminate removed the request for review from lucanovera March 19, 2026 16:45
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 19, 2026

Greptile Summary

This PR is the third installment of the ENG-177 toast migration series, replacing Chakra UI's useChakraToast with Ant Design's useNotification (for rich toasts with action links) and useMessage (for simple success/error banners) across the system form, location/regulation management, action center, DSR error alert, and assessment status indicator.

Key changes:

  • useDSRErrorAlert: Switches to useNotification with duration: 0 and a string key for persistent, key-targeted cleanup on unmount. A variable name collision between the API query result and the new hook is resolved by renaming the former to notificationData.
  • useSystemFormTabs: ToastMessage component is replaced with NotificationActions using Ant Design Space instead of a Box/div wrapper; notification.destroy() on action clicks matches the prior toast.closeAll() semantics.
  • Location/Regulation management: Success toasts with "View" links now use notification.success; error feedback uses message.error. notification.destroy() replaces toast.closeAll() for route-change cleanup.
  • Action center files: The shared SuccessToastContent helper is deleted and replaced with inline ToastLink nodes inside notification.success calls. Simple feedback (restore, bulk assign/ignore) correctly uses message.success.
  • AssessmentTaskStatusIndicator: Fixes the pre-existing deprecated btnactions prop across both notification call sites.
  • Cypress: shouldShowNotification helper mirrors the existing shouldShowMessage pattern and correctly targets .ant-notification-notice-{type} selectors.

Confidence Score: 5/5

  • This PR is safe to merge — it is a well-scoped UI notification migration with no backend changes and no logic regressions.
  • All migrations are mechanically consistent: action-link toasts use useNotification, simple feedback uses useMessage, and the deprecated btn prop is fixed. Key-based cleanup in useDSRErrorAlert is correct. No new div elements are introduced. Dependency arrays are updated throughout. The deleted SuccessToastContent helper has no remaining consumers.
  • No files require special attention.

Important Files Changed

Filename Overview
clients/admin-ui/src/features/system/hooks/useSystemFormTabs.tsx Migrated from useChakraToast to useNotification; renamed ToastMessage to NotificationActions and replaced Box wrapper with Ant Design Space. notification.destroy() (all) is called on action link clicks matching the prior toast.closeAll() semantics.
clients/admin-ui/src/features/locations/LocationManagement.tsx Clean migration from useChakraToast to useNotification for success and useMessage for errors. notification.destroy() replaces toast.closeAll() in the navigation callback.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/hooks/useDiscoveredAssetsTable.tsx Replaced SuccessToastContent + useChakraToast with useNotification for action-link toasts and useMessage for simple success/error feedback. Both hooks added to the relevant useCallback dependency arrays.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/tables/cells/DiscoveredAssetActionsCell.tsx Migrated handleAdd and handleIgnore to notification.success with ToastLink actions; handleRestore uses message.success correctly since it has no action link. Clean removal of SuccessToastContent.
clients/admin-ui/src/features/privacy-assessments/AssessmentTaskStatusIndicator.tsx Fixed two pre-existing uses of the deprecated btn prop to the correct actions prop. No functional changes beyond this fix.
clients/admin-ui/cypress/support/ant-support.ts Added shouldShowNotification Cypress command with type declaration. Correctly targets .ant-notification-notice-{type} selector with a 10-second timeout; mirrors the existing shouldShowMessage pattern.
clients/admin-ui/src/features/privacy-requests/hooks/useDSRErrorAlert.tsx Migrated from Chakra toast to useNotification with duration 0 and key-based cleanup. Renamed the query result variable to notificationData to avoid shadowing the new notification hook reference.

Last reviewed commit: "Use Space component ..."

gilluminate and others added 2 commits March 19, 2026 11:32
…files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests were looking for [data-testid='toast-success-msg'] which was
rendered by the old Chakra toast wrapper. Action center tests now use
shouldShowNotification for toasts with action links and shouldShowMessage
for simple success feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor

@kruulik kruulik 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!

@gilluminate gilluminate added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 5fc4848 Mar 20, 2026
46 checks passed
@gilluminate gilluminate deleted the gill/ENG-177/notification-migration branch March 20, 2026 15:18
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.

2 participants