diff --git a/web/app/components/workflow/nodes/list-filter/default.ts b/web/app/components/workflow/nodes/list-filter/default.ts index 899e3e7117..cd7676fb99 100644 --- a/web/app/components/workflow/nodes/list-filter/default.ts +++ b/web/app/components/workflow/nodes/list-filter/default.ts @@ -7,7 +7,7 @@ const i18nPrefix = 'workflow.errorMsg' const nodeDefault: NodeDefault = { defaultValue: { variable: [], - orderBy: { + order_by: { enabled: false, key: '', value: OrderBy.ASC, diff --git a/web/app/components/workflow/nodes/list-filter/panel.tsx b/web/app/components/workflow/nodes/list-filter/panel.tsx index 313cdc8a72..2eff63ef08 100644 --- a/web/app/components/workflow/nodes/list-filter/panel.tsx +++ b/web/app/components/workflow/nodes/list-filter/panel.tsx @@ -60,14 +60,14 @@ const Panel: FC> = ({ title={t(`${i18nPrefix}.orderBy`)} operations={ } > - {inputs.orderBy?.enabled + {inputs.order_by?.enabled ? (
{hasSubVariable && ( @@ -77,12 +77,12 @@ const Panel: FC> = ({
diff --git a/web/app/components/workflow/nodes/list-filter/types.ts b/web/app/components/workflow/nodes/list-filter/types.ts index 2e9459344c..b58dc9b8b6 100644 --- a/web/app/components/workflow/nodes/list-filter/types.ts +++ b/web/app/components/workflow/nodes/list-filter/types.ts @@ -10,10 +10,16 @@ export type Limit = { size?: number } +export type Condition = { + key: string + comparison_operator: string + value: string +} + export type ListFilterNodeType = CommonNodeType & { variable: ValueSelector - filterBy: [] - orderBy: { + filter_by: Condition[] + order_by: { enabled: boolean key: ValueSelector | string value: OrderBy diff --git a/web/app/components/workflow/nodes/list-filter/use-config.ts b/web/app/components/workflow/nodes/list-filter/use-config.ts index d427ec93ed..ba2413c720 100644 --- a/web/app/components/workflow/nodes/list-filter/use-config.ts +++ b/web/app/components/workflow/nodes/list-filter/use-config.ts @@ -62,7 +62,7 @@ const useConfig = (id: string, payload: ListFilterNodeType) => { const handleOrderByEnabledChange = useCallback((enabled: boolean) => { const newInputs = produce(inputs, (draft) => { - draft.orderBy.enabled = enabled + draft.order_by.enabled = enabled }) setInputs(newInputs) }, [inputs, setInputs]) @@ -70,7 +70,7 @@ const useConfig = (id: string, payload: ListFilterNodeType) => { const handleOrderByTypeChange = useCallback((type: OrderBy) => { return () => { const newInputs = produce(inputs, (draft) => { - draft.orderBy.value = type + draft.order_by.value = type }) setInputs(newInputs) }