Use array fields in filter steps (#15256)
Fixes https://github.com/twentyhq/twenty/issues/15247 Before - arrays not available <img width="595" height="403" alt="Capture d’écran 2025-10-22 à 14 32 22" src="https://github.com/user-attachments/assets/6c7a5fe3-5002-4b06-8ff3-af42f26d0dae" /> After <img width="595" height="403" alt="Capture d’écran 2025-10-22 à 14 32 03" src="https://github.com/user-attachments/assets/2e00c4f0-9e57-4bd9-94de-2caa0493446d" />
This commit is contained in:
-1
@@ -25,7 +25,6 @@ type WorkflowStepFilterFieldSelectProps = {
|
||||
const NON_SELECTABLE_FIELD_TYPES = [
|
||||
FieldMetadataType.ACTOR,
|
||||
FieldMetadataType.RICH_TEXT_V2,
|
||||
FieldMetadataType.ARRAY,
|
||||
FieldMetadataType.RATING,
|
||||
];
|
||||
|
||||
|
||||
+14
-1
@@ -1,6 +1,7 @@
|
||||
import { useFieldMetadataItemById } from '@/object-metadata/hooks/useFieldMetadataItemById';
|
||||
import { configurableViewFilterOperands } from '@/object-record/object-filter-dropdown/utils/configurableViewFilterOperands';
|
||||
import { FormFieldInput } from '@/object-record/record-field/ui/components/FormFieldInput';
|
||||
import { FormArrayFieldInput } from '@/object-record/record-field/ui/form-types/components/FormArrayFieldInput';
|
||||
import { FormMultiSelectFieldInput } from '@/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput';
|
||||
import { FormRelativeDatePicker } from '@/object-record/record-field/ui/form-types/components/FormRelativeDatePicker';
|
||||
import { FormSingleRecordPicker } from '@/object-record/record-field/ui/form-types/components/FormSingleRecordPicker';
|
||||
@@ -19,7 +20,7 @@ import {
|
||||
ViewFilterOperand,
|
||||
type StepFilter,
|
||||
} from 'twenty-shared/types';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { isDefined, parseJson } from 'twenty-shared/utils';
|
||||
import { type JsonValue } from 'type-fest';
|
||||
|
||||
type WorkflowStepFilterValueInputProps = {
|
||||
@@ -173,6 +174,18 @@ export const WorkflowStepFilterValueInput = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (variableType === FieldMetadataType.ARRAY) {
|
||||
const arrayValue = parseJson<string[]>(stepFilter.value) ?? [];
|
||||
|
||||
return (
|
||||
<FormArrayFieldInput
|
||||
defaultValue={arrayValue}
|
||||
onChange={handleValueChange}
|
||||
readonly={readonly}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const field = {
|
||||
type: variableType as FieldMetadataType,
|
||||
label: '',
|
||||
|
||||
Reference in New Issue
Block a user