Skip to content

ENG-3551: Migrate simplified Privacy Declaration form to antd#8227

Merged
gilluminate merged 5 commits into
mainfrom
gill/ENG-3551/simplified-pd-form-antd
May 18, 2026
Merged

ENG-3551: Migrate simplified Privacy Declaration form to antd#8227
gilluminate merged 5 commits into
mainfrom
gill/ENG-3551/simplified-pd-form-antd

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented May 18, 2026

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:

  • Renames the whole module to Simplified* to stop shadowing the modal version's filenames and the usePrivacyDeclarationForm hook name (the modal form under system-form-declaration-tab/ had the exact same filenames and hook name, which made navigation and grep painful).
  • Extracts shared per-field components into a new features/system/privacy-declaration-fields/ module so ENG-3550 (the modal migration) can consume them next instead of rebuilding each field from scratch.
  • Removes dead code that came along for the ride: the legacy onDelete chain (passed through three components but never invoked in this directory), the showNewForm/newDeclaration state machine in the manager (setShowNewForm(true) was never called from anywhere), the isDelete parameter on the save handler (never passed true), and the unused includeCustomFields path (DatamapDrawer never 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 modal PrivacyDeclarationFormTab, not the accordion. Stays as-is.
  • privacy-declarations/hooks.ts (usePrivacyDeclarationData) — shared with SystemInformationForm, no rename.
  • The Formik-based 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, plus index.ts. Each is a thin Form.Item + antd Select/Input pairing with field-local rules. DataSubjectsFormItem takes required?: boolean so ENG-3550's modal can opt out of the min-1 rule.
  • clients/admin-ui/src/features/system/privacy-declarations/SimplifiedPrivacyDeclarationForm.tsx — antd Form with Form.useForm<FormValues>(), no Formik, no Yup. Preserves the transformFormValueToDeclaration / transformPrivacyDeclarationToFormValues helpers. Optional renderHeader callback + onSavedChange callback so the accordion wrapper can render its own "Saved" indicator in the Collapse item's extra slot.
  • clients/admin-ui/src/features/system/privacy-declarations/SimplifiedPrivacyDeclarationAccordion.tsx — antd Collapse with the items config replacing Chakra Accordion + AccordionItem. Per-item saved state via a savedById map drives the extra indicator.
  • clients/admin-ui/src/features/system/privacy-declarations/SimplifiedPrivacyDeclarationManager.tsxFlex/Typography.Text in place of ChakraStack/ChakraText. Save callback simplified to a single handleEditDeclaration after removing the dead "new declaration" path.
  • clients/admin-ui/src/features/datamap/datamap-drawer/DatamapDrawer.tsx — import updated to SimplifiedPrivacyDeclarationManager.
  • Deletes: privacy-declarations/PrivacyDeclarationForm.tsx, PrivacyDeclarationAccordion.tsx, PrivacyDeclarationManager.tsx.

Steps to Confirm

  1. cd clients/admin-ui && npm run dev (or use the existing dev server).
  2. Navigate to /datamap and click any system node — the right-side drawer should open.
  3. Scroll to the "Data uses" section. Confirm:
    • Declarations render as an antd Collapse (no Chakra-styled accordion).
    • Each item's header is "<DataUse name> - <declaration name>", or just the data use name if no declaration name.
    • Expanding an item reveals the form with Data use, Processing Activity, Data categories, Data subjects fields, all disabled (matching legacy read-only behavior in this surface).
    • Each field's existing value is populated correctly from the system data.
    • Tooltip info icons render next to each field label.
  4. Press Enter in any (enabled) field on a system that has editable declarations — the save toast fires and the "Saved" indicator appears in the right side of the panel header.
  5. Switch to a different system node — the previously-selected drawer state resets and the new system's declarations load.
  6. Run npm run check from clients/admin-ui — eslint, antd lint, prettier, and tsc all clean.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated (via changelog/8227-simplified-privacy-declaration-form-antd.yaml)
    • 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 (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 (functional parity migration, no new visual design)
  • Followup issues:
    • Followup issues created (ENG-3550 will consume the shared field components; a separate ticket may be needed for an antd-aware FormGuard if the modal flow needs it)
    • 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 3 commits May 18, 2026 15:31
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>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 18, 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 Preview May 18, 2026 10:28pm
fides-privacy-center Ignored Ignored May 18, 2026 10:28pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 9%
6.94% (3174/45715) 6.34% (1680/26461) 4.8% (650/13534)
fides-js Coverage: 78%
79.17% (1977/2497) 66.25% (1249/1885) 73.31% (349/476)
privacy-center Coverage: 85%
82.53% (364/441) 79.74% (189/237) 74.07% (60/81)

@gilluminate gilluminate marked this pull request as ready for review May 18, 2026 22:10
@gilluminate gilluminate requested a review from a team as a code owner May 18, 2026 22:10
@gilluminate gilluminate requested review from Kelsey-Ethyca and jpople and removed request for a team and jpople May 18, 2026 22:10
- 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>
@gilluminate gilluminate force-pushed the gill/ENG-3551/simplified-pd-form-antd branch from e2054b5 to cb8cb7c Compare May 18, 2026 22:18
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gilluminate gilluminate force-pushed the gill/ENG-3551/simplified-pd-form-antd branch from cb8cb7c to 750b889 Compare May 18, 2026 22:28
@gilluminate gilluminate enabled auto-merge May 18, 2026 22:28
@gilluminate gilluminate added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit 9e5c435 May 18, 2026
50 of 51 checks passed
@gilluminate gilluminate deleted the gill/ENG-3551/simplified-pd-form-antd branch May 18, 2026 22: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