Skip to content

ENG-3158: Purpose Management UI#8014

Draft
kruulik wants to merge 9 commits intomainfrom
3158-purpose-management
Draft

ENG-3158: Purpose Management UI#8014
kruulik wants to merge 9 commits intomainfrom
3158-purpose-management

Conversation

@kruulik
Copy link
Copy Markdown
Contributor

@kruulik kruulik commented Apr 23, 2026

Ticket ENG-3158

Description Of Changes

Adds a new Purpose Management UI at /data-purposes, gated behind the existing
alphaPurposeBasedAccessControl flag (dev-only by default; same flag already
gating the nav entry). The list page groups purposes by data use and supports a
card grid or network-diagram view; the detail page surfaces data consumers,
assigned datasets, and a governance-insight agent alert.

CRUD is wired to the existing fidesplus /api/v1/data-purpose[/{fides_key}]
endpoints. Per-purpose enrichment (summaries, systems, datasets, category
actions) is served by MSW handlers under src/mocks/data-purposes/ — these
/api/v1/plus/data-purpose/... endpoints do not exist in fidesplus yet
(verified against main). Run with npm run dev:mock to exercise the full
flow end-to-end. When the flag is off, both pages render a disabled-state
shell and do not fire any queries.

No new form fields are introduced; every input on the create modal and config
form maps 1:1 to existing DataPurposeResponse fields.

Code Changes

  • New feature dir src/features/data-purposes/ with PurposeCardGrid,
    PurposeNetworkView, PurposeDetail, PurposeDashboard, PurposeConfigForm,
    NewPurposeModal, AssignedSystemsSection, AssignedDatasetsSection,
    AssignSystemsPickerModal, AddDatasetsModal, PurposeGovernanceAlert.
  • New pages: pages/data-purposes/index.tsx and pages/data-purposes/[fidesKey].tsx,
    both gated by flags.alphaPurposeBasedAccessControl.
  • data-purpose.slice.ts injects CRUD + 12 plus-gap endpoints; getPurposeSummaries
    provides list-level + per-id tags so scoped mutation invalidations refresh
    the card grid counts.
  • MSW handlers at src/mocks/data-purposes/ with in-memory stores that persist
    for the session; available-* endpoints exclude already-assigned items.
  • Add/assign modals are add-only (rename + deselection bug fix); window.open
    replaced with router.push; at-risk/dataset-count gating derived from data
    rather than hardcoded system names.
  • Added changelog fragment changelog/8014-purpose-management-ui.yaml.

Steps to Confirm

  1. cd clients/admin-ui && npm run dev:mock
  2. Visit /settings/about/alpha, enable Alpha purpose-based access control.
  3. Navigate to /data-purposes — verify card grid, search, filters (status,
    consumer, category, data use), and the grid/network toggle.
  4. Click + New purpose — create a purpose; verify it appears in the grid.
  5. Click Download RoPA — verify CSV opens cleanly in Excel (UTF-8, CRLF).
  6. Open a purpose — verify the detail page loads with Overview + Configuration tabs.
  7. On Overview, use + Add data consumers and + Add datasets; confirm
    picker modals show only unassigned items and that list-page counts refresh
    after close.
  8. Trigger the governance insight alert by opening a purpose with detected
    categories not in its defined list; verify the "agent" alert renders and
    "Approve categories" merges them.
  9. Turn the flag back off — /data-purposes and /data-purposes/{key} should
    render a "not enabled" shell and fire no queries (check Network tab).

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 (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 (plus endpoints for per-purpose enrichment must land before flag graduates from alpha)
    • No followup issues
  • Database migrations:
    • No migrations
  • Documentation:
    • No documentation updates required

kruulik and others added 9 commits April 21, 2026 20:13
Cherry-picks the final state of the data-purposes feature and page
directories from the inventory_and_purposes branch onto a fresh branch
cut from main. Excludes unrelated work from that branch
(system-inventory v2, data-consumers, access-control-v2, etc.).

Pages are still mock-backed via features/data-purposes/mockData.ts;
wiring to real backend endpoints will follow in a separate PR.

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

vercel Bot commented Apr 23, 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 23, 2026 2:11am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Apr 23, 2026 2:11am

Request Review

@github-actions
Copy link
Copy Markdown

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.23% (2798/44865) 5.49% (1402/25526) 4.35% (579/13287)
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)

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.

1 participant