Support actor filtering in workflows (#16783)
Fixes https://github.com/twentyhq/twenty/issues/15782 Find records <img width="422" height="423" alt="Capture d’écran 2025-12-23 à 16 23 49" src="https://github.com/user-attachments/assets/5856de06-d608-46f6-97a6-8f382f355a44" /> Filters <img width="422" height="271" alt="Capture d’écran 2025-12-23 à 16 23 32" src="https://github.com/user-attachments/assets/fcc10b6e-f1ec-497a-8593-d599164d4e4b" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds full support for filtering on `ACTOR` composite fields across UI and server. > > - Front-end: handles `ACTOR` in advanced filters and workflow filters; `source` uses multi-select options from `FieldActorSource`, `workspaceMemberId` uses `FormSingleRecordPicker`, others default to text > - Updates operand mapping for `ACTOR` (`source`→`SELECT`, `workspaceMemberId`→`RELATION`, else `TEXT`) > - Server: adds `ACTOR` evaluation with subfield-specific logic (delegates to select/relation/text evaluators) > - Simplifies `AdvancedFilterFieldSelectMenu` by removing workflow-specific field filtering > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7a8164cd2d4cad321ff1009bc7d1c4295a6672ca. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
+16
@@ -79,6 +79,8 @@ function evaluateFilter(
|
||||
return evaluateRelationFilter(filterWithConvertedOperand);
|
||||
case 'CURRENCY':
|
||||
return evaluateCurrencyFilter(filterWithConvertedOperand);
|
||||
case 'ACTOR':
|
||||
return evaluateActorFilter(filterWithConvertedOperand);
|
||||
default:
|
||||
return evaluateDefaultFilter(filterWithConvertedOperand);
|
||||
}
|
||||
@@ -398,6 +400,20 @@ function evaluateSelectFilter(filter: ResolvedFilter): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
function evaluateActorFilter(filter: ResolvedFilter): boolean {
|
||||
const { compositeFieldSubFieldName } = filter;
|
||||
|
||||
if (compositeFieldSubFieldName === 'source') {
|
||||
return evaluateSelectFilter(filter);
|
||||
}
|
||||
|
||||
if (compositeFieldSubFieldName === 'workspaceMemberId') {
|
||||
return evaluateRelationFilter(filter);
|
||||
}
|
||||
|
||||
return evaluateTextAndArrayFilter(filter, 'TEXT', compositeFieldSubFieldName);
|
||||
}
|
||||
|
||||
export function evaluateFilterConditions({
|
||||
filterGroups = [],
|
||||
filters = [],
|
||||
|
||||
Reference in New Issue
Block a user