Skip to content

Conversation

@lucanovera
Copy link
Contributor

@lucanovera lucanovera commented Dec 5, 2025

Ticket ENG-2014

Description Of Changes

Adds support for choosing custom fields as manual tasks conditions in the UI. It fetches the privacy center config to extract unique fields and adds them as options in the select.

Code Changes

  • Updated PrivacyRequestFieldPicker.tsx to fetch the privacy center config, extract unique custom fields and add them as options in the picker. This is the same approach that was used in the FilterBar component and reusing the utils.
  • Adds many unit tests for PrivacyRequestFieldPicker

Steps to Confirm

  1. Visit preview link and enable the feature flag "Alpha privacy notices sandbox"
  2. Now go to the conditions settings of a manual task integration like here
  3. Click Add Condition and select "Privacy request field" in field source
  4. Open the Field dropdown and check that custom fields are being shown grouped at the end. First name, Last name, Location, Preferred Format, Select data cate... and Tenant ID should be there.

Note: If you test locally, or the nightly build env resets, you will need to make a PUT request to the /api/v1/plus/privacy-center-config endpoint with the contents of /clients/privacy-center/config/config.json

  1. Check that you can finish adding the condition
  2. Check that the custom field condition is display in the list

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
    • Alpha flag work, 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

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ready Ready Preview Comment Dec 9, 2025 3:25pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Dec 9, 2025 3:25pm

@lucanovera lucanovera changed the title ENG-2014 add support for custom fields as manual task conditions Support custom fields as manual task conditions Dec 5, 2025
Base automatically changed from ENG-2014-FE-Support-Request-Data-as-criteria-for-manual-task-conditions to main December 5, 2025 16:55
@lucanovera lucanovera marked this pull request as ready for review December 5, 2025 19:36
@lucanovera lucanovera requested a review from a team as a code owner December 5, 2025 19:36
@lucanovera lucanovera requested review from speaker-ender and removed request for a team December 5, 2025 19:36
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 5, 2025

Greptile Overview

Greptile Summary

This PR adds support for custom privacy request fields as manual task conditions in the UI.

  • Extended PrivacyRequestFieldPicker to fetch the privacy center config via useGetPrivacyCenterConfigQuery and extract unique custom fields using the existing extractUniqueCustomFields utility
  • Custom fields are transformed into options and displayed as a separate "Custom fields" group at the end of the dropdown
  • Added custom_privacy_request_fields to the CATEGORY_LABELS mapping in utils.ts to support proper display formatting
  • Normalized capitalization from "Privacy Request" to "Privacy request" for consistent sentence-case
  • Added comprehensive unit tests for the PrivacyRequestFieldPicker component covering loading states, error handling, standard fields, and custom fields integration

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk. It extends existing patterns without introducing breaking changes.
  • The implementation follows existing patterns in the codebase (reuses extractUniqueCustomFields from PrivacyRequestFiltersBar), has comprehensive test coverage for the new functionality, and makes only additive changes without modifying existing behavior beyond a minor capitalization normalization.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/integrations/configure-tasks/components/PrivacyRequestFieldPicker.tsx 5/5 Adds custom fields support by fetching privacy center config and transforming custom fields into field options grouped under "Custom fields" category. Clean implementation following existing patterns.
clients/admin-ui/src/features/integrations/configure-tasks/utils.ts 5/5 Minor changes: renamed "Privacy Request" to "Privacy request" for consistent sentence-case capitalization and added "custom_privacy_request_fields" to CATEGORY_LABELS mapping.
clients/admin-ui/src/features/integrations/configure-tasks/tests/utils.test.ts 5/5 Updates test expectations to match the capitalization change from "Privacy Request" to "Privacy request".
clients/admin-ui/src/features/integrations/configure-tasks/components/tests/PrivacyRequestFieldPicker.test.tsx 5/5 New test file with comprehensive unit tests covering loading states, error states, standard fields, and custom fields integration scenarios.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@speaker-ender speaker-ender left a comment

Choose a reason for hiding this comment

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

Minor comments on the test but looks good!

@lucanovera lucanovera enabled auto-merge December 9, 2025 15:26
@lucanovera lucanovera added this pull request to the merge queue Dec 9, 2025
Merged via the queue into main with commit d687cf8 Dec 9, 2025
47 checks passed
@lucanovera lucanovera deleted the ENG-2014-Add-custom-fields branch December 9, 2025 15:43
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.

3 participants