Skip to content

ENG-3435: Clean up antd v6 deprecated prop warnings#7936

Merged
gilluminate merged 2 commits intomainfrom
gill/ENG-3435/deprecated-ant-props
Apr 15, 2026
Merged

ENG-3435: Clean up antd v6 deprecated prop warnings#7936
gilluminate merged 2 commits intomainfrom
gill/ENG-3435/deprecated-ant-props

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented Apr 15, 2026

Ticket ENG-3435

Description Of Changes

After the Admin UI migration to Ant Design v6, the browser console was spewing deprecation warnings on page load. This PR is a mechanical cleanup of those warnings so the console is quiet again -- easier to spot real errors in development and less noise in QA.

Scope was agreed with the reporter to be antd-only. The non-antd console warnings called out in the ticket (includeCountryOnlyOptions leaking to DOM, <button> nesting, Form.Item layout-only usage, React 19 element.ref access) need live browser inspection to trace and are deferred to a follow-up ticket.

Most of the work is absorbed by three shared wrappers in fidesui, so call-sites of Drawer, Statistic, and CustomTableHeaderCell didn't all need hand-editing.

Code Changes

Wrappers (clients/fidesui/src/hoc/)

  • CustomDrawer.tsx: forward the deprecated width prop into size (which accepts numeric/string pixel widths in v6).
  • CustomStatistic.tsx: migrate from valueStyle to styles.content, merging user-provided overrides.
  • CustomTableHeaderCell.tsx: use classNames.root instead of overlayClassName on the inner Dropdown.

Prop renames across ~90 admin-ui files

  • Button iconPosition to iconPlacement (29 files)
  • Modal/Drawer destroyOnClose to destroyOnHidden (21 prod + 2 test mocks)
  • Space/Steps direction to orientation
  • Alert message to title
  • AutoComplete popupClassName to classNames.popup.root
  • Dropdown overlayClassName to classNames.root
  • Statistic valueStyle to styles.content at 5 call sites
  • InputNumber/Input addonAfter/addonBefore to suffix/prefix for simple unit/prefix labels

Structural

  • Step interface description field to content (in features/integrations/setup-steps/hooks/types.ts) plus update of all six hooks that populate it.
  • Dropdown.Button rewritten as Space.Compact + Button + Dropdown in features/privacy-requests/SubmitPrivacyRequest.tsx. data-testid="submit-request-btn" preserved on the wrapper.

Steps to Confirm

  1. Pull the branch, cd clients/admin-ui && npm run dev, log in (root_user / Testpassword1!).
  2. Open the browser devtools console.
  3. Navigate through the following surfaces and confirm none of the listed deprecation warnings fire:
    • Dashboard (Statistic, Drawer, Alert via AgentBriefingBanner)
    • Integrations setup flow (<Steps> with items + vertical orientation)
    • Create privacy request (dropdown split button)
    • Datamap report table (Dropdown menus, Group-by / more-options)
    • Privacy requests filter bar (LocationSelect -- still warns about includeCountryOnlyOptions, that's deferred)
    • Nav sidebar & nav search (AutoComplete)
    • Any modal with a form (destroyOnHidden behavior)
    • Test monitors page (InputNumber suffix rendering)
  4. Known non-regressions still firing (out of scope, deferred): [antd: Input] addonBefore, [antd: List] List is deprecated, and the 4 non-antd warnings called out in the ticket.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration label to the entry if your change includes a DB migration
    • Add a high-risk 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 -- non-antd warnings (button-in-button, React 19 element.ref, includeCountryOnlyOptions DOM leak, Form.Item layout-only) deferred to a new ticket.
    • 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

gilluminate and others added 2 commits April 15, 2026 14:11
Mechanical rename of deprecated antd v6 props and a few small structural
changes so the browser console is quiet on page load.

- Wrappers: CustomDrawer width→size, CustomStatistic valueStyle→styles.content,
  CustomTableHeaderCell overlayClassName→classNames.root
- Button iconPosition→iconPlacement
- Modal/Drawer destroyOnClose→destroyOnHidden
- Space/Steps direction→orientation
- Alert message→title
- AutoComplete popupClassName→classNames.popup.root
- Dropdown overlayClassName→classNames.root
- Statistic valueStyle→styles.content at call sites
- InputNumber/Input addonAfter/addonBefore→suffix/prefix for simple labels
- Steps items.description→items.content (Step type + hook implementations)
- Dropdown.Button rewritten as Space.Compact + Button + Dropdown

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

vercel bot commented Apr 15, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Apr 15, 2026 8:18pm
fides-privacy-center Ignored Ignored Apr 15, 2026 8:18pm

Request Review

@github-actions
Copy link
Copy Markdown

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.1% (2663/43634) 5.22% (1293/24740) 4.19% (542/12914)
fides-js Coverage: 78%
78.98% (1962/2484) 65.55% (1214/1852) 72.57% (336/463)
privacy-center Coverage: 88%
85.97% (331/385) 81.36% (179/220) 78.87% (56/71)

@gilluminate gilluminate marked this pull request as ready for review April 15, 2026 20:32
@gilluminate gilluminate requested a review from a team as a code owner April 15, 2026 20:32
@gilluminate gilluminate requested review from jpople and removed request for a team April 15, 2026 20:32
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Review: ENG-3435 — Ant Design v6 deprecated prop cleanup

This is a broad mechanical cleanup across ~100 files. The bulk of the changes (iconPositioniconPlacement, destroyOnClosedestroyOnHidden, valueStylestyles.content, Alert.messageAlert.title, popupClassNameclassNames.popup) are correct, well-scoped migrations. A few specific changes need attention before merging.

Issues

1. addonBefore/addonAfterprefix/suffix — visual regression

These are not equivalent props. addonBefore/addonAfter render a bordered box outside the input (the standard "input group" pattern for unit labels and fixed namespace prefixes). prefix/suffix render content inside the input's padding area, overlapping the text zone.

Affected locations:

  • PrivacyRequestFieldPicker.tsx: addonBefore="privacy_request.identity."prefix — the static namespace now looks like typed text inside the field
  • TestDatastoreMonitor.tsx and TestWebsiteMonitor.tsx (4 instances): addonAfter="%"suffix — the "%" unit label now floats inside the number input

If antd v6 still emits the deprecation warning for these specific usages, the correct fix is Space.Compact + a separate bordered element, not prefix/suffix. See inline comments for details.

2. Space directionorientation — unverified prop name

orientation is not documented as a Space prop in antd v6. The Space component uses direction in both v5 and v6; orientation is a Divider/Steps prop. If this is wrong, ~40 vertical stack layouts will silently revert to horizontal with no TypeScript error (since Space accepts arbitrary extra props that flow to the DOM). Please verify against the antd v6.3.x SpaceProps type before merging.

3. overlayClassNameclassNames.root — Cypress test impact unverified

Several Cypress tests in datamap-report.cy.ts rely on CSS class selectors (.more-menu-list, .group-by-menu-list, .<column>-header-menu-list) that were set via overlayClassName. classNames.root may attach the class to a different DOM node in antd v6's RC-trigger implementation. Please verify these selectors still resolve to the correct overlay element in a browser run.

4. data-testid moved to non-interactive Space.Compact wrapper

In SubmitPrivacyRequest.tsx, data-testid="submit-request-btn" moved from the Dropdown.Button element to the Space.Compact <div> wrapper. Any test clicking [data-testid="submit-request-btn"] directly will now click a non-interactive container. See inline comment.

Positive notes

  • iconPositioniconPlacement across all Button usages: correct and complete.
  • destroyOnClosedestroyOnHidden on Modal: correct, and test mocks updated to match.
  • valueStylestyles.content on Statistic: correct antd v6 migration.
  • Alert messagetitle: correct per antd v6 API.
  • CustomDrawer size/width simplification is cleaner and behaviorally equivalent.
  • The aria-label added to the chevron button in SubmitPrivacyRequest.tsx is a good accessibility improvement.
  • Steps directionorientation: correct for Steps in antd v6.

🔬 Codegraph: connected (46727 nodes)


💡 Write /code-review in a comment to re-run this review.

{showManualKeyInput && (
<Input
addonBefore="privacy_request.identity."
prefix="privacy_request.identity."
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clients/admin-ui/src/features/integrations/configure-tasks/components/PrivacyRequestFieldPicker.tsx:231

addonBefore and prefix are not visually equivalent for Input:

  • addonBefore renders a bordered box attached outside the input (.ant-input-group-wrapper), visually separated by a border. It's clear the static label is structural, not typed text.
  • prefix renders the text inside the input's padding area, overlapping the text zone — it looks like typed content, not a fixed label.

For this use case ("privacy_request.identity." as a read-only namespace prefix), addonBefore is the correct semantic treatment. The regression is subtle but real: users may have difficulty distinguishing the static namespace from their typed value.

If antd v6 still fires a deprecation warning for addonBefore on Input, the correct fix is to replicate the behavior with Space.Compact + a disabled Input span, not to substitute prefix.

step={5}
addonAfter="%"
suffix="%"
className="w-full"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clients/admin-ui/src/features/test-monitors/TestDatastoreMonitor.tsx:187

addonAfter and suffix are visually different for InputNumber:

  • addonAfter="%" places "%" in a separate bordered box to the right of the number field — a standard pattern for unit labels.
  • suffix="%" places "%" as an inline overlay inside the input's right padding — the character floats inside the field and can overlap typed digits at certain widths.

This is a visible regression for percentage inputs. Same concern applies to the three equivalent changes in TestWebsiteMonitor.tsx. If antd v6 fires the deprecation warning for addonAfter on InputNumber, the correct fix is Space.Compact with a separate <span> or Input addon, not suffix.

@@ -43,7 +43,7 @@ const EmptyTableNotice = () => {
return (
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clients/admin-ui/src/features/chat-provider/ChatConfigurations.tsx:43

orientation is not a prop on antd v6's Space component. The Space component uses direction in antd v5 and v6 — orientation is a prop on Divider and Steps, not Space.

If Space does not accept orientation, the layout will silently revert to horizontal (the default), breaking all vertical stacked layouts. This affects ~40 files in this PR.

Please verify against the antd v6.x SpaceProps type definition before merging. If direction is still valid on Space in v6 (with or without a deprecation warning), these changes are incorrect and should be reverted.

],
}}
overlayClassName="group-by-menu-list"
classNames={{ root: "group-by-menu-list" }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clients/admin-ui/src/features/datamap/reporting/DatamapReportTable.tsx:297

overlayClassName applied the class directly to the dropdown popup container div. classNames.root in antd v6 targets the "root" semantic element, which in some RC-trigger-based components is the wrapper element rather than the popup itself.

The Cypress helper getAntDropdownOverlay (and several tests in datamap-report.cy.ts) query .more-menu-list, .group-by-menu-list, and .<columnKey>-header-menu-list by CSS class. If antd v6's classNames.root attaches the class to a different DOM node than overlayClassName did, these selectors will resolve the wrong element and the tests may pass incorrect assertions or fail.

Please verify in a running browser instance that:

  1. cy.get(".more-menu-list") still resolves to the dropdown overlay
  2. cy.get(".group-by-menu-list") still resolves to the dropdown overlay
  3. The header-menu-list pattern in CustomTableHeaderCell.tsx still works for the column header tests

The same applies to the classNames={{ popup: { root: ... } }} change on AutoComplete in NavSearch.tsx.

>
Create request
</Dropdown.Button>
<Space.Compact data-testid="submit-request-btn">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clients/admin-ui/src/features/privacy-requests/SubmitPrivacyRequest.tsx:143

data-testid="submit-request-btn" moved from the Dropdown.Button (a <button> element) to the Space.Compact wrapper (a <div>). This is a non-interactive element.

Any test that does:

cy.get('[data-testid="submit-request-btn"]').click()

will now click the container div rather than the "Create request" primary button, which may not trigger the expected handler. Tests that do .find('button').click() or .find('[type="primary"]') within the testid will still work.

Please verify that no Cypress or unit test relies on clicking [data-testid="submit-request-btn"] directly, or update those tests to use a more specific selector like [aria-label="More privacy request options"] for the chevron and a new testid on the primary button.

Copy link
Copy Markdown
Contributor

@jpople jpople left a comment

Choose a reason for hiding this comment

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

Nice cleanup, thanks!

@gilluminate gilluminate added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 5535519 Apr 15, 2026
53 of 56 checks passed
@gilluminate gilluminate deleted the gill/ENG-3435/deprecated-ant-props branch April 15, 2026 21:47
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