ENG-3178: Migrate vendor / configure-consent forms to antd#8156
Merged
Conversation
Replaces Formik + Chakra in the configure-consent vendor flow with antd Form: AddVendor uses Form.useForm with an async name-uniqueness rule; DataUsesForm replaces FieldArray with Form.List and ControlledSelect with Form.Item + antd Select; cross-row consent_use → data_use filtering goes through Form.useWatch on the absolute path. A new VendorSelectorAnt.tsx sits next to the legacy Formik VendorSelector so AddNewSystemModal and SystemInformationForm (still Formik-bound) are untouched. The fork preserves the implicit name + vendor_id field contract and uses always-mounted hidden Form.Items so Form.useWatch stays reactive across the typeahead → text-input mode flip. Also adds the cookieNames → cookies payload transform that the backend expects (this was a pre-existing bug — dictionary-sourced cookies now keep their domain/path; user-typed names default to path: "/") and un-skips and re-targets cypress/e2e/consent-configuration.cy.ts against the new DOM (8/8 passing). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Kelsey-Ethyca
approved these changes
May 12, 2026
Vagoasdf
pushed a commit
that referenced
this pull request
May 13, 2026
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3178
Description Of Changes
Replaces Formik + Chakra in the configure-consent "Add a vendor" modal with antd
Form. The migration coversAddVendor.tsxandDataUsesForm.tsx, plus a forkedVendorSelectorAnt.tsxplaced next to the legacyfeatures/system/VendorSelector.tsx— that legacy component is intentionally left in place becauseAddNewSystemModalandSystemInformationFormstill consume it on Formik. A follow-up ticket will retire it when those two callers migrate.Two behavior fixes ride along with the migration:
cookieNames→cookiespayload transform inhandleSubmit. The backend expects each privacy declaration to shipcookies: [{ name, path, domain? }], not the UI'scookieNames: string[]. This was a pre-existing bug (the Cypress spec for this flow wasdescribe.skip-ed onmainand failing). Dictionary-sourced cookies keep their domain/path; user-typed names default to{ name, path: "/" }.Form.Items fornameandvendor_idinVendorSelectorAnt. Without them,Form.useWatchloses reactivity when the typeahead Select flips to the text-input branch (because the registeredForm.Itemfornameunmounts, andvendor_idwas never registered at all — so the dictionary auto-populate query never fires).cypress/e2e/consent-configuration.cy.tsis un-skipped and re-targeted at the new DOM (8/8 passing), so the dictionary-off path is fully covered by CI — the manual steps below only walk the dictionary-on path that matches a standard local dev setup.Code Changes
clients/admin-ui/src/features/configure-consent/AddVendor.tsx—Formik→ antdForm(useForm,onFinish, async name-uniqueness rule, dirty/valid viaForm.useWatch+validateFields({ validateOnly: true })).ChakraVStack/ChakraBox/useChakraDisclosure→Flex+useState. Cancel + Save moved into Modalfooterprop. AddedcookieNames→cookiespayload transform.clients/admin-ui/src/features/configure-consent/DataUsesForm.tsx—FieldArray→Form.List,ControlledSelect→Form.Item+ antdSelect,useFormikContext→Form.useFormInstance+Form.useWatch. Each data-use block is now wrapped in an antdCard(theme-token border). Dictionary auto-populate carriescookies+cookieNamesonto each declaration.clients/admin-ui/src/features/configure-consent/constants.ts— addedcookieNames?: string[]andcookies?: MinimalCookie[]toMinimalPrivacyDeclaration; new localMinimalCookietype.clients/admin-ui/src/features/system/VendorSelectorAnt.tsx— new antd-Form-native fork ofVendorSelector.tsx. Same external prop signature (label,isCreate,lockedForGVL,options,isLoading,onVendorSelected) plus optionalnameRules. Always-mounted hiddenForm.Items forname+vendor_idkeepForm.useWatchreactive across the typeahead → text-input UI flip.clients/admin-ui/src/features/system/VendorSelector.tsx— unchanged. Still consumed byAddNewSystemModal.tsxandSystemInformationForm.tsx(both still Formik).clients/admin-ui/cypress/e2e/consent-configuration.cy.ts— un-skippeddescribe("adding a vendor", …); swapped legacy selectors (selectOption,controlled-select-…,input-privacy_declarations.N.…) for antd equivalents (antSelecthelper,select-consent-use-N/select-data-use-N/select-cookies-N,vendor-name-select); cookie typing throughfind("input").type("…{enter}").Steps to Confirm
/consent/configure/add-vendorsand click Add custom vendor.POST /api/v1/systemrequest body: eachprivacy_declarationsentry should have acookies: [{ name, path: "/" }]array (notcookieNames).POSTbody'sprivacy_declarationsshould contain two entries instead of one: one withdata_use: "marketing.advertising.first_party.targeted"and one withdata_use: "marketing.advertising.third_party.targeted".Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and worksFollow-ups not in this PR (file as separate tickets):
AddNewSystemModal.tsxandSystemInformationForm.tsxoff Formik, then retire the legacyfeatures/system/VendorSelector.tsx.CustomTextInputwrapper (15+ consumers) withForm.Item+ antdInput.