-
Notifications
You must be signed in to change notification settings - Fork 85
UI for adding manual task creation conditions #6431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI for adding manual task creation conditions #6431
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this 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 operationsAddEditConditionModal
andAddConditionForm
: UI for creating/editing individual conditionsConditionsList
: Table view for displaying existing conditionsTaskAssignedUsersSection
: 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 inTaskAssignedUsersSection.tsx
9 files reviewed, 6 comments
clients/admin-ui/src/features/integrations/configure-tasks/ConditionsList.tsx
Outdated
Show resolved
Hide resolved
const users = usersData?.items ?? []; | ||
return users | ||
.filter( | ||
(u: any) => u.email_address && !selectedUsers.includes(u.email_address), |
There was a problem hiding this comment.
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
clients/admin-ui/src/features/integrations/configure-tasks/TaskAssignedUsersSection.tsx
Outdated
Show resolved
Hide resolved
? { | ||
fieldAddress: editingCondition.field_address, | ||
operator: editingCondition.operator, | ||
value: editingCondition.value?.toString() || "", |
There was a problem hiding this comment.
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.
clients/admin-ui/src/features/integrations/configure-tasks/TaskCreationConditions.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/integrations/configure-tasks/AddEditConditionModal.tsx
Outdated
Show resolved
Hide resolved
…ndition-check-UI-for-task-config
…ndition-check-UI-for-task-config
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
…ndition-check-UI-for-task-config
@greptileai re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
…ndition-check-UI-for-task-config
fides
|
Project |
fides
|
Branch Review |
main
|
Run status |
|
Run duration | 01m 05s |
Commit |
|
Committer | Lucano Vera |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
1
|
|
0
|
|
0
|
|
0
|
|
4
|
View all changes introduced in this branch ↗︎ |
Tests for review
cypress/e2e/smoke_test.cy.ts • 1 failed test
Test | Artifacts | |
---|---|---|
Smoke test > can submit an access request from the Privacy Center |
Screenshots
Video
|
Description Of Changes
Adds UI for setting up conditions for Manual Task feature. Adds a new dataset reference picker component.
Code Changes
Steps to Confirm
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.
Pre-Merge Checklist
CHANGELOG.md
updatedmain
downgrade()
migration is correct and works