diff --git a/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx b/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx index d9065c4928..ec67c8d288 100644 --- a/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx +++ b/web/app/components/workflow/nodes/list-filter/components/sub-variable-picker.tsx @@ -51,6 +51,21 @@ const SubVariablePicker: FC = ({ placeholder={t('workflow.nodes.listFilter.selectVariableKeyPlaceholder')!} optionClassName='pl-4 pr-5 py-0' renderOption={renderOption} + renderTrigger={item => ( +
+ {item + ?
+
+ +
{item?.name}
+
+
+ :
+ + {t('common.placeholder.select')} +
} +
+ )} /> ) diff --git a/web/app/components/workflow/nodes/list-filter/panel.tsx b/web/app/components/workflow/nodes/list-filter/panel.tsx index 9d25ec5bb7..fa5699f923 100644 --- a/web/app/components/workflow/nodes/list-filter/panel.tsx +++ b/web/app/components/workflow/nodes/list-filter/panel.tsx @@ -26,6 +26,7 @@ const Panel: FC> = ({ readOnly, inputs, itemVarType, + itemVarTypeShowName, hasSubVariable, handleVarChanges, filterVar, @@ -103,29 +104,30 @@ const Panel: FC> = ({ ) : null} - + +
<> 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 3642b4235a..5335d6eced 100644 --- a/web/app/components/workflow/nodes/list-filter/use-config.ts +++ b/web/app/components/workflow/nodes/list-filter/use-config.ts @@ -63,6 +63,12 @@ const useConfig = (id: string, payload: ListFilterNodeType) => { const { varType, itemVarType } = getType() + const itemVarTypeShowName = useMemo(() => { + if (!inputs.variable) + return '?' + return [itemVarType.substring(0, 1).toUpperCase(), itemVarType.substring(1)].join('') + }, [inputs.variable, itemVarType]) + const hasSubVariable = [VarType.arrayFile].includes(varType) const handleVarChanges = useCallback((variable: ValueSelector | string) => { @@ -128,6 +134,7 @@ const useConfig = (id: string, payload: ListFilterNodeType) => { filterVar, varType, itemVarType, + itemVarTypeShowName, hasSubVariable, handleVarChanges, handleFilterChange,