Skip to content

ENG-3176: Migrate consent settings forms to Ant Design#7967

Merged
jpople merged 8 commits intomainfrom
jpople/eng-3176/consent-settings-form-migration
Apr 21, 2026
Merged

ENG-3176: Migrate consent settings forms to Ant Design#7967
jpople merged 8 commits intomainfrom
jpople/eng-3176/consent-settings-form-migration

Conversation

@jpople
Copy link
Copy Markdown
Contributor

@jpople jpople commented Apr 20, 2026

Ticket ENG-3176

Description Of Changes

Migrates the consent settings page (/settings/consent) and all components under features/consent-settings/ from Chakra UI + Formik to Ant Design v6 + antd Form. Part of the broader form migration initiative (parent ticket ENG-3165).

Code Changes

  • Replace <Formik> with antd Form using Form.useForm, Form.useWatch, and onFinish across 6 form components
  • Replace Formik hooks (useFormikContext, useField, FieldArray) with Form.useFormInstance() and Form.useWatch in child components
  • Replace Formik-wrapped components (ControlledRadioGroup, CustomSwitch, CheckboxField, ControlledSelect, CustomTextInput) with Form.Item + native antd controls
  • Convert Yup validation to antd rules with custom validators
  • Replace Chakra layout/display components (Box, Stack, Text, Skeleton, Collapse, Divider) with antd equivalents (Card, Flex, Skeleton.Input, Divider) or plain HTML
  • Replace useChakraDisclosure with useState
  • Update Cypress e2e selectors for DOM changes

Steps to Confirm

  1. Navigate to Settings → Consent and verify the page renders without errors
  2. Verify GPP radio buttons work (National, State-by-State, Both) and MSPA section appears/disappears
  3. Verify MSPA conditional disable logic: uncheck "covered transactions" → switches reset and disable; toggle one mode → other mode disables
  4. Verify Publisher country dropdown populates and saves
  5. Verify Save button is disabled when form is clean, enabled when dirty, and submits correctly
  6. If TCF + publisher restrictions flag enabled: verify TCF config creation, dropdown selection, and purpose restriction editing
  7. If legacy overrides present: verify vendor overrides table with switches

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 20, 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 Apr 21, 2026 4:03pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Apr 21, 2026 4:03pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.34% (2797/44075) 5.58% (1398/25031) 4.44% (579/13039)
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)

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

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

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

Overall looking good. Just some UI details to flesh out.

{!isTcfConfigurationsLoading && tcfConfigurations?.items?.length ? (
<>
<Text>
<p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should probably use the Ant paragraph for all of these to get correct design system styling

Suggested change
<p>
<Typography.Paragraph>

? "Non-flexible purposes only support Purpose restrictions and cannot be restricted by consent or legitimate interest settings."
: undefined
}
<Flex vertical className="gap-6">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ant's Form.Item has it's own margins, so this gap makes it extra big.

Suggested change
<Flex vertical className="gap-6">
<Flex vertical>

: undefined
}
<Flex vertical className="gap-6">
<Typography.Text className="text-sm">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've been removing text-sm from these and just leaving them as default size

vendors are restricted or allowed, and specify which vendor IDs the
restriction applies to.
</Typography.Text>
<Tooltip
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

having this wrap the entire field is causing a weird double tooltip on the (i) icon. I would either only wrap the Select with this, or make the Form.Item tooltip conditional with this tooltip instead.

</Form.Item>
)}
<Flex justify="flex-end" className="gap-3 pt-4">
<Button onClick={onClose} data-testid="cancel-restriction-button">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will bypass the dirty-state warning

Suggested change
<Button onClick={onClose} data-testid="cancel-restriction-button">
<Button onClick={handleClose} data-testid="cancel-restriction-button">

@@ -1,17 +1,10 @@
/* eslint-disable react/no-array-index-key */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like this got cleaned up and isn't needed now

Copy link
Copy Markdown
Contributor

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

@jpople jpople added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 3a9e750 Apr 21, 2026
50 of 51 checks passed
@jpople jpople deleted the jpople/eng-3176/consent-settings-form-migration branch April 21, 2026 16:34
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