Feat: Add variable assignment node #10427 (#11058)

### What problem does this PR solve?

Feat: Add variable assignment node #10427

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-06 14:42:47 +08:00
committed by GitHub
parent d469ae6d50
commit ca30ef83bf
14 changed files with 36 additions and 357 deletions

View File

@ -27,9 +27,12 @@ export function useBuildSwitchOperatorOptions(
const { t } = useTranslation();
const switchOperatorOptions = useMemo(() => {
return SwitchOperatorOptions.filter((x) =>
subset.some((y) => y === x.value),
).map((x) => ({
const filteredOptions =
subset.length > 0
? SwitchOperatorOptions.filter((x) => subset.some((y) => y === x.value))
: SwitchOperatorOptions;
return filteredOptions.map((x) => ({
value: x.value,
icon: (
<LogicalOperatorIcon
@ -39,7 +42,7 @@ export function useBuildSwitchOperatorOptions(
),
label: t(`flow.switchOperatorOptions.${x.label}`),
}));
}, [t]);
}, [subset, t]);
return switchOperatorOptions;
}