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


##########
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:
   Oops, my bad. Didn't see this was inside a useEffect.



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