fix(editor): Fix Multi option parameter expression when the value is an array (#12430)

This commit is contained in:
Shireen Missi 2025-01-06 08:51:13 +00:00 committed by GitHub
parent 76dded4bea
commit 452a7bfe2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -365,7 +365,7 @@ const getIssues = computed<string[]>(() => {
if (Array.isArray(displayValue.value)) {
checkValues = checkValues.concat(displayValue.value);
} else {
checkValues.push(displayValue.value as string);
checkValues = checkValues.concat(displayValue.value?.toString().split(','));
}
}
@ -856,6 +856,8 @@ async function optionSelected(command: string) {
(!props.modelValue || props.modelValue === '[Object: null]')
) {
valueChanged('={{ 0 }}');
} else if (props.parameter.type === 'multiOptions') {
valueChanged(`={{ ${JSON.stringify(props.modelValue)} }}`);
} else if (
props.parameter.type === 'number' ||
props.parameter.type === 'boolean' ||

View file

@ -132,8 +132,11 @@ const evaluatedExpression = computed<Result<unknown, Error>>(() => {
}
if (props.isForCredential) opts.additionalKeys = resolvedAdditionalExpressionData.value;
return { ok: true, result: workflowHelpers.resolveExpression(value, undefined, opts) };
const stringifyExpressionResult = props.parameter.type !== 'multiOptions';
return {
ok: true,
result: workflowHelpers.resolveExpression(value, undefined, opts, stringifyExpressionResult),
};
} catch (error) {
return { ok: false, error };
}