Add CustomAlert HOC with primary/secondary CTA support#7539
Add CustomAlert HOC with primary/secondary CTA support#7539
Conversation
Wraps Ant Design Alert with `primaryAction` and `secondaryAction` props that render type-aware CTA buttons below the alert content. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Greptile SummaryAdded a Key changes:
Note: The PR description mentions a Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 6983488 |
speaker-ender
left a comment
There was a problem hiding this comment.
Only reviewed and left feedback on storybook related changes
| export interface AlertAction { | ||
| label: React.ReactNode; | ||
| onClick: () => void; | ||
| } |
There was a problem hiding this comment.
It seems like there might be a situation where we would want to, e.g., disable one of the actions, or configure them more in some other way-- would it be reasonable to use a type based on ButtonProps here?
Ticket
Description Of Changes
Adds a
CustomAlertHOC to fidesui that wraps Ant Design'sAlertcomponent with support forprimaryActionandsecondaryActionprops. When provided, these render styled CTA buttons below the alert's message/description content. Button colors are derived from the alert'stypeviaConfigProvider, so warning alerts get orange buttons, error alerts get red, etc.The Ant Design
actionprop (top-right slot) is preserved and passes through unchanged. All existingAlertusages across the codebase are fully backwards-compatible since the new props are optional.Code Changes
clients/fidesui/src/hoc/CustomAlert.tsx- New HOC wrappingAlertwithprimaryAction/secondaryActionprops and type-aware button colors viaConfigProviderclients/fidesui/src/hoc/CustomAlert.module.scss- Flexbox layout for the action button containerclients/fidesui/src/hoc/CustomAlert.stories.tsx- Storybook story with a briefing-style alert example and type selectorclients/fidesui/src/hoc/index.tsx- Added barrel exportclients/fidesui/src/index.ts- MovedAlertfrom direct antd re-export to HOC layer; addedAlertPropsandAlertActiontype exportsSteps to Confirm
turbo run storybookfromclientsand checkCustom/AlertsVerify existing
Alertusages (e.g. inDatasetEditorSection,ConsentBreakdownModal) are visually unchangedPre-Merge Checklist
CHANGELOG.mdupdated