Skip to content

Conversation

lucanovera
Copy link
Contributor

@lucanovera lucanovera commented Aug 7, 2025

Description Of Changes

Adds UI for setting up conditions for Manual Task feature. Adds a new dataset reference picker component.

Code Changes

  • Adds new "Condition" feature to manual task integration
  • Adds new "Conditions" tab based on feature with same name
  • Adds list based UI for conditions tab
  • Adds new Dataset Reference picker as a combo Select + TreeSelect
  • Adds form to edit/add conditions

Steps to Confirm

  1. Login to admin-ui
  2. Visit a manual task integration
  3. Visit the new "Conditions" tab
  4. Check there is a message displayed when no conditions are setup
  5. Click Add condition
  6. Use dataset reference picker to reference any dataset field
  7. Check that if "Exists" or "Not exists" operator is chosen, the "Value" field is disabled
  8. Try adding/editing a few different conditions and dataset references
    Equals/Not Equals/Exists/Not Exists operators should be valid for any dataset reference. But other operators can throw an validation error by the backend if the data type for the reference doesn't support that operator.
  9. Check you can delete the last condition too

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
  • 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

Copy link

vercel bot commented Aug 7, 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 Aug 27, 2025 8:59pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Aug 27, 2025 8:59pm

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.

Greptile Summary

This PR introduces a comprehensive UI for configuring manual task creation conditions in the Fides admin interface. The feature allows users to define conditional logic that determines when manual tasks should be automatically created during privacy request processing, rather than creating them for every request.

The implementation adds several new React components that work together to provide a complete condition management system. Users can now specify field paths, comparison operators (equals, not equals, less than, greater than, exists checks, list operations), and values to create complex conditional rules. The system supports nested condition groups with AND/OR logical operators, enabling sophisticated task automation workflows.

The feature is protected behind the alphaManualTaskConditions feature flag, allowing for controlled rollout in development and test environments while keeping it disabled in production. The architecture follows modern React patterns with RTK Query for API state management, proper TypeScript typing throughout, and optimistic updates with rollback functionality for responsive user experience.

Key components include:

  • TaskCreationConditions: Main container for condition management with CRUD operations
  • AddEditConditionModal and AddConditionForm: UI for creating/editing individual conditions
  • ConditionsList: Table view for displaying existing conditions
  • TaskAssignedUsersSection: Extracted user assignment functionality (refactored from existing code)

The changes also update the ManualTaskResponse TypeScript type to properly handle the dependency_conditions field as an array of ConditionGroup objects, and add a new API endpoint for persisting condition configurations to the backend.

PR Description Notes:

  • The PR description template is incomplete with placeholder text that should be filled in
  • Missing actual issue reference, description of changes, code changes list, and confirmation steps

Important Files Changed

Click to expand file changes
Filename Score Overview
clients/admin-ui/src/flags.json 5/5 Adds feature flag for controlled rollout of manual task conditions UI
clients/admin-ui/src/types/api/models/ManualTaskResponse.ts 5/5 Updates type definition to properly handle dependency_conditions as ConditionGroup array
clients/admin-ui/src/features/datastore-connections/connection-manual-tasks.slice.ts 5/5 Adds API mutation for updating dependency conditions with proper cache invalidation
clients/admin-ui/src/features/integrations/configure-tasks/TaskCreationConditions.tsx 4/5 Main component for condition management with optimistic updates and duplicate validation
clients/admin-ui/src/features/integrations/configure-tasks/TaskConfigTab.tsx 4/5 Refactors existing component to integrate new condition UI and extract user assignment logic
clients/admin-ui/src/features/integrations/configure-tasks/AddConditionForm.tsx 4/5 Form component for creating/editing conditions with proper validation and type parsing
clients/admin-ui/src/features/integrations/configure-tasks/AddEditConditionModal.tsx 4/5 Modal wrapper for condition form with minor error handling concern
clients/admin-ui/src/features/integrations/configure-tasks/ConditionsList.tsx 4/5 Table component for displaying conditions with edit/delete actions
clients/admin-ui/src/features/integrations/configure-tasks/TaskAssignedUsersSection.tsx 4/5 Extracted user assignment component with some type safety concerns using 'any' types

Confidence score: 4/5

  • This PR introduces new functionality with proper feature flagging and follows established patterns, making it relatively safe to merge
  • Score reflects well-structured code with good TypeScript typing and error handling, though some components have minor type safety concerns
  • Pay close attention to the error handling in AddEditConditionModal.tsx and the 'any' type usage in TaskAssignedUsersSection.tsx

9 files reviewed, 6 comments

Edit Code Review Bot Settings | Greptile

const users = usersData?.items ?? [];
return users
.filter(
(u: any) => u.email_address && !selectedUsers.includes(u.email_address),
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider replacing any type with proper user interface type for better type safety

? {
fieldAddress: editingCondition.field_address,
operator: editingCondition.operator,
value: editingCondition.value?.toString() || "",
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Converting condition value to string unconditionally could lose type information. Consider preserving the original type when editing.

Copy link

codecov bot commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.67%. Comparing base (c9c36c9) to head (ae31f68).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6431      +/-   ##
==========================================
+ Coverage   87.56%   87.67%   +0.11%     
==========================================
  Files         481      481              
  Lines       30791    30792       +1     
  Branches     3462     3462              
==========================================
+ Hits        26962    26998      +36     
+ Misses       3075     3051      -24     
+ Partials      754      743      -11     

☔ 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.

@lucanovera lucanovera changed the title Draft: UI for adding manual task creation conditions UI for adding manual task creation conditions Aug 27, 2025
@lucanovera
Copy link
Contributor Author

@greptileai re-review

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.

Looks good!

@lucanovera lucanovera merged commit c3e68f3 into main Aug 27, 2025
23 of 24 checks passed
@lucanovera lucanovera deleted the ENG-971-FE-Add-condition-check-UI-for-task-config branch August 27, 2025 20:59
Copy link

cypress bot commented Aug 27, 2025

fides    Run #13273

Run Properties:  status check failed Failed #13273  •  git commit c3e68f3a0e: UI for adding manual task creation conditions (#6431)
Project fides
Branch Review main
Run status status check failed Failed #13273
Run duration 01m 05s
Commit git commit c3e68f3a0e: UI for adding manual task creation conditions (#6431)
Committer Lucano Vera
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

Tests for review

Failed  cypress/e2e/smoke_test.cy.ts • 1 failed test

View Output Video

Test Artifacts
Smoke test > can submit an access request from the Privacy Center Screenshots Video

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