danielzhe commented on code in PR #2760:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2760#discussion_r1854491829


##########
packages/boxed-expression-component/src/expressionVariable/ExpressionVariableMenu.tsx:
##########
@@ -100,17 +108,36 @@ export function ExpressionVariableMenu({
   }, [beeGwtService]);
 
   const saveExpression = useCallback(() => {
-    if (expressionName !== selectedExpressionName || dataType !== 
selectedDataType) {
-      onVariableUpdated({ name: expressionName, typeRef: dataType });
+    const changes: ExpressionChangedArgs = {
+      action: Action.VariableChanged,
+      variableUuid: variableUuid,
+      typeChange:
+        dataType !== selectedDataType
+          ? {
+              from: dataType,
+              to: selectedDataType,
+            }
+          : undefined,
+      nameChange:
+        expressionName !== selectedExpressionName
+          ? {
+              from: expressionName,
+              to: selectedExpressionName,
+            }
+          : undefined,
+    };
+
+    if (changes.nameChange || changes.typeChange) {
+      onVariableUpdated({ name: expressionName, typeRef: dataType, changes });
     }
-  }, [expressionName, selectedExpressionName, dataType, selectedDataType, 
onVariableUpdated]);
+  }, [expressionName, selectedExpressionName, dataType, selectedDataType, 
variableUuid, onVariableUpdated]);
 
   const resetFormData = useCallback(() => {
     setExpressionName(selectedExpressionName);
     setDataType(selectedDataType);
   }, [selectedExpressionName, selectedDataType]);
 
-  // onCancel doens't prevent the onHide call
+  // onCancel doesn't prevent the onHide call

Review Comment:
   Just a typo.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to