yesamer commented on code in PR #2919:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2919#discussion_r1973127487


##########
packages/scesim-editor/src/drawer/TestScenarioDrawerDataSelectorPanel.tsx:
##########
@@ -288,23 +300,20 @@ function TestScenarioDataSelectorPanel() {
     if (isExpressionType) {
       fieldID = 
selectedColumnMetadata.factMapping.expressionElements!.ExpressionElement![0].step.__$$text;
     } else if (isSimpleTypeFact) {
-      fieldID = 
selectedColumnMetadata.factMapping.expressionElements!.ExpressionElement![0].step.__$$text.concat(".");
+      fieldID = selectedColumnMetadata.factMapping
+        .expressionElements!.ExpressionElement![0].step.__$$text.concat(".")
+        .concat("value");
     } else {
       fieldID = selectedColumnMetadata.factMapping
         .expressionElements!.ExpressionElement!.map((expressionElement) => 
expressionElement.step.__$$text)
         .join(".");
     }
 
-    //TODO 1 This not work with multiple level and expressions fields. see 
kie-issues#1514
-    const treeViewItemToActivate = filteredDataObjects
-      .reduce((acc: TestScenarioDataObject[], item) => {
-        return item.children ? acc.concat(item.children) : acc;
-      }, [])
-      .filter((item) => item.id === fieldID);
+    const treeViewItemToActivate = 
findTestScenarioDataObjectById(filteredDataObjects, fieldID)!;

Review Comment:
   Mmhh, are you sure? that is inside a `useEffect()` block of code. 
   If I try it, it leads to this error:
   `React Hook "useMemo" cannot be called inside a callback. React Hooks must 
be called in a React function component or a custom React Hook function.`



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