Skip to content

ENG-3386: system-template badge + sectioned popover for standard reports#7910

Draft
adamsachs wants to merge 2 commits intoENG-3386-custom-field-system-managedfrom
ENG-3386-fe-system-template-badge
Draft

ENG-3386: system-template badge + sectioned popover for standard reports#7910
adamsachs wants to merge 2 commits intoENG-3386-custom-field-system-managedfrom
ENG-3386-fe-system-template-badge

Conversation

@adamsachs
Copy link
Copy Markdown
Contributor

@adamsachs adamsachs commented Apr 14, 2026

Ticket ENG-3386

Dependency chain. This PR is the top of a three-PR stack. Merge order:

  1. fides#7999 — OSS schema (adds system_template_key + location_code on CustomReport, system_managed on CustomFieldDefinition, and the association table). Must merge first.
  2. fidesplus#3407 — location-gated reconciler, schema exposure of system_template_key / system_managed, and 403 guards on the write paths.
  3. This PR — surfaces both flags in the admin UI.

This PR's base branch is set to ENG-3386-custom-field-system-managed so the diff only shows FE changes. GitHub will auto-retarget to main after fides#7999 merges.

Description Of Changes

Admin UI surface for the regulatory reporting templates backend. Two surfaces are updated:

Custom reports popover — when the backend materialises a system-owned ICO/DPC/CNIL datamap report (driven by the tenant's selected fides locations — UK → ICO, Ireland → DPC, France → CNIL), this PR surfaces them:

  • Sectioned layout: "Standard templates" appear above "Your reports", each with a label header. When only user reports exist the layout is unchanged.
  • "Standard" tag: system-owned reports display an info-coloured Tag with a tooltip explaining they're out-of-the-box and cannot be deleted.
  • Delete suppression: the trash-can button is hidden for system-template rows. (Backend also returns 403 as defense in depth.)

Custom-fields management UI — the gap CustomFieldDefinitions seeded by the reconciler (e.g. Controller's Representative, DPA 2018 Schedule 1 Condition) carry system_managed=true and are distinguished in the admin UI so they can't be accidentally edited or disabled:

  • Lock icon (Carbon Locked, size 14, muted gray) rendered inline after the field name in the table, with a tooltip: "This field is built into Fides to support a reporting template. It's added and removed automatically based on your Fides location settings."
  • Enabled toggle disabled for managed rows — deactivating a template-backing field would break the template silently.
  • Edit button hidden in the Actions cell for managed rows.
  • Edit form (navigable via the name link for read access) shows an info Alert at the top ("Managed by Fides"), disables every control via antd Form.disabled, and hides Save + Delete entirely.

Code Changes

  • clients/admin-ui/src/types/api/models/CustomReportResponseMinimal.ts / CustomReportResponse.ts — adds system_template_key?: string | null (hand-edited pending type regeneration)
  • clients/admin-ui/src/types/api/models/CustomFieldDefinition*.ts (×3) — adds system_managed?: boolean
  • clients/admin-ui/src/features/common/custom-reports/CustomReportTemplates.tsx — sections + "Standard" tag + delete suppression
  • clients/admin-ui/src/features/custom-fields/useCustomFieldsTable.tsx — lock icon next to managed row names, disabled toggle, hidden Edit button
  • clients/admin-ui/src/features/custom-fields/CustomFieldForm.tsx — Alert + full-form disable + hidden Save/Delete for managed rows
  • clients/admin-ui/cypress/e2e/datamap-report.cy.ts — two new popover tests
  • clients/admin-ui/cypress/e2e/custom-fields.cy.ts — new System-managed custom fields describe block: lock presence, Edit suppression, edit-form guard
  • clients/admin-ui/cypress/fixtures/custom-reports/minimal-with-system-template.json — new fixture
  • clients/admin-ui/cypress/fixtures/custom-fields/list-with-system-field.json + detail-system-managed.json — new fixtures

Steps to Confirm

  1. With fides#7999 + fidesplus#3407 running and the UK location selected, confirm the datamap Reports popover shows "Standard templates" and "Your reports" sections; ICO appears in the Standard section with a blue "Standard" tag and no trash icon.
  2. Deselect UK on the Locations page, confirm ICO disappears (reconciliation runs as a background task on the PATCH).
  3. Visit /settings/custom-fields; confirm the Fides-seeded gap fields (e.g. Controller's Representative) show a lock icon next to the name, the Enabled toggle is disabled, and no Edit button appears.
  4. Click the name of a managed row — the edit form loads, shows the "Managed by Fides" alert, all controls are disabled, and Save/Delete are absent.
  5. Run Cypress:
    npx cypress run --spec cypress/e2e/datamap-report.cy.ts --spec cypress/e2e/custom-fields.cy.ts
    Expected: all tests pass, including the new popover + custom-fields cases.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Updates unreleased work already in Changelog, no new entry necessary (changelog on fidesplus side)
  • UX feedback:
    • All UX related changes have been reviewed by a designer
  • Followup issues:
    • Followup issues created — type regeneration after fides#7999 + fidesplus#3407 merge
    • No other followups
  • Database migrations:
    • No migrations (schema lives in fides#7999)
  • Documentation:
    • No documentation updates required (covered in fidesplus#3407)

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 14, 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 22, 2026 6:47pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Apr 22, 2026 6:47pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 14, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.34% (2799/44129) 5.59% (1402/25069) 4.43% (579/13055)
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)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.98%. Comparing base (1e20083) to head (a79f5b2).

Additional details and impacted files
@@                          Coverage Diff                          @@
##           ENG-3386-custom-field-system-managed    #7910   +/-   ##
=====================================================================
  Coverage                                 84.98%   84.98%           
=====================================================================
  Files                                       631      631           
  Lines                                     41245    41245           
  Branches                                   4787     4787           
=====================================================================
  Hits                                      35050    35050           
  Misses                                     5110     5110           
  Partials                                   1085     1085           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adamsachs adamsachs force-pushed the ENG-3386-custom-field-system-managed branch from 1e20083 to 3f4eb00 Compare April 22, 2026 17:29
@adamsachs adamsachs force-pushed the ENG-3386-fe-system-template-badge branch 2 times, most recently from 1982008 to 7f14089 Compare April 22, 2026 17:32
@adamsachs adamsachs force-pushed the ENG-3386-custom-field-system-managed branch from 3f4eb00 to 26aaefc Compare April 22, 2026 17:52
Splits the datamap custom-reports popover into 'Standard templates'
and 'Your reports' sections when ICO/DPC/CNIL (or any future
system-seeded) templates are present, with a 'Standard' tag and a
suppressed delete affordance on system-owned rows. Falls back to the
prior flat layout when only user reports exist.

Extends the generated CustomReportResponseMinimal/CustomReportResponse
types with the new optional system_template_key field surfaced by
fidesplus. Hand-edited here pending a scheduled type regeneration
after the fidesplus PR merges.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Surfaces the new system_managed flag on CustomFieldDefinition (fides#7999)
so admins can tell apart fields created by the regulatory reporting
templates reconciler from their own fields, and prevents accidental
edits / deactivation.

Custom fields table
- Renders a "System" Tag + Tooltip next to the name for system_managed
  rows, matching the "Standard" tag pattern on the reports popover.
- Disables the Enabled toggle via isDisabled for system_managed rows —
  deactivating a template-backing field breaks the template silently.
- Hides the Edit button for system_managed rows (navigation to the
  detail page via the name link still works for read access).

Custom field form
- Shows an info Alert at the top of the form explaining the field is
  template-managed and cannot be edited here.
- Disables the whole Form via its `disabled` prop (antd cascades to
  every control).
- Hides Save and Delete buttons entirely.

The FE contract (`system_managed` optional boolean) is hand-edited into
the three generated TS types pending a full regeneration after the OSS
schema PR (fides#7999) lands.

Tests
- New Cypress describe block `System-managed custom fields` with three
  cases: tag presence, Edit-button suppression, form alert + disabled
  controls. Fixtures added for a list containing one system row and
  the corresponding detail response.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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