From dcb9c64969be8cc16e1f35dcce7b8fd278c9b7c6 Mon Sep 17 00:00:00 2001 From: Stefano Ricci Date: Mon, 14 Oct 2024 14:09:47 +0200 Subject: [PATCH] userProp function builder: quote param --- .../expression/nodes/call/callUserPropEditor.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/webapp/components/expression/nodes/call/callUserPropEditor.js b/webapp/components/expression/nodes/call/callUserPropEditor.js index 37cea6a45d..da077c5c84 100644 --- a/webapp/components/expression/nodes/call/callUserPropEditor.js +++ b/webapp/components/expression/nodes/call/callUserPropEditor.js @@ -19,13 +19,10 @@ export const CallUserPropEditor = (props) => { const [value, setValue] = useState(initialValue) - const createFunctionCall = useCallback( - (valueUpdated) => - Expression.newCall({ callee: Expression.functionNames.userProp, params: [Expression.newLiteral(valueUpdated)] }), - [] - ) - - const onValueChange = useCallback((valueUpdated) => setValue(valueUpdated), []) + const createFunctionCall = useCallback((valueUpdated) => { + const param = Expression.newLiteral(StringUtils.quote(valueUpdated)) + return Expression.newCall({ callee: Expression.functionNames.userProp, params: [param] }) + }, []) const onConfirm = useCallback(() => { if (Objects.isNotEmpty(value)) { @@ -36,7 +33,7 @@ export const CallUserPropEditor = (props) => { return (
- +