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


##########
packages/scesim-editor/src/table/TestScenarioTable.tsx:
##########
@@ -81,11 +88,48 @@ function TestScenarioTable({
 
   const { i18n } = useTestScenarioEditorI18n();
 
-  const tableScrollableElementRef = useRef<{ current: HTMLDivElement | null 
}>({ current: null });
+  /** BACKGROUND TABLE MANAGMENT */
 
-  useEffect(() => {
-    tableScrollableElementRef.current.current = 
document.querySelector(".kie-scesim-editor--table-container") ?? null;
-  }, []);
+  const isBackground = useMemo(() => {
+    return "BackgroundData" in tableData.scesimData;
+  }, [tableData]);
+
+  const columnIndexStart = useMemo(() => {
+    return isBackground ? 0 : 1;
+  }, [isBackground]);
+
+  const retrieveRowsData = useCallback(
+    (rowData: SceSim__backgroundDatasType | SceSim__scenariosType) => {
+      if (isBackground) {
+        return (rowData as SceSim__backgroundDatasType).BackgroundData;
+      } else {
+        return (rowData as SceSim__scenariosType).Scenario;
+      }
+    },
+    [isBackground]
+  );

Review Comment:
   Hi @jomarko. apologies for my late reply. You highlighted a very interesting 
point, I'll investigate more and try to check if your comment is applicable. 
Thx!



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