ENG-3551: Migrate simplified Privacy Declaration form to antd#8227
Merged
Conversation
Renames the datamap-drawer accordion form module to Simplified* to stop shadowing the modal version's filenames and hook name, swaps Formik/Yup for antd Form with per-Form.Item rules, and extracts reusable per-field components into a shared module that ENG-3550 (the modal migration) will consume next. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…plified* Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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. 2 Skipped Deployments
|
- Replace document.querySelector('[data-testid="datamap-drawer"]') with a
shared DATAMAP_DRAWER_WIDTH constant. The drawer width is a known value
(CustomDrawer's 480px default), not something we need to discover by
re-measuring the DOM on every selection.
- Drop the fidesDebugger calls. fidesDebugger is only attached to the
global scope by clients/fides-js, so calling it from admin-ui throws
ReferenceError. The early returns alone are sufficient.
- Read the selected node off reactFlowInstance.getNode() instead of the
local nodes array. Drops `nodes` from the effect deps, which was
re-firing on every selection toggle and pumping the effect more than
necessary.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e2054b5 to
cb8cb7c
Compare
Kelsey-Ethyca
approved these changes
May 18, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cb8cb7c to
750b889
Compare
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-3551
Description Of Changes
Migrates the simplified Privacy Declaration form (the 6-field accordion used inside the data lineage / datamap drawer) from Formik/Chakra/Yup to antd
Form. As part of the same diff:Simplified*to stop shadowing the modal version's filenames and theusePrivacyDeclarationFormhook name (the modal form undersystem-form-declaration-tab/had the exact same filenames and hook name, which made navigation and grep painful).features/system/privacy-declaration-fields/module so ENG-3550 (the modal migration) can consume them next instead of rebuilding each field from scratch.onDeletechain (passed through three components but never invoked in this directory), theshowNewForm/newDeclarationstate machine in the manager (setShowNewForm(true)was never called from anywhere), theisDeleteparameter on the save handler (never passedtrue), and the unusedincludeCustomFieldspath (DatamapDrawernever opts in to custom fields). Net delta: -263 lines.Out of scope for this ticket (will land with ENG-3550):
privacy-declarations/PrivacyDeclarationStep.tsx— actually mounts the modalPrivacyDeclarationFormTab, not the accordion. Stays as-is.privacy-declarations/hooks.ts(usePrivacyDeclarationData) — shared withSystemInformationForm, no rename.FormGuard(unsaved-edits navigation guard) is not re-implemented for antd; the simplified drawer flow can live without it for now. May need a follow-up ticket if/when ENG-3550 needs it for the modal.Code Changes
clients/admin-ui/src/features/system/privacy-declaration-fields/— new shared module:DataUseFormItem,DataCategoriesFormItem,DataSubjectsFormItem,DatasetReferencesFormItem,DeclarationNameFormItem, plusindex.ts. Each is a thinForm.Item+ antdSelect/Inputpairing with field-localrules.DataSubjectsFormItemtakesrequired?: booleanso ENG-3550's modal can opt out of the min-1 rule.clients/admin-ui/src/features/system/privacy-declarations/SimplifiedPrivacyDeclarationForm.tsx— antdFormwithForm.useForm<FormValues>(), no Formik, no Yup. Preserves thetransformFormValueToDeclaration/transformPrivacyDeclarationToFormValueshelpers. OptionalrenderHeadercallback +onSavedChangecallback so the accordion wrapper can render its own "Saved" indicator in theCollapseitem'sextraslot.clients/admin-ui/src/features/system/privacy-declarations/SimplifiedPrivacyDeclarationAccordion.tsx— antdCollapsewith theitemsconfig replacing ChakraAccordion+AccordionItem. Per-itemsavedstate via asavedByIdmap drives theextraindicator.clients/admin-ui/src/features/system/privacy-declarations/SimplifiedPrivacyDeclarationManager.tsx—Flex/Typography.Textin place ofChakraStack/ChakraText. Save callback simplified to a singlehandleEditDeclarationafter removing the dead "new declaration" path.clients/admin-ui/src/features/datamap/datamap-drawer/DatamapDrawer.tsx— import updated toSimplifiedPrivacyDeclarationManager.privacy-declarations/PrivacyDeclarationForm.tsx,PrivacyDeclarationAccordion.tsx,PrivacyDeclarationManager.tsx.Steps to Confirm
cd clients/admin-ui && npm run dev(or use the existing dev server)./datamapand click any system node — the right-side drawer should open.Collapse(no Chakra-styled accordion)."<DataUse name> - <declaration name>", or just the data use name if no declaration name.Data use,Processing Activity,Data categories,Data subjectsfields, all disabled (matching legacy read-only behavior in this surface).npm run checkfromclients/admin-ui— eslint, antd lint, prettier, and tsc all clean.Pre-Merge Checklist
CHANGELOG.mdupdated (viachangelog/8227-simplified-privacy-declaration-form-antd.yaml)FormGuardif the modal flow needs it)maindowngrade()migration is correct and works