tiagobento commented on code in PR #2912:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2912#discussion_r1985405235


##########
packages/boxed-expression-component/src/expressions/ExpressionDefinitionRoot/ExpressionContainer.tsx:
##########
@@ -107,10 +108,18 @@ export const ExpressionContainer: 
React.FunctionComponent<ExpressionContainerPro
 
   const getPlacementRef = useCallback(() => containerRef.current!, []);
 
+  const newExpression =
+    expression?.__$$element === "decisionTable"
+      ? {
+          ...expression,
+          rule: expression?.rule?.length === 0 ? [createDefaultRule()] : 
expression?.rule,
+        }
+      : expression;

Review Comment:
   ExpressionContainer is a generic component. We need to solve this problem 
for Decision Tables exclusively. Adding an `if` here makes this behavior 
obscure and couples this component with Decision Tables in particular. Please 
re-iterate.



-- 
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