Skip to content

ENG-3509: Fix custom field labels missing from privacy request payload#7970

Merged
gilluminate merged 5 commits intomainfrom
gill/ENG-3509/custom-field-labels-missing
Apr 20, 2026
Merged

ENG-3509: Fix custom field labels missing from privacy request payload#7970
gilluminate merged 5 commits intomainfrom
gill/ENG-3509/custom-field-labels-missing

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented Apr 20, 2026

Ticket ENG-3509

Description Of Changes

The Ant Design form migration (ENG-3172) had two issues with the privacy request submission form:

  1. Missing custom field labels -- Only .value had a bound Form.Item, so Ant Design's form store didn't include .label in the submitted data. The backend CustomPrivacyRequestField schema requires both label and value, resulting in a 422.

  2. Missing required field indicators and validation -- A filter bug in generateFormRulesFromAction excluded plain text custom fields from rule generation. The filter "field_type" in fieldInfo && fieldInfo.field_type !== "location" only passed fields with an explicit field_type, silently dropping fields like required_field and hidden_field that have no field_type. This meant required asterisks were missing and validation didn't fire.

Code Changes

  • Added hidden Form.Item for each custom field's label property in CustomFields component
  • Fixed the custom field filter in generateFormRulesFromAction to include fields without field_type
  • Added required prop on custom field Form.Item to restore asterisks for hidden+required fields
  • Added SelectCustomPrivacyRequestField type and render select-type custom fields as <Select> dropdowns
  • Added validation rules for required location fields and passed them to LocationSelectField
  • Added data-testid to CopyPrivacyRequestLinkForm email input
  • Added unit tests for generateFormRulesFromAction and findActionFromPolicyKey (15 tests)
  • Added Cypress assertion for department select field rendering
  • Added Cypress request body assertions for label/value in submission payload

Steps to Confirm

  1. Open Admin UI > Privacy Requests
  2. Click "Create request"
  3. Select "Access your data" request type
  4. Verify required asterisks appear on "Required example field" and "Hidden example field"
  5. Try submitting without filling "Required example field" -- should be blocked by validation
  6. Verify "Department" renders as a select dropdown with options
  7. Fill in required fields, check the confirmation checkbox, and submit
  8. Inspect network request to /api/v1/privacy-request/authenticated -- verify each custom field entry includes both label and value

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
    • 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 2 commits April 20, 2026 14:17
Add hidden Form.Item for label property so Ant Design's form store
includes it in submission. The Ant migration dropped labels because
only .value had a bound Form.Item. Also add Cypress assertions on the
request body to catch this regression.

Fixes ENG-3509

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

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

Request Review

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.35% (2797/44023) 5.58% (1398/25015) 4.44% (579/13026)
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)

@gilluminate gilluminate marked this pull request as ready for review April 20, 2026 20:36
@gilluminate gilluminate requested a review from a team as a code owner April 20, 2026 20:36
@gilluminate gilluminate requested review from lucanovera and removed request for a team April 20, 2026 20:36
Copy link
Copy Markdown
Contributor

@jpople jpople left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, confirmed custom fields submit properly.

…ustom fields

The Formik-to-Ant migration carried forward a filter bug that excluded
plain text custom fields from validation rule generation. The filter
`"field_type" in fieldInfo && fieldInfo.field_type !== "location"` only
passed fields with an explicit field_type, silently dropping fields like
required_field and hidden_field. Fixes the filter, adds proper type for
select fields, renders select-type custom fields as dropdowns, adds
location field validation rules, and adds unit tests for the helpers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gilluminate gilluminate enabled auto-merge April 20, 2026 22:17
@gilluminate gilluminate added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit ba81c66 Apr 20, 2026
51 checks passed
@gilluminate gilluminate deleted the gill/ENG-3509/custom-field-labels-missing branch April 20, 2026 22:30
gilluminate added a commit that referenced this pull request Apr 20, 2026
#7970)

Co-authored-by: Claude Opus 4.6 (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.

2 participants