yesamer commented on code in PR #2919:
URL:
https://github.com/apache/incubator-kie-tools/pull/2919#discussion_r1973551271
##########
packages/scesim-editor/src/drawer/TestScenarioDrawerDataSelectorPanel.tsx:
##########
@@ -202,6 +202,18 @@ function TestScenarioDataSelectorPanel() {
}
}, []);
+ /* It returns the TestScenarioDataObject that matches the provided ID
serching over all TestScenarioDataObjects and its children */
+ const findTestScenarioDataObjectById = useCallback(
+ (dataObjects: TestScenarioDataObject[], id: string):
TestScenarioDataObject => {
+ let dataObjectToReturn = dataObjects.find((dataObject) =>
id.startsWith(dataObject.id));
+ if (dataObjectToReturn?.id !== id && dataObjectToReturn?.children) {
+ dataObjectToReturn =
findTestScenarioDataObjectById(dataObjectToReturn.children, id);
+ }
+ return dataObjectToReturn!;
+ },
+ []
+ );
Review Comment:
Done
--
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]