Add first filter step version (#13093)
I rebuilt the advanced filters used in views and workflow search for a specific filter step. Components structure remains the same, using `stepFilterGroups` and `stepFilters`. But those filters are directly sent to backend. Also re-using the same kind of states we use for advanced filters to share the current filters used. And a context to share what's coming from workflow props (function to update step settings and readonly) ⚠️ this PR only focusses on the content of the step. There is still a lot to do on the filter icon behavior in the workflow https://github.com/user-attachments/assets/8a6a76f0-11fa-444a-82b9-71fc96b18af4
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { ObjectRecordsPermissions } from '@/types/ObjectRecordsPermissions';
|
||||
import { ObjectRecordsPermissions } from './ObjectRecordsPermissions';
|
||||
|
||||
type RoleId = string;
|
||||
export type ObjectRecordsPermissionsByRoleId = Record<
|
||||
|
||||
36
packages/twenty-shared/src/types/StepFilters.ts
Normal file
36
packages/twenty-shared/src/types/StepFilters.ts
Normal file
@ -0,0 +1,36 @@
|
||||
export enum StepLogicalOperator {
|
||||
AND = 'AND',
|
||||
OR = 'OR',
|
||||
}
|
||||
|
||||
export enum StepOperand {
|
||||
EQ = 'eq',
|
||||
NE = 'ne',
|
||||
GT = 'gt',
|
||||
GTE = 'gte',
|
||||
LT = 'lt',
|
||||
LTE = 'lte',
|
||||
LIKE = 'like',
|
||||
ILIKE = 'ilike',
|
||||
IN = 'in',
|
||||
IS = 'is',
|
||||
}
|
||||
|
||||
export type StepFilterGroup = {
|
||||
id: string;
|
||||
logicalOperator: StepLogicalOperator;
|
||||
parentStepFilterGroupId?: string;
|
||||
positionInStepFilterGroup?: number;
|
||||
};
|
||||
|
||||
export type StepFilter = {
|
||||
id: string;
|
||||
type: string;
|
||||
label: string;
|
||||
value: string;
|
||||
operand: StepOperand;
|
||||
displayValue: string;
|
||||
stepFilterGroupId: string;
|
||||
stepOutputKey: string;
|
||||
positionInStepFilterGroup?: number;
|
||||
};
|
||||
@ -13,3 +13,5 @@ export { FieldMetadataType } from './FieldMetadataType';
|
||||
export type { IsExactly } from './IsExactly';
|
||||
export type { ObjectRecordsPermissions } from './ObjectRecordsPermissions';
|
||||
export type { ObjectRecordsPermissionsByRoleId } from './ObjectRecordsPermissionsByRoleId';
|
||||
export type { StepFilterGroup, StepFilter } from './StepFilters';
|
||||
export { StepLogicalOperator, StepOperand } from './StepFilters';
|
||||
|
||||
Reference in New Issue
Block a user