You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by ti...@apache.org on 2025/03/04 22:10:12 UTC

(incubator-kie-tools) branch main updated: kie-issues#1855: New Test Scenario Editor doesn't implement the multiple rows/columns addition feature (#2954)

This is an automated email from the ASF dual-hosted git repository.

tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new b484947c7e2 kie-issues#1855: New Test Scenario Editor doesn't implement the multiple rows/columns addition feature (#2954)
b484947c7e2 is described below

commit b484947c7e27436b66e9b480fde3fe665f140e6e
Author: Yeser Amer <ye...@ibm.com>
AuthorDate: Tue Mar 4 23:10:07 2025 +0100

    kie-issues#1855: New Test Scenario Editor doesn't implement the multiple rows/columns addition feature (#2954)
---
 .../boxed-expression-component/src/api/BeeTable.ts |  2 +-
 .../scesim-editor/src/table/TestScenarioTable.tsx  | 29 +++++++++++-----------
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/packages/boxed-expression-component/src/api/BeeTable.ts b/packages/boxed-expression-component/src/api/BeeTable.ts
index 4a2db5972ca..c8cd34bdf26 100644
--- a/packages/boxed-expression-component/src/api/BeeTable.ts
+++ b/packages/boxed-expression-component/src/api/BeeTable.ts
@@ -80,7 +80,7 @@ export interface BeeTableProps<R extends object> {
   /** Enable keyboard navigation */
   enableKeyboardNavigation?: boolean;
   /** */
-  onRowAdded?: (args: { beforeIndex: number }) => void;
+  onRowAdded?: (args: { beforeIndex: number; insertDirection: InsertRowColumnsDirection; rowsCount: number }) => void;
   onRowDuplicated?: (args: { rowIndex: number }) => void;
   onRowReset?: (args: { rowIndex: number }) => void;
   onRowDeleted?: (args: { rowIndex: number }) => void;
diff --git a/packages/scesim-editor/src/table/TestScenarioTable.tsx b/packages/scesim-editor/src/table/TestScenarioTable.tsx
index d9742146e02..414d9d7aa82 100644
--- a/packages/scesim-editor/src/table/TestScenarioTable.tsx
+++ b/packages/scesim-editor/src/table/TestScenarioTable.tsx
@@ -555,20 +555,17 @@ function TestScenarioTable({
         const factMappingValues = isBackground
           ? state.scesim.model.ScenarioSimulationModel.background.scesimData.BackgroundData!
           : state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!;
-        const selectedColumnFactMappingIndex = determineSelectedColumnIndex(
-          factMappings,
-          args.currentIndex,
-          isInstance
-        );
 
-        addColumn({
-          beforeIndex: args.beforeIndex,
-          factMappings: factMappings,
-          factMappingValues: factMappingValues,
-          isInstance: isInstance,
-          insertDirection: args.insertDirection,
-          selectedColumnFactMappingIndex: selectedColumnFactMappingIndex,
-        });
+        for (let columnIndex = 0; columnIndex < args.columnsCount; columnIndex++) {
+          addColumn({
+            beforeIndex: args.beforeIndex,
+            factMappings: factMappings,
+            factMappingValues: factMappingValues,
+            isInstance: isInstance,
+            insertDirection: args.insertDirection,
+            selectedColumnFactMappingIndex: determineSelectedColumnIndex(factMappings, args.currentIndex, isInstance),
+          });
+        }
       });
     },
     [
@@ -641,7 +638,7 @@ function TestScenarioTable({
    * It adds a Scenario (Row) at the given row index
    */
   const onRowAdded = useCallback(
-    (args: { beforeIndex: number }) => {
+    (args: { beforeIndex: number; insertDirection: InsertRowColumnsDirection; rowsCount: number }) => {
       if (isBackground) {
         throw new Error("Impossible state. Background table can have a single row only");
       }
@@ -650,7 +647,9 @@ function TestScenarioTable({
           state.scesim.model.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping!;
         const factMappingValues = state.scesim.model.ScenarioSimulationModel.simulation.scesimData.Scenario!;
 
-        addRow({ beforeIndex: args.beforeIndex, factMappings: factMappings, factMappingValues: factMappingValues });
+        for (let rowIndex = 0; rowIndex < args.rowsCount; rowIndex++) {
+          addRow({ beforeIndex: args.beforeIndex, factMappings: factMappings, factMappingValues: factMappingValues });
+        }
       });
     },
     [isBackground, testScenarioEditorStoreApi]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org