You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "yesamer (via GitHub)" <gi...@apache.org> on 2024/09/27 13:24:56 UTC

[PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

yesamer opened a new pull request, #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628

   Closes https://github.com/apache/incubator-kie-issues/issues/1463
   
   Still WIP - Do not merge


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799562896


##########
packages/scesim-editor/src/mutations/updateCell.ts:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function updateCell({
+  columnIndex,
+  factMappings,
+  factMappingValuesTypes,
+  rowIndex,
+  value,
+}: {
+  columnIndex: number;
+  factMappings: SceSim__FactMappingType[];
+  factMappingValuesTypes: SceSim__FactMappingValuesTypes[];
+  rowIndex: number;
+  value: any;
+}) {
+  /* To update the related FactMappingValue, it compares every FactMappingValue associated with the Scenario (Row)
+     that contains the cell with the FactMapping (Column) fields factIdentifier and expressionIdentifier */
+  const factMapping = factMappings[columnIndex];
+  const factMappingValues = factMappingValuesTypes[rowIndex].factMappingValues.FactMappingValue!;
+
+  const factMappingValueToUpdateIndex = factMappingValues.findIndex(
+    (factMappingValue) =>
+      factMappingValue.factIdentifier.name?.__$$text == factMapping!.factIdentifier.name?.__$$text &&
+      factMappingValue.factIdentifier.className?.__$$text == factMapping!.factIdentifier.className?.__$$text &&
+      factMappingValue.expressionIdentifier.name?.__$$text == factMapping!.expressionIdentifier.name?.__$$text &&
+      factMappingValue.expressionIdentifier.type?.__$$text == factMapping!.expressionIdentifier.type?.__$$text
+  );

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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1796475118


##########
packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx:
##########
@@ -33,36 +34,49 @@ import { Tooltip } from "@patternfly/react-core/dist/js/components/Tooltip";
 import AddIcon from "@patternfly/react-icons/dist/esm/icons/add-circle-o-icon";
 import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon";
 
-import { TestScenarioType } from "../TestScenarioEditor";
+import { useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext";
 import { useTestScenarioEditorI18n } from "../i18n";
 
 import "./TestScenarioCreationPanel.css";
 
-function TestScenarioCreationPanel({
-  onCreateScesimButtonClicked,
-}: {
-  onCreateScesimButtonClicked: (
-    assetType: string,
-    isStatelessSessionRule: boolean,
-    isTestSkipped: boolean,
-    kieSessionRule: string,
-    ruleFlowGroup: string
-  ) => void;
-}) {
+function TestScenarioCreationPanel() {
   const { i18n } = useTestScenarioEditorI18n();
 
   const assetsOption = [
     { value: "", label: i18n.creationPanel.assetsOption.noChoice, disabled: true },
-    { value: TestScenarioType[TestScenarioType.DMN], label: i18n.creationPanel.assetsOption.dmn, disabled: false },
-    { value: TestScenarioType[TestScenarioType.RULE], label: i18n.creationPanel.assetsOption.rule, disabled: false },
+    { value: "DMN", label: i18n.creationPanel.assetsOption.dmn, disabled: false },
+    { value: "RULE", label: i18n.creationPanel.assetsOption.rule, disabled: false },
   ];
 
-  const [assetType, setAssetType] = React.useState("");
+  const [assetType, setAssetType] = React.useState<"" | "DMN" | "RULE">("");
   const [isAutoFillTableEnabled, setAutoFillTableEnabled] = React.useState(true);
   const [isStatelessSessionRule, setStatelessSessionRule] = React.useState(false);
   const [isTestSkipped, setTestSkipped] = React.useState(false);
   const [kieSessionRule, setKieSessionRule] = React.useState("");
   const [ruleFlowGroup, setRuleFlowGroup] = React.useState("");
+  const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi();
+
+  const createTestScenario = useCallback(
+    (
+      assetType: string,
+      isStatelessSessionRule: boolean,
+      isTestSkipped: boolean,
+      kieSessionRule: string,
+      ruleFlowGroup: string
+    ) =>
+      testScenarioEditorStoreApi.setState((state) => {
+        const settings = state.scesim.model.ScenarioSimulationModel.settings;
+        settings.dmnFilePath = assetType === "DMN" ? { __$$text: "./MockedDMNName.dmn" } : undefined;
+        settings.dmnName = assetType === "DMN" ? { __$$text: "MockedDMNName.dmn" } : undefined;
+        settings.dmnNamespace = assetType === "DMN" ? { __$$text: "https:\\kiegroup" } : undefined;
+        (settings.dmoSession = assetType === "RULE" && kieSessionRule ? { __$$text: kieSessionRule } : undefined),
+          (settings.ruleFlowGroup = assetType === "RULE" && ruleFlowGroup ? { __$$text: ruleFlowGroup } : undefined),
+          (settings.skipFromBuild = { __$$text: isTestSkipped }),
+          (settings.stateless = assetType === "RULE" ? { __$$text: isStatelessSessionRule } : undefined),
+          (settings.type = { __$$text: assetType });

Review Comment:
   Formatting here is somehow unexpected



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer merged PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799563440


##########
packages/scesim-editor/src/mutations/updateColumn.ts:
##########
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import _ from "lodash";
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function updateColumn({
+  className,
+  expressionAlias,
+  expressionElementsSteps,
+  expressionIdentifierName,
+  expressionIdentifierType,
+  factMappings,
+  factMappingValuesTypes,
+  factMappingValueType,
+  factClassName,
+  factIdentifierClassName,
+  factIdentifierName,
+  factName,
+  selectedColumnIndex,
+}: {
+  className: string;
+  expressionAlias: string;
+  expressionElementsSteps: string[];
+  expressionIdentifierName: string | undefined;
+  expressionIdentifierType: string | undefined;
+  factMappings: SceSim__FactMappingType[];
+  factMappingValuesTypes: SceSim__FactMappingValuesTypes[];
+  factMappingValueType: "EXPRESSION" | "NOT_EXPRESSION";
+  factClassName: string;
+  factIdentifierClassName: string | undefined;
+  factIdentifierName: string | undefined;
+  factName: string;
+  selectedColumnIndex: number;
+}): { updatedFactMapping: SceSim__FactMappingType } {
+  const factMappingToUpdate = factMappings[selectedColumnIndex];
+  factMappingToUpdate.className = { __$$text: className };
+  factMappingToUpdate.factAlias = { __$$text: factName };
+  factMappingToUpdate.factIdentifier.className = { __$$text: factClassName };
+  factMappingToUpdate.factIdentifier.name = { __$$text: factName };
+  factMappingToUpdate.factMappingValueType = { __$$text: factMappingValueType };
+  factMappingToUpdate.expressionAlias = { __$$text: expressionAlias };
+  factMappingToUpdate.expressionElements = {
+    ExpressionElement: expressionElementsSteps.map((ee) => {
+      return { step: { __$$text: ee } };
+    }),
+  };
+
+  factMappingValuesTypes.forEach((fmv) => {
+    const factMappingValues = fmv.factMappingValues.FactMappingValue!;
+    const factMappingValueToUpdateIndex = factMappingValues.findIndex(
+      (factMappingValue) =>
+        factMappingValue.factIdentifier.name?.__$$text == factIdentifierName &&
+        factMappingValue.factIdentifier.className?.__$$text == factIdentifierClassName &&
+        factMappingValue.expressionIdentifier.name?.__$$text == expressionIdentifierName &&
+        factMappingValue.expressionIdentifier.type?.__$$text == expressionIdentifierType
+    );

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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799499141


##########
packages/scesim-editor/src/mutations/deleteColumn.ts:
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import _, { isNumber } from "lodash";
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function deleteColumn({
+  factMappingIndexToRemove,
+  factMappings,
+  factMappingValues,
+  isBackground,
+  isInstance,
+  selectedColumnIndex,
+}: {
+  factMappingIndexToRemove: number;
+  factMappings: SceSim__FactMappingType[];
+  factMappingValues: SceSim__FactMappingValuesTypes[];
+  isBackground: boolean;
+  isInstance: boolean;
+  selectedColumnIndex: number;
+}): {
+  deletedFactMappingIndexs: number[];
+} {
+  /* Retriving the FactMapping (Column) to be removed). If the user selected a single column, it finds the exact
+       FactMapping to delete. If the user selected an instance (group of columns), it retrives all the FactMappings
+       that belongs to the the instance group */
+  const factMappingToRemove = factMappings[factMappingIndexToRemove];
+  const groupType = factMappingToRemove.expressionIdentifier.type!.__$$text;
+  const instanceName = factMappingToRemove.factIdentifier.name!.__$$text;
+  const instanceType = factMappingToRemove.factIdentifier.className!.__$$text;
+
+  const allFactMappingWithIndexesToRemove = isInstance
+    ? factMappings
+        .map((factMapping, index) => {
+          if (
+            factMapping.expressionIdentifier.type!.__$$text === groupType &&
+            factMapping.factIdentifier.name?.__$$text === instanceName &&
+            factMapping.factIdentifier.className?.__$$text === instanceType
+          ) {
+            return { factMappingIndex: index, factMapping: factMapping };
+          } else {
+            return {};
+          }
+        })
+        .filter((item) => isNumber(item.factMappingIndex))
+    : [{ factMappingIndex: selectedColumnIndex + (isBackground ? 0 : 1), factMapping: factMappingToRemove }];
+
+  factMappings.splice(allFactMappingWithIndexesToRemove[0].factMappingIndex!, allFactMappingWithIndexesToRemove.length);
+
+  factMappingValues.forEach((rowData) => {
+    allFactMappingWithIndexesToRemove.forEach((itemToRemove) => {
+      const factMappingValueColumnIndexToRemove = rowData.factMappingValues.FactMappingValue!.findIndex(
+        (factMappingValue) =>
+          factMappingValue.factIdentifier.name?.__$$text == itemToRemove.factMapping!.factIdentifier.name?.__$$text &&
+          factMappingValue.factIdentifier.className?.__$$text ==
+            itemToRemove.factMapping!.factIdentifier.className?.__$$text &&
+          factMappingValue.expressionIdentifier.name?.__$$text ==
+            itemToRemove.factMapping!.expressionIdentifier.name?.__$$text &&
+          factMappingValue.expressionIdentifier.type?.__$$text ==
+            itemToRemove.factMapping!.expressionIdentifier.type?.__$$text

Review Comment:
   == vs ===



##########
packages/scesim-editor/src/mutations/addColumn.ts:
##########
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import _ from "lodash";
+import { v4 as uuid } from "uuid";
+
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+import { InsertRowColumnsDirection } from "@kie-tools/boxed-expression-component/dist/api/BeeTable";
+
+export function addColumn({
+  beforeIndex,

Review Comment:
   `beforeIndex` sounds to me we as we will always add a column after the selected one, however as we have also `insertDirection` it is probably not true. could you please explain it little bit more?



##########
packages/scesim-marshaller/src/schemas/scesim-1_8/SceSim.xsd:
##########
@@ -1,3 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+    http://www.apache.org/licenses/LICENSE-2.0
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
 <xsd:schema

Review Comment:
   thumb up!



##########
packages/scesim-editor/src/mutations/updateColumnWidth.ts:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { SceSim__FactMappingType } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function updateColumnWidth({
+  factMappings,
+  inputIndex,

Review Comment:
   not sure, maybe it is rather columnIndex?



##########
packages/scesim-editor/src/mutations/updateCell.ts:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function updateCell({
+  columnIndex,
+  factMappings,
+  factMappingValuesTypes,
+  rowIndex,
+  value,
+}: {
+  columnIndex: number;
+  factMappings: SceSim__FactMappingType[];
+  factMappingValuesTypes: SceSim__FactMappingValuesTypes[];
+  rowIndex: number;
+  value: any;
+}) {
+  /* To update the related FactMappingValue, it compares every FactMappingValue associated with the Scenario (Row)
+     that contains the cell with the FactMapping (Column) fields factIdentifier and expressionIdentifier */
+  const factMapping = factMappings[columnIndex];
+  const factMappingValues = factMappingValuesTypes[rowIndex].factMappingValues.FactMappingValue!;
+
+  const factMappingValueToUpdateIndex = factMappingValues.findIndex(
+    (factMappingValue) =>
+      factMappingValue.factIdentifier.name?.__$$text == factMapping!.factIdentifier.name?.__$$text &&
+      factMappingValue.factIdentifier.className?.__$$text == factMapping!.factIdentifier.className?.__$$text &&
+      factMappingValue.expressionIdentifier.name?.__$$text == factMapping!.expressionIdentifier.name?.__$$text &&
+      factMappingValue.expressionIdentifier.type?.__$$text == factMapping!.expressionIdentifier.type?.__$$text
+  );

Review Comment:
   == vs ===



##########
packages/scesim-editor/src/table/TestScenarioTable.tsx:
##########
@@ -833,127 +580,54 @@ function TestScenarioTable({
    */
   const onColumnDeleted = useCallback(
     (args: { columnIndex: number; groupType: string }) => {
-      updateTestScenarioModel((prevState) => {
-        const isInstance =
-          args.groupType === TestScenarioTableColumnInstanceGroup.EXPECT ||
-          args.groupType === TestScenarioTableColumnInstanceGroup.GIVEN;
-
-        const factMappings = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings
-          .FactMapping!;
-        const columnIndexToRemove = determineSelectedColumnIndex(factMappings, args.columnIndex + 1, isInstance);
-
-        /* Retriving the FactMapping (Column) to be removed). If the user selected a single column, it finds the exact
-           FactMapping to delete. If the user selected an instance (group of columns), it retrives all the FactMappings
-           that belongs to the the instance group */
-        const factMappingToRemove = factMappings[columnIndexToRemove];
-        const groupType = factMappingToRemove.expressionIdentifier.type!.__$$text;
-        const instanceName = factMappingToRemove.factIdentifier.name!.__$$text;
-        const instanceType = factMappingToRemove.factIdentifier.className!.__$$text;
-
-        const allFactMappingWithIndexesToRemove = isInstance
-          ? factMappings
-              .map((factMapping, index) => {
-                if (
-                  factMapping.expressionIdentifier.type!.__$$text === groupType &&
-                  factMapping.factIdentifier.name?.__$$text === instanceName &&
-                  factMapping.factIdentifier.className?.__$$text === instanceType
-                ) {
-                  return { factMappingIndex: index, factMapping: factMapping };
-                } else {
-                  return {};
-                }
-              })
-              .filter((item) => isNumber(item.factMappingIndex))
-          : [{ factMappingIndex: args.columnIndex + columnIndexStart, factMapping: factMappingToRemove }];
-
-        /* Cloning the FactMappings list (Columns) and and removing the FactMapping (Column) at given index */
-        const deepClonedFactMappings = JSON.parse(
-          JSON.stringify(
-            retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings.FactMapping
-          )
-        );
-        deepClonedFactMappings.splice(
-          allFactMappingWithIndexesToRemove[0].factMappingIndex,
-          allFactMappingWithIndexesToRemove.length
-        );
-
-        /* Cloning the Scenario List (Rows) and finding the Cell(s) to remove accordingly to the factMapping data of 
-          the removed columns */
-        const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse(
-          JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground) ?? [])
-        );
-        deepClonedRowsData.forEach((rowData) => {
-          allFactMappingWithIndexesToRemove.forEach((itemToRemove) => {
-            const factMappingValueColumnIndexToRemove = retrieveFactMappingValueIndexByIdentifiers(
-              rowData.factMappingValues.FactMappingValue!,
-              itemToRemove.factMapping!.factIdentifier,
-              itemToRemove.factMapping!.expressionIdentifier
-            )!;
-
-            return {
-              factMappingValues: {
-                FactMappingValue: rowData.factMappingValues.FactMappingValue!.splice(
-                  factMappingValueColumnIndexToRemove,
-                  1
-                ),
-              },
-            };
-          });
+      /* GIVEN and EXPECTED of FIELD and INSTANCE column types can be added only */
+      if (
+        TestScenarioTableColumnFieldGroup.OTHER === args.groupType ||
+        TestScenarioTableColumnHeaderGroup.EXPECT === args.groupType ||
+        TestScenarioTableColumnHeaderGroup.GIVEN === args.groupType
+      ) {
+        console.error("Can't add a " + args.groupType + " type column.");
+        return;
+      }

Review Comment:
   handler is named `onColumnDeleted` however comments and logs says `added`, is taht correct?



##########
packages/scesim-editor/src/store/computed/computeTestScenarioDataObjects.ts:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Computed, State, TestScenarioDataObject } from "../TestScenarioEditorStore";
+
+export function computeTestScenarioDataObjects(
+  factMappings: State["scesim"]["model"]["ScenarioSimulationModel"]["simulation"]["scesimModelDescriptor"]["factMappings"]["FactMapping"]
+) {
+  /* To create the Data Object arrays we need an external source, in details: */
+  /* DMN Data: Retrieving DMN type from linked DMN file */
+  /* Java classes: Retrieving Java classes info from the user projects */
+  /* At this time, none of the above are supported */
+  /* Therefore, it tries to retrieve these info from the SCESIM file, if are present */
+
+  /* Retriving Data Object from the scesim file.       
+       That makes sense for previously created scesim files */
+
+  const factsMappings = factMappings ?? [];
+  const dataObjects: TestScenarioDataObject[] = [];
+
+  /* The first two FactMapping are related to the "Number" and "Description" columns. 
+        If those columns only are present, no Data Objects can be detected in the scesim file */
+  for (let i = 2; i < factsMappings.length; i++) {
+    if (factsMappings[i].className!.__$$text === "java.lang.Void") {
+      continue;
+    }
+    const factID = factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text;
+    const dataObject = dataObjects.find((value) => value.id === factID);
+    const isSimpleTypeFact = factsMappings[i].expressionElements!.ExpressionElement!.length == 1;

Review Comment:
   == vs ===



##########
packages/scesim-editor/src/mutations/updateColumn.ts:
##########
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import _ from "lodash";
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function updateColumn({
+  className,
+  expressionAlias,
+  expressionElementsSteps,
+  expressionIdentifierName,
+  expressionIdentifierType,
+  factMappings,
+  factMappingValuesTypes,
+  factMappingValueType,
+  factClassName,
+  factIdentifierClassName,
+  factIdentifierName,
+  factName,
+  selectedColumnIndex,
+}: {
+  className: string;
+  expressionAlias: string;
+  expressionElementsSteps: string[];
+  expressionIdentifierName: string | undefined;
+  expressionIdentifierType: string | undefined;
+  factMappings: SceSim__FactMappingType[];
+  factMappingValuesTypes: SceSim__FactMappingValuesTypes[];
+  factMappingValueType: "EXPRESSION" | "NOT_EXPRESSION";
+  factClassName: string;
+  factIdentifierClassName: string | undefined;
+  factIdentifierName: string | undefined;
+  factName: string;
+  selectedColumnIndex: number;
+}): { updatedFactMapping: SceSim__FactMappingType } {
+  const factMappingToUpdate = factMappings[selectedColumnIndex];
+  factMappingToUpdate.className = { __$$text: className };
+  factMappingToUpdate.factAlias = { __$$text: factName };
+  factMappingToUpdate.factIdentifier.className = { __$$text: factClassName };
+  factMappingToUpdate.factIdentifier.name = { __$$text: factName };
+  factMappingToUpdate.factMappingValueType = { __$$text: factMappingValueType };
+  factMappingToUpdate.expressionAlias = { __$$text: expressionAlias };
+  factMappingToUpdate.expressionElements = {
+    ExpressionElement: expressionElementsSteps.map((ee) => {
+      return { step: { __$$text: ee } };
+    }),
+  };
+
+  factMappingValuesTypes.forEach((fmv) => {
+    const factMappingValues = fmv.factMappingValues.FactMappingValue!;
+    const factMappingValueToUpdateIndex = factMappingValues.findIndex(
+      (factMappingValue) =>
+        factMappingValue.factIdentifier.name?.__$$text == factIdentifierName &&
+        factMappingValue.factIdentifier.className?.__$$text == factIdentifierClassName &&
+        factMappingValue.expressionIdentifier.name?.__$$text == expressionIdentifierName &&
+        factMappingValue.expressionIdentifier.type?.__$$text == expressionIdentifierType
+    );

Review Comment:
   ==vs ===



##########
packages/scesim-editor/src/TestScenarioEditor.tsx:
##########
@@ -127,174 +114,59 @@ export type TestScenarioSelectedColumnMetaData = {
   isBackground: boolean;
 };
 
-function TestScenarioMainPanel({
-  fileName,
-  scesimModel,
-  updateSettingField,
-  updateTestScenarioModel,
-}: {
-  fileName: string;
-  scesimModel: { ScenarioSimulationModel: SceSim__ScenarioSimulationModelType };
-  updateSettingField: (field: string, value: string) => void;
-  updateTestScenarioModel: React.Dispatch<React.SetStateAction<SceSimModel>>;
-}) {
+function TestScenarioMainPanel({ fileName }: { fileName: string }) {
   const { i18n } = useTestScenarioEditorI18n();
-
-  const [alert, setAlert] = useState<TestScenarioAlert>({ enabled: false, variant: "info" });
-  const [dataObjects, setDataObjects] = useState<TestScenarioDataObject[]>([]);
-  const [dockPanel, setDockPanel] = useState({ isOpen: true, selected: TestScenarioEditorDock.DATA_OBJECT });
-  const [selectedColumnMetadata, setSelectedColumnMetaData] = useState<TestScenarioSelectedColumnMetaData | null>(null);
-  const [tab, setTab] = useState(TestScenarioEditorTab.EDITOR);
+  const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi();
+  const navigation = useTestScenarioEditorStore((s) => s.navigation);
+  const scesimModel = useTestScenarioEditorStore((s) => s.scesim.model);
+  const isAlertEnabled = true; // Will be managed in kie-issue#970
+  const testScenarioType = scesimModel.ScenarioSimulationModel.settings.type?.__$$text.toUpperCase();
 
   const scenarioTableScrollableElementRef = useRef<HTMLDivElement | null>(null);
   const backgroundTableScrollableElementRef = useRef<HTMLDivElement | null>(null);
 
-  const onTabChanged = useCallback((_event, tab) => {
-    setSelectedColumnMetaData(null);
-    setTab(tab);
-  }, []);
-
-  const closeDockPanel = useCallback(() => {
-    setDockPanel((prev) => {
-      return { ...prev, isOpen: false };
-    });
-  }, []);
-
-  const openDockPanel = useCallback((selected: TestScenarioEditorDock) => {
-    setDockPanel({ isOpen: true, selected: selected });
-  }, []);
-
-  useEffect(() => {
-    setDockPanel({ isOpen: true, selected: TestScenarioEditorDock.DATA_OBJECT });
-    setSelectedColumnMetaData(null);
-    setTab(TestScenarioEditorTab.EDITOR);
-  }, [fileName]);
-
-  /** This is TEMPORARY */
-  useEffect(() => {
-    /* To create the Data Object arrays we need an external source, in details: */
-    /* DMN Data: Retrieving DMN type from linked DMN file */
-    /* Java classes: Retrieving Java classes info from the user projects */
-    /* At this time, none of the above are supported */
-    /* Therefore, it tries to retrieve these info from the SCESIM file, if are present */
-
-    /* Retriving Data Object from the scesim file.       
-       That makes sense for previously created scesim files */
-
-    const factsMappings: SceSim__FactMappingType[] =
-      scesimModel.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping ?? [];
-
-    const dataObjects: TestScenarioDataObject[] = [];
-
-    /* The first two FactMapping are related to the "Number" and "Description" columns. 
-       If those columns only are present, no Data Objects can be detected in the scesim file */
-    for (let i = 2; i < factsMappings.length; i++) {
-      if (factsMappings[i].className!.__$$text === "java.lang.Void") {
-        continue;
-      }
-      const factID = factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text;
-      const dataObject = dataObjects.find((value) => value.id === factID);
-      const isSimpleTypeFact = factsMappings[i].expressionElements!.ExpressionElement!.length == 1;
-      const propertyID = isSimpleTypeFact //POTENTIAL BUG
-        ? factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text.concat(".")
-        : factsMappings[i]
-            .expressionElements!.ExpressionElement!.map((expressionElement) => expressionElement.step.__$$text)
-            .join(".");
-      const propertyName = isSimpleTypeFact
-        ? "value"
-        : factsMappings[i].expressionElements!.ExpressionElement!.slice(-1)[0].step.__$$text;
-      if (dataObject) {
-        if (!dataObject.children?.some((value) => value.id === propertyID)) {
-          dataObject.children!.push({
-            id: propertyID,
-            customBadgeContent: factsMappings[i].className.__$$text,
-            isSimpleTypeFact: isSimpleTypeFact,
-            name: propertyName,
-          });
-        }
-      } else {
-        dataObjects.push({
-          id: factID,
-          name: factsMappings[i].factAlias!.__$$text,
-          customBadgeContent: factsMappings[i].factIdentifier!.className!.__$$text,
-          children: [
-            {
-              id: propertyID,
-              name: propertyName,
-              customBadgeContent: factsMappings[i].className.__$$text,
-            },
-          ],
-        });
-      }
-    }
-
-    setDataObjects(dataObjects);
-  }, [scesimModel.ScenarioSimulationModel.settings.type]);
-
-  /** It determines the Alert State */
-  useEffect(() => {
-    const assetType = scesimModel.ScenarioSimulationModel.settings.type!.__$$text;
-
-    let alertEnabled = false;
-    let alertMessage = "";
-    let alertVariant: "default" | "danger" | "warning" | "info" | "success" = "danger";
-
-    if (dataObjects.length > 0) {
-      alertMessage =
-        assetType === TestScenarioType[TestScenarioType.DMN]
-          ? i18n.alerts.dmnDataRetrievedFromScesim
-          : i18n.alerts.ruleDataRetrievedFromScesim;
-      alertEnabled = true;
-    } else {
-      alertMessage =
-        assetType === TestScenarioType[TestScenarioType.DMN]
-          ? i18n.alerts.dmnDataNotAvailable
-          : i18n.alerts.ruleDataNotAvailable;
-      alertVariant = assetType === TestScenarioType[TestScenarioType.DMN] ? "warning" : "danger";
-      alertEnabled = true;
-    }
+  const onTabChanged = useCallback(
+    (_event, tab) => {
+      testScenarioEditorStoreApi.setState((state) => {
+        state.navigation.tab = tab;
+      });
+    },
+    [testScenarioEditorStoreApi]
+  );
 
-    setAlert({ enabled: alertEnabled, message: alertMessage, variant: alertVariant });
-  }, [dataObjects, i18n, scesimModel.ScenarioSimulationModel.settings.type]);
+  const showDockPanel = useCallback(
+    (show: boolean) => {
+      testScenarioEditorStoreApi.setState((state) => {
+        state.navigation.dock.isOpen = show;
+      });
+    },
+    [testScenarioEditorStoreApi]
+  );
 
   return (
     <>
       <div className="kie-scesim-editor--content">
-        <Drawer isExpanded={dockPanel.isOpen} isInline={true} position={"right"}>
+        <Drawer isExpanded={navigation.dock.isOpen} isInline={true} position={"right"}>
           <DrawerContent
-            panelContent={
-              <TestScenarioDrawerPanel
-                dataObjects={dataObjects}
-                fileName={fileName}
-                onDrawerClose={closeDockPanel}
-                onUpdateSettingField={updateSettingField}
-                scesimModel={scesimModel}
-                selectedColumnMetaData={selectedColumnMetadata}
-                selectedDock={dockPanel.selected}
-                testScenarioSettings={{
-                  assetType: scesimModel.ScenarioSimulationModel.settings!.type!.__$$text,
-                  dmnName: scesimModel.ScenarioSimulationModel.settings!.dmnName?.__$$text,
-                  dmnNamespace: scesimModel.ScenarioSimulationModel.settings!.dmnNamespace?.__$$text,
-                  isStatelessSessionRule: scesimModel.ScenarioSimulationModel.settings!.stateless?.__$$text ?? false,
-                  isTestSkipped: scesimModel.ScenarioSimulationModel.settings!.skipFromBuild?.__$$text ?? false,
-                  kieSessionRule: scesimModel.ScenarioSimulationModel.settings!.dmoSession?.__$$text,
-                  ruleFlowGroup: scesimModel.ScenarioSimulationModel.settings!.ruleFlowGroup?.__$$text,
-                }}
-                updateSelectedColumnMetaData={setSelectedColumnMetaData}
-                updateTestScenarioModel={updateTestScenarioModel}
-              />
-            }
+            panelContent={<TestScenarioDrawerPanel fileName={fileName} onDrawerClose={() => showDockPanel(false)} />}
           >
             <DrawerContentBody>
-              {alert.enabled && (
+              {isAlertEnabled && (
                 <div className="kie-scesim-editor--content-alert">
-                  <Alert variant={alert.variant} title={alert.message} />
+                  <Alert
+                    variant={testScenarioType === "DMN" ? "warning" : "danger"}

Review Comment:
   not sure I understand this, do we use different icons to display warnings in DMN scesim vs DRL scesim?



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799571690


##########
packages/scesim-editor/src/store/computed/computeTestScenarioDataObjects.ts:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Computed, State, TestScenarioDataObject } from "../TestScenarioEditorStore";
+
+export function computeTestScenarioDataObjects(
+  factMappings: State["scesim"]["model"]["ScenarioSimulationModel"]["simulation"]["scesimModelDescriptor"]["factMappings"]["FactMapping"]
+) {
+  /* To create the Data Object arrays we need an external source, in details: */
+  /* DMN Data: Retrieving DMN type from linked DMN file */
+  /* Java classes: Retrieving Java classes info from the user projects */
+  /* At this time, none of the above are supported */
+  /* Therefore, it tries to retrieve these info from the SCESIM file, if are present */
+
+  /* Retriving Data Object from the scesim file.       
+       That makes sense for previously created scesim files */
+
+  const factsMappings = factMappings ?? [];
+  const dataObjects: TestScenarioDataObject[] = [];
+
+  /* The first two FactMapping are related to the "Number" and "Description" columns. 
+        If those columns only are present, no Data Objects can be detected in the scesim file */
+  for (let i = 2; i < factsMappings.length; i++) {
+    if (factsMappings[i].className!.__$$text === "java.lang.Void") {
+      continue;
+    }
+    const factID = factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text;
+    const dataObject = dataObjects.find((value) => value.id === factID);
+    const isSimpleTypeFact = factsMappings[i].expressionElements!.ExpressionElement!.length == 1;

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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#issuecomment-2411529769

   During manual check, once I deleted all GIVEN instances, the right side panel did not display all objects, one was missing
   
   ![Screenshot 2024-10-14 165827](https://github.com/user-attachments/assets/cf3e9a23-fdcb-44ab-b157-95fed8864c87)
   


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1795588902


##########
packages/scesim-editor/src/table/TestScenarioTable.tsx:
##########
@@ -766,7 +725,7 @@ function TestScenarioTable({
            we're going to introduce. The FactMappingValue will be linked with its related FactMapping via expressionIdentifier
            and factIdentier data. That means, the column index of new FactMappingValue could be different in other Scenario (rows) */
         const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse(
-          JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground))
+          JSON.stringify(retrieveRowsDataFromModel(state.scesim.model.ScenarioSimulationModel, isBackground))
         );
         deepClonedRowsData.forEach((scenario) => {

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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#issuecomment-2411837019

   I still see some occurrences of `JSON.parse(JSON.stringify(` but I guess since this component is WIP in general, we can address those in separate PRs. Approving for us to move forward and not increase this PR's size.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799573172


##########
packages/scesim-editor/src/table/TestScenarioTable.tsx:
##########
@@ -833,127 +580,54 @@ function TestScenarioTable({
    */
   const onColumnDeleted = useCallback(
     (args: { columnIndex: number; groupType: string }) => {
-      updateTestScenarioModel((prevState) => {
-        const isInstance =
-          args.groupType === TestScenarioTableColumnInstanceGroup.EXPECT ||
-          args.groupType === TestScenarioTableColumnInstanceGroup.GIVEN;
-
-        const factMappings = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings
-          .FactMapping!;
-        const columnIndexToRemove = determineSelectedColumnIndex(factMappings, args.columnIndex + 1, isInstance);
-
-        /* Retriving the FactMapping (Column) to be removed). If the user selected a single column, it finds the exact
-           FactMapping to delete. If the user selected an instance (group of columns), it retrives all the FactMappings
-           that belongs to the the instance group */
-        const factMappingToRemove = factMappings[columnIndexToRemove];
-        const groupType = factMappingToRemove.expressionIdentifier.type!.__$$text;
-        const instanceName = factMappingToRemove.factIdentifier.name!.__$$text;
-        const instanceType = factMappingToRemove.factIdentifier.className!.__$$text;
-
-        const allFactMappingWithIndexesToRemove = isInstance
-          ? factMappings
-              .map((factMapping, index) => {
-                if (
-                  factMapping.expressionIdentifier.type!.__$$text === groupType &&
-                  factMapping.factIdentifier.name?.__$$text === instanceName &&
-                  factMapping.factIdentifier.className?.__$$text === instanceType
-                ) {
-                  return { factMappingIndex: index, factMapping: factMapping };
-                } else {
-                  return {};
-                }
-              })
-              .filter((item) => isNumber(item.factMappingIndex))
-          : [{ factMappingIndex: args.columnIndex + columnIndexStart, factMapping: factMappingToRemove }];
-
-        /* Cloning the FactMappings list (Columns) and and removing the FactMapping (Column) at given index */
-        const deepClonedFactMappings = JSON.parse(
-          JSON.stringify(
-            retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings.FactMapping
-          )
-        );
-        deepClonedFactMappings.splice(
-          allFactMappingWithIndexesToRemove[0].factMappingIndex,
-          allFactMappingWithIndexesToRemove.length
-        );
-
-        /* Cloning the Scenario List (Rows) and finding the Cell(s) to remove accordingly to the factMapping data of 
-          the removed columns */
-        const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse(
-          JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground) ?? [])
-        );
-        deepClonedRowsData.forEach((rowData) => {
-          allFactMappingWithIndexesToRemove.forEach((itemToRemove) => {
-            const factMappingValueColumnIndexToRemove = retrieveFactMappingValueIndexByIdentifiers(
-              rowData.factMappingValues.FactMappingValue!,
-              itemToRemove.factMapping!.factIdentifier,
-              itemToRemove.factMapping!.expressionIdentifier
-            )!;
-
-            return {
-              factMappingValues: {
-                FactMappingValue: rowData.factMappingValues.FactMappingValue!.splice(
-                  factMappingValueColumnIndexToRemove,
-                  1
-                ),
-              },
-            };
-          });
+      /* GIVEN and EXPECTED of FIELD and INSTANCE column types can be added only */
+      if (
+        TestScenarioTableColumnFieldGroup.OTHER === args.groupType ||
+        TestScenarioTableColumnHeaderGroup.EXPECT === args.groupType ||
+        TestScenarioTableColumnHeaderGroup.GIVEN === args.groupType
+      ) {
+        console.error("Can't add a " + args.groupType + " type column.");
+        return;
+      }

Review Comment:
   Fixed



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799567479


##########
packages/scesim-editor/src/mutations/updateColumnWidth.ts:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { SceSim__FactMappingType } from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function updateColumnWidth({
+  factMappings,
+  inputIndex,

Review Comment:
   I Agree, 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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1796055612


##########
packages/scesim-editor/src/drawer/TestScenarioDrawerDataSelectorPanel.tsx:
##########
@@ -392,115 +393,92 @@ function TestScenarioDataSelectorPanel({
   // CHECK
   const onInsertDataObjectClick = useCallback(
     /** TODO 2 : NEED A POPUP ASKING IF WE WANT TO REPLACE VALUES OR NOT */
-
     () => {
-      updateTestScenarioModel((prevState) => {
-        const isBackground = selectedColumnMetadata!.isBackground;
-        const factMappings = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings
-          .FactMapping!;
-        const deepClonedFactMappings = JSON.parse(JSON.stringify(factMappings));
-        const isRootType = isDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString());
-        const rootDataObject = findDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString());
-
-        const className = treeViewStatus.activeItems[0].customBadgeContent!.toString();
-        const expressionAlias = isRootType ? "Expression </>" : treeViewStatus.activeItems[0].name!.toString();
-        const expressionElementsSteps = treeViewStatus.activeItems[0].id!.split(".").filter((step) => !!step.trim()); //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS
-        const factName = treeViewStatus.activeItems[0].id!.split(".")[0]; //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS
-        const factClassName = isRootType
-          ? treeViewStatus.activeItems[0].customBadgeContent!.toString()
-          : rootDataObject.customBadgeContent!.toString();
-        const factMappingValueType = isRootType
-          ? TEST_SCENARIO_EXPRESSION_TYPE[TEST_SCENARIO_EXPRESSION_TYPE.EXPRESSION]
-          : TEST_SCENARIO_EXPRESSION_TYPE[TEST_SCENARIO_EXPRESSION_TYPE.NOT_EXPRESSION];
-
-        const factMappingToUpdate: SceSim__FactMappingType = deepClonedFactMappings[selectedColumnMetadata!.index];
-        factMappingToUpdate.className = { __$$text: className };
-        factMappingToUpdate.factAlias = { __$$text: factName };
-        factMappingToUpdate.factIdentifier.className = { __$$text: factClassName };
-        factMappingToUpdate.factIdentifier.name = { __$$text: factName };
-        factMappingToUpdate.factMappingValueType = { __$$text: factMappingValueType };
-        factMappingToUpdate.expressionAlias = { __$$text: expressionAlias };
-        factMappingToUpdate.expressionElements = {
-          ExpressionElement: expressionElementsSteps.map((ee) => {
-            return { step: { __$$text: ee } };
-          }),
-        };
+      const isBackground = selectedColumnMetadata!.isBackground;
+      const factMappings = retrieveModelDescriptor(state.scesim.model.ScenarioSimulationModel, isBackground)
+        .factMappings.FactMapping!;
+      const deepClonedFactMappings = JSON.parse(JSON.stringify(factMappings));
+      const isRootType = isDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString());
+      const rootDataObject = findDataObjectRootParent(dataObjects, treeViewStatus.activeItems[0].id!.toString());
+
+      const className = treeViewStatus.activeItems[0].customBadgeContent!.toString();
+      const expressionAlias = isRootType ? "Expression </>" : treeViewStatus.activeItems[0].name!.toString();
+      const expressionElementsSteps = treeViewStatus.activeItems[0].id!.split(".").filter((step) => !!step.trim()); //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS
+      const factName = treeViewStatus.activeItems[0].id!.split(".")[0]; //WARNING !!!! THIS DOESN'T WORK WITH IMPORTED DATA OBJECTS
+      const factClassName = isRootType
+        ? treeViewStatus.activeItems[0].customBadgeContent!.toString()
+        : rootDataObject.customBadgeContent!.toString();
+      const factMappingValueType = isRootType
+        ? TEST_SCENARIO_EXPRESSION_TYPE[TEST_SCENARIO_EXPRESSION_TYPE.EXPRESSION]
+        : TEST_SCENARIO_EXPRESSION_TYPE[TEST_SCENARIO_EXPRESSION_TYPE.NOT_EXPRESSION];
+
+      const factMappingToUpdate: SceSim__FactMappingType = deepClonedFactMappings[selectedColumnMetadata!.index];
+      factMappingToUpdate.className = { __$$text: className };
+      factMappingToUpdate.factAlias = { __$$text: factName };
+      factMappingToUpdate.factIdentifier.className = { __$$text: factClassName };
+      factMappingToUpdate.factIdentifier.name = { __$$text: factName };
+      factMappingToUpdate.factMappingValueType = { __$$text: factMappingValueType };
+      factMappingToUpdate.expressionAlias = { __$$text: expressionAlias };
+      factMappingToUpdate.expressionElements = {
+        ExpressionElement: expressionElementsSteps.map((ee) => {
+          return { step: { __$$text: ee } };
+        }),
+      };
+
+      const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse(
+        JSON.stringify(retrieveRowsDataFromModel(state.scesim.model.ScenarioSimulationModel, isBackground))
+      );

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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#issuecomment-2405980303

   @tiagobento Ready for another round :)


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799604391


##########
packages/scesim-editor/src/mutations/addColumn.ts:
##########
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import _ from "lodash";
+import { v4 as uuid } from "uuid";
+
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+import { InsertRowColumnsDirection } from "@kie-tools/boxed-expression-component/dist/api/BeeTable";
+
+export function addColumn({
+  beforeIndex,

Review Comment:
   Sure.
   The BEE table UI allows you to add a column both on the right or on the left.
   <img width="338" alt="Screenshot 2024-10-14 at 16 14 10" src="https://github.com/user-attachments/assets/093c7457-2869-4b36-9189-5ec1d4620eaa">
   `insertDirection` gives you exactly that information, in detail, the possible values are   `AboveOrRight`,
     `BelowOrLeft`
   The addColumn mutation function requires both information to correctly persist the new column in the scesim file.
   



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799559692


##########
packages/scesim-editor/src/mutations/deleteColumn.ts:
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import _, { isNumber } from "lodash";
+import {
+  SceSim__FactMappingType,
+  SceSim__FactMappingValuesTypes,
+} from "@kie-tools/scesim-marshaller/dist/schemas/scesim-1_8/ts-gen/types";
+
+export function deleteColumn({
+  factMappingIndexToRemove,
+  factMappings,
+  factMappingValues,
+  isBackground,
+  isInstance,
+  selectedColumnIndex,
+}: {
+  factMappingIndexToRemove: number;
+  factMappings: SceSim__FactMappingType[];
+  factMappingValues: SceSim__FactMappingValuesTypes[];
+  isBackground: boolean;
+  isInstance: boolean;
+  selectedColumnIndex: number;
+}): {
+  deletedFactMappingIndexs: number[];
+} {
+  /* Retriving the FactMapping (Column) to be removed). If the user selected a single column, it finds the exact
+       FactMapping to delete. If the user selected an instance (group of columns), it retrives all the FactMappings
+       that belongs to the the instance group */
+  const factMappingToRemove = factMappings[factMappingIndexToRemove];
+  const groupType = factMappingToRemove.expressionIdentifier.type!.__$$text;
+  const instanceName = factMappingToRemove.factIdentifier.name!.__$$text;
+  const instanceType = factMappingToRemove.factIdentifier.className!.__$$text;
+
+  const allFactMappingWithIndexesToRemove = isInstance
+    ? factMappings
+        .map((factMapping, index) => {
+          if (
+            factMapping.expressionIdentifier.type!.__$$text === groupType &&
+            factMapping.factIdentifier.name?.__$$text === instanceName &&
+            factMapping.factIdentifier.className?.__$$text === instanceType
+          ) {
+            return { factMappingIndex: index, factMapping: factMapping };
+          } else {
+            return {};
+          }
+        })
+        .filter((item) => isNumber(item.factMappingIndex))
+    : [{ factMappingIndex: selectedColumnIndex + (isBackground ? 0 : 1), factMapping: factMappingToRemove }];
+
+  factMappings.splice(allFactMappingWithIndexesToRemove[0].factMappingIndex!, allFactMappingWithIndexesToRemove.length);
+
+  factMappingValues.forEach((rowData) => {
+    allFactMappingWithIndexesToRemove.forEach((itemToRemove) => {
+      const factMappingValueColumnIndexToRemove = rowData.factMappingValues.FactMappingValue!.findIndex(
+        (factMappingValue) =>
+          factMappingValue.factIdentifier.name?.__$$text == itemToRemove.factMapping!.factIdentifier.name?.__$$text &&
+          factMappingValue.factIdentifier.className?.__$$text ==
+            itemToRemove.factMapping!.factIdentifier.className?.__$$text &&
+          factMappingValue.expressionIdentifier.name?.__$$text ==
+            itemToRemove.factMapping!.expressionIdentifier.name?.__$$text &&
+          factMappingValue.expressionIdentifier.type?.__$$text ==
+            itemToRemove.factMapping!.expressionIdentifier.type?.__$$text

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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799574409


##########
packages/scesim-editor/src/TestScenarioEditor.tsx:
##########
@@ -127,174 +114,59 @@ export type TestScenarioSelectedColumnMetaData = {
   isBackground: boolean;
 };
 
-function TestScenarioMainPanel({
-  fileName,
-  scesimModel,
-  updateSettingField,
-  updateTestScenarioModel,
-}: {
-  fileName: string;
-  scesimModel: { ScenarioSimulationModel: SceSim__ScenarioSimulationModelType };
-  updateSettingField: (field: string, value: string) => void;
-  updateTestScenarioModel: React.Dispatch<React.SetStateAction<SceSimModel>>;
-}) {
+function TestScenarioMainPanel({ fileName }: { fileName: string }) {
   const { i18n } = useTestScenarioEditorI18n();
-
-  const [alert, setAlert] = useState<TestScenarioAlert>({ enabled: false, variant: "info" });
-  const [dataObjects, setDataObjects] = useState<TestScenarioDataObject[]>([]);
-  const [dockPanel, setDockPanel] = useState({ isOpen: true, selected: TestScenarioEditorDock.DATA_OBJECT });
-  const [selectedColumnMetadata, setSelectedColumnMetaData] = useState<TestScenarioSelectedColumnMetaData | null>(null);
-  const [tab, setTab] = useState(TestScenarioEditorTab.EDITOR);
+  const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi();
+  const navigation = useTestScenarioEditorStore((s) => s.navigation);
+  const scesimModel = useTestScenarioEditorStore((s) => s.scesim.model);
+  const isAlertEnabled = true; // Will be managed in kie-issue#970
+  const testScenarioType = scesimModel.ScenarioSimulationModel.settings.type?.__$$text.toUpperCase();
 
   const scenarioTableScrollableElementRef = useRef<HTMLDivElement | null>(null);
   const backgroundTableScrollableElementRef = useRef<HTMLDivElement | null>(null);
 
-  const onTabChanged = useCallback((_event, tab) => {
-    setSelectedColumnMetaData(null);
-    setTab(tab);
-  }, []);
-
-  const closeDockPanel = useCallback(() => {
-    setDockPanel((prev) => {
-      return { ...prev, isOpen: false };
-    });
-  }, []);
-
-  const openDockPanel = useCallback((selected: TestScenarioEditorDock) => {
-    setDockPanel({ isOpen: true, selected: selected });
-  }, []);
-
-  useEffect(() => {
-    setDockPanel({ isOpen: true, selected: TestScenarioEditorDock.DATA_OBJECT });
-    setSelectedColumnMetaData(null);
-    setTab(TestScenarioEditorTab.EDITOR);
-  }, [fileName]);
-
-  /** This is TEMPORARY */
-  useEffect(() => {
-    /* To create the Data Object arrays we need an external source, in details: */
-    /* DMN Data: Retrieving DMN type from linked DMN file */
-    /* Java classes: Retrieving Java classes info from the user projects */
-    /* At this time, none of the above are supported */
-    /* Therefore, it tries to retrieve these info from the SCESIM file, if are present */
-
-    /* Retriving Data Object from the scesim file.       
-       That makes sense for previously created scesim files */
-
-    const factsMappings: SceSim__FactMappingType[] =
-      scesimModel.ScenarioSimulationModel.simulation.scesimModelDescriptor.factMappings.FactMapping ?? [];
-
-    const dataObjects: TestScenarioDataObject[] = [];
-
-    /* The first two FactMapping are related to the "Number" and "Description" columns. 
-       If those columns only are present, no Data Objects can be detected in the scesim file */
-    for (let i = 2; i < factsMappings.length; i++) {
-      if (factsMappings[i].className!.__$$text === "java.lang.Void") {
-        continue;
-      }
-      const factID = factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text;
-      const dataObject = dataObjects.find((value) => value.id === factID);
-      const isSimpleTypeFact = factsMappings[i].expressionElements!.ExpressionElement!.length == 1;
-      const propertyID = isSimpleTypeFact //POTENTIAL BUG
-        ? factsMappings[i].expressionElements!.ExpressionElement![0].step.__$$text.concat(".")
-        : factsMappings[i]
-            .expressionElements!.ExpressionElement!.map((expressionElement) => expressionElement.step.__$$text)
-            .join(".");
-      const propertyName = isSimpleTypeFact
-        ? "value"
-        : factsMappings[i].expressionElements!.ExpressionElement!.slice(-1)[0].step.__$$text;
-      if (dataObject) {
-        if (!dataObject.children?.some((value) => value.id === propertyID)) {
-          dataObject.children!.push({
-            id: propertyID,
-            customBadgeContent: factsMappings[i].className.__$$text,
-            isSimpleTypeFact: isSimpleTypeFact,
-            name: propertyName,
-          });
-        }
-      } else {
-        dataObjects.push({
-          id: factID,
-          name: factsMappings[i].factAlias!.__$$text,
-          customBadgeContent: factsMappings[i].factIdentifier!.className!.__$$text,
-          children: [
-            {
-              id: propertyID,
-              name: propertyName,
-              customBadgeContent: factsMappings[i].className.__$$text,
-            },
-          ],
-        });
-      }
-    }
-
-    setDataObjects(dataObjects);
-  }, [scesimModel.ScenarioSimulationModel.settings.type]);
-
-  /** It determines the Alert State */
-  useEffect(() => {
-    const assetType = scesimModel.ScenarioSimulationModel.settings.type!.__$$text;
-
-    let alertEnabled = false;
-    let alertMessage = "";
-    let alertVariant: "default" | "danger" | "warning" | "info" | "success" = "danger";
-
-    if (dataObjects.length > 0) {
-      alertMessage =
-        assetType === TestScenarioType[TestScenarioType.DMN]
-          ? i18n.alerts.dmnDataRetrievedFromScesim
-          : i18n.alerts.ruleDataRetrievedFromScesim;
-      alertEnabled = true;
-    } else {
-      alertMessage =
-        assetType === TestScenarioType[TestScenarioType.DMN]
-          ? i18n.alerts.dmnDataNotAvailable
-          : i18n.alerts.ruleDataNotAvailable;
-      alertVariant = assetType === TestScenarioType[TestScenarioType.DMN] ? "warning" : "danger";
-      alertEnabled = true;
-    }
+  const onTabChanged = useCallback(
+    (_event, tab) => {
+      testScenarioEditorStoreApi.setState((state) => {
+        state.navigation.tab = tab;
+      });
+    },
+    [testScenarioEditorStoreApi]
+  );
 
-    setAlert({ enabled: alertEnabled, message: alertMessage, variant: alertVariant });
-  }, [dataObjects, i18n, scesimModel.ScenarioSimulationModel.settings.type]);
+  const showDockPanel = useCallback(
+    (show: boolean) => {
+      testScenarioEditorStoreApi.setState((state) => {
+        state.navigation.dock.isOpen = show;
+      });
+    },
+    [testScenarioEditorStoreApi]
+  );
 
   return (
     <>
       <div className="kie-scesim-editor--content">
-        <Drawer isExpanded={dockPanel.isOpen} isInline={true} position={"right"}>
+        <Drawer isExpanded={navigation.dock.isOpen} isInline={true} position={"right"}>
           <DrawerContent
-            panelContent={
-              <TestScenarioDrawerPanel
-                dataObjects={dataObjects}
-                fileName={fileName}
-                onDrawerClose={closeDockPanel}
-                onUpdateSettingField={updateSettingField}
-                scesimModel={scesimModel}
-                selectedColumnMetaData={selectedColumnMetadata}
-                selectedDock={dockPanel.selected}
-                testScenarioSettings={{
-                  assetType: scesimModel.ScenarioSimulationModel.settings!.type!.__$$text,
-                  dmnName: scesimModel.ScenarioSimulationModel.settings!.dmnName?.__$$text,
-                  dmnNamespace: scesimModel.ScenarioSimulationModel.settings!.dmnNamespace?.__$$text,
-                  isStatelessSessionRule: scesimModel.ScenarioSimulationModel.settings!.stateless?.__$$text ?? false,
-                  isTestSkipped: scesimModel.ScenarioSimulationModel.settings!.skipFromBuild?.__$$text ?? false,
-                  kieSessionRule: scesimModel.ScenarioSimulationModel.settings!.dmoSession?.__$$text,
-                  ruleFlowGroup: scesimModel.ScenarioSimulationModel.settings!.ruleFlowGroup?.__$$text,
-                }}
-                updateSelectedColumnMetaData={setSelectedColumnMetaData}
-                updateTestScenarioModel={updateTestScenarioModel}
-              />
-            }
+            panelContent={<TestScenarioDrawerPanel fileName={fileName} onDrawerClose={() => showDockPanel(false)} />}
           >
             <DrawerContentBody>
-              {alert.enabled && (
+              {isAlertEnabled && (
                 <div className="kie-scesim-editor--content-alert">
-                  <Alert variant={alert.variant} title={alert.message} />
+                  <Alert
+                    variant={testScenarioType === "DMN" ? "warning" : "danger"}

Review Comment:
   It's just a temporary choice and will change in a future PR



##########
packages/scesim-marshaller/src/schemas/scesim-1_8/SceSim.xsd:
##########
@@ -1,3 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+    http://www.apache.org/licenses/LICENSE-2.0
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
 <xsd:schema

Review Comment:
   Yeah!



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799639349


##########
packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx:
##########
@@ -33,36 +34,49 @@ import { Tooltip } from "@patternfly/react-core/dist/js/components/Tooltip";
 import AddIcon from "@patternfly/react-icons/dist/esm/icons/add-circle-o-icon";
 import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon";
 
-import { TestScenarioType } from "../TestScenarioEditor";
+import { useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext";
 import { useTestScenarioEditorI18n } from "../i18n";
 
 import "./TestScenarioCreationPanel.css";
 
-function TestScenarioCreationPanel({
-  onCreateScesimButtonClicked,
-}: {
-  onCreateScesimButtonClicked: (
-    assetType: string,
-    isStatelessSessionRule: boolean,
-    isTestSkipped: boolean,
-    kieSessionRule: string,
-    ruleFlowGroup: string
-  ) => void;
-}) {
+function TestScenarioCreationPanel() {
   const { i18n } = useTestScenarioEditorI18n();
 
   const assetsOption = [
     { value: "", label: i18n.creationPanel.assetsOption.noChoice, disabled: true },
-    { value: TestScenarioType[TestScenarioType.DMN], label: i18n.creationPanel.assetsOption.dmn, disabled: false },
-    { value: TestScenarioType[TestScenarioType.RULE], label: i18n.creationPanel.assetsOption.rule, disabled: false },
+    { value: "DMN", label: i18n.creationPanel.assetsOption.dmn, disabled: false },
+    { value: "RULE", label: i18n.creationPanel.assetsOption.rule, disabled: false },
   ];
 
-  const [assetType, setAssetType] = React.useState("");
+  const [assetType, setAssetType] = React.useState<"" | "DMN" | "RULE">("");
   const [isAutoFillTableEnabled, setAutoFillTableEnabled] = React.useState(true);
   const [isStatelessSessionRule, setStatelessSessionRule] = React.useState(false);
   const [isTestSkipped, setTestSkipped] = React.useState(false);
   const [kieSessionRule, setKieSessionRule] = React.useState("");
   const [ruleFlowGroup, setRuleFlowGroup] = React.useState("");
+  const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi();
+
+  const createTestScenario = useCallback(
+    (
+      assetType: string,
+      isStatelessSessionRule: boolean,
+      isTestSkipped: boolean,
+      kieSessionRule: string,
+      ruleFlowGroup: string
+    ) =>
+      testScenarioEditorStoreApi.setState((state) => {
+        const settings = state.scesim.model.ScenarioSimulationModel.settings;
+        settings.dmnFilePath = assetType === "DMN" ? { __$$text: "./MockedDMNName.dmn" } : undefined;
+        settings.dmnName = assetType === "DMN" ? { __$$text: "MockedDMNName.dmn" } : undefined;
+        settings.dmnNamespace = assetType === "DMN" ? { __$$text: "https:\\kiegroup" } : undefined;

Review Comment:
   maybe this is not correct, once I create new DMN, I see namespace value as "https:\kiegroup"



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1800557650


##########
packages/scesim-editor/src/table/TestScenarioTable.tsx:
##########
@@ -833,127 +580,54 @@ function TestScenarioTable({
    */
   const onColumnDeleted = useCallback(
     (args: { columnIndex: number; groupType: string }) => {
-      updateTestScenarioModel((prevState) => {
-        const isInstance =
-          args.groupType === TestScenarioTableColumnInstanceGroup.EXPECT ||
-          args.groupType === TestScenarioTableColumnInstanceGroup.GIVEN;
-
-        const factMappings = retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings
-          .FactMapping!;
-        const columnIndexToRemove = determineSelectedColumnIndex(factMappings, args.columnIndex + 1, isInstance);
-
-        /* Retriving the FactMapping (Column) to be removed). If the user selected a single column, it finds the exact
-           FactMapping to delete. If the user selected an instance (group of columns), it retrives all the FactMappings
-           that belongs to the the instance group */
-        const factMappingToRemove = factMappings[columnIndexToRemove];
-        const groupType = factMappingToRemove.expressionIdentifier.type!.__$$text;
-        const instanceName = factMappingToRemove.factIdentifier.name!.__$$text;
-        const instanceType = factMappingToRemove.factIdentifier.className!.__$$text;
-
-        const allFactMappingWithIndexesToRemove = isInstance
-          ? factMappings
-              .map((factMapping, index) => {
-                if (
-                  factMapping.expressionIdentifier.type!.__$$text === groupType &&
-                  factMapping.factIdentifier.name?.__$$text === instanceName &&
-                  factMapping.factIdentifier.className?.__$$text === instanceType
-                ) {
-                  return { factMappingIndex: index, factMapping: factMapping };
-                } else {
-                  return {};
-                }
-              })
-              .filter((item) => isNumber(item.factMappingIndex))
-          : [{ factMappingIndex: args.columnIndex + columnIndexStart, factMapping: factMappingToRemove }];
-
-        /* Cloning the FactMappings list (Columns) and and removing the FactMapping (Column) at given index */
-        const deepClonedFactMappings = JSON.parse(
-          JSON.stringify(
-            retrieveModelDescriptor(prevState.ScenarioSimulationModel, isBackground).factMappings.FactMapping
-          )
-        );
-        deepClonedFactMappings.splice(
-          allFactMappingWithIndexesToRemove[0].factMappingIndex,
-          allFactMappingWithIndexesToRemove.length
-        );
-
-        /* Cloning the Scenario List (Rows) and finding the Cell(s) to remove accordingly to the factMapping data of 
-          the removed columns */
-        const deepClonedRowsData: SceSim__FactMappingValuesTypes[] = JSON.parse(
-          JSON.stringify(retrieveRowsDataFromModel(prevState.ScenarioSimulationModel, isBackground) ?? [])
-        );
-        deepClonedRowsData.forEach((rowData) => {
-          allFactMappingWithIndexesToRemove.forEach((itemToRemove) => {
-            const factMappingValueColumnIndexToRemove = retrieveFactMappingValueIndexByIdentifiers(
-              rowData.factMappingValues.FactMappingValue!,
-              itemToRemove.factMapping!.factIdentifier,
-              itemToRemove.factMapping!.expressionIdentifier
-            )!;
-
-            return {
-              factMappingValues: {
-                FactMappingValue: rowData.factMappingValues.FactMappingValue!.splice(
-                  factMappingValueColumnIndexToRemove,
-                  1
-                ),
-              },
-            };
-          });
+      /* GIVEN and EXPECTED of FIELD and INSTANCE column types can be deleted only */
+      if (
+        TestScenarioTableColumnFieldGroup.OTHER === args.groupType ||
+        TestScenarioTableColumnHeaderGroup.EXPECT === args.groupType ||
+        TestScenarioTableColumnHeaderGroup.GIVEN === args.groupType
+      ) {
+        console.error("Can't add a " + args.groupType + " type column.");

Review Comment:
   ```suggestion
           console.error("Can't delete a " + args.groupType + " type column.");
   ```



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#issuecomment-2411550437

   @jomarko Yeah, let me explain. 
   In DMN-based scesim, a type can be assigned only one time. So, if you assign a type in a column, that type will not more available in the Data Object list.
   In RULE-based, this restriction shouldn't be present, which means, the same column can be present in both GIVEN and EXPECT groups. So, you've raised a proper issue.
   The point is, at this moment the focus is on the DMN-based scenario only, so we can postpone it. Just mention it in this epic https://github.com/apache/incubator-kie-issues/issues/1363, (IIRC, Kennedy already reported that)


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799681800


##########
packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx:
##########
@@ -33,36 +34,49 @@ import { Tooltip } from "@patternfly/react-core/dist/js/components/Tooltip";
 import AddIcon from "@patternfly/react-icons/dist/esm/icons/add-circle-o-icon";
 import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon";
 
-import { TestScenarioType } from "../TestScenarioEditor";
+import { useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext";
 import { useTestScenarioEditorI18n } from "../i18n";
 
 import "./TestScenarioCreationPanel.css";
 
-function TestScenarioCreationPanel({
-  onCreateScesimButtonClicked,
-}: {
-  onCreateScesimButtonClicked: (
-    assetType: string,
-    isStatelessSessionRule: boolean,
-    isTestSkipped: boolean,
-    kieSessionRule: string,
-    ruleFlowGroup: string
-  ) => void;
-}) {
+function TestScenarioCreationPanel() {
   const { i18n } = useTestScenarioEditorI18n();
 
   const assetsOption = [
     { value: "", label: i18n.creationPanel.assetsOption.noChoice, disabled: true },
-    { value: TestScenarioType[TestScenarioType.DMN], label: i18n.creationPanel.assetsOption.dmn, disabled: false },
-    { value: TestScenarioType[TestScenarioType.RULE], label: i18n.creationPanel.assetsOption.rule, disabled: false },
+    { value: "DMN", label: i18n.creationPanel.assetsOption.dmn, disabled: false },
+    { value: "RULE", label: i18n.creationPanel.assetsOption.rule, disabled: false },
   ];
 
-  const [assetType, setAssetType] = React.useState("");
+  const [assetType, setAssetType] = React.useState<"" | "DMN" | "RULE">("");
   const [isAutoFillTableEnabled, setAutoFillTableEnabled] = React.useState(true);
   const [isStatelessSessionRule, setStatelessSessionRule] = React.useState(false);
   const [isTestSkipped, setTestSkipped] = React.useState(false);
   const [kieSessionRule, setKieSessionRule] = React.useState("");
   const [ruleFlowGroup, setRuleFlowGroup] = React.useState("");
+  const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi();
+
+  const createTestScenario = useCallback(
+    (
+      assetType: string,
+      isStatelessSessionRule: boolean,
+      isTestSkipped: boolean,
+      kieSessionRule: string,
+      ruleFlowGroup: string
+    ) =>
+      testScenarioEditorStoreApi.setState((state) => {
+        const settings = state.scesim.model.ScenarioSimulationModel.settings;
+        settings.dmnFilePath = assetType === "DMN" ? { __$$text: "./MockedDMNName.dmn" } : undefined;
+        settings.dmnName = assetType === "DMN" ? { __$$text: "MockedDMNName.dmn" } : undefined;
+        settings.dmnNamespace = assetType === "DMN" ? { __$$text: "https:\\kiegroup" } : undefined;

Review Comment:
   @jomarko It's a temporary mockup, in a PR will be correctly managed (like all the above parameters)



-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on code in PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#discussion_r1799013517


##########
packages/scesim-editor/src/creation/TestScenarioCreationPanel.tsx:
##########
@@ -33,36 +34,49 @@ import { Tooltip } from "@patternfly/react-core/dist/js/components/Tooltip";
 import AddIcon from "@patternfly/react-icons/dist/esm/icons/add-circle-o-icon";
 import CubesIcon from "@patternfly/react-icons/dist/esm/icons/cubes-icon";
 
-import { TestScenarioType } from "../TestScenarioEditor";
+import { useTestScenarioEditorStoreApi } from "../store/TestScenarioStoreContext";
 import { useTestScenarioEditorI18n } from "../i18n";
 
 import "./TestScenarioCreationPanel.css";
 
-function TestScenarioCreationPanel({
-  onCreateScesimButtonClicked,
-}: {
-  onCreateScesimButtonClicked: (
-    assetType: string,
-    isStatelessSessionRule: boolean,
-    isTestSkipped: boolean,
-    kieSessionRule: string,
-    ruleFlowGroup: string
-  ) => void;
-}) {
+function TestScenarioCreationPanel() {
   const { i18n } = useTestScenarioEditorI18n();
 
   const assetsOption = [
     { value: "", label: i18n.creationPanel.assetsOption.noChoice, disabled: true },
-    { value: TestScenarioType[TestScenarioType.DMN], label: i18n.creationPanel.assetsOption.dmn, disabled: false },
-    { value: TestScenarioType[TestScenarioType.RULE], label: i18n.creationPanel.assetsOption.rule, disabled: false },
+    { value: "DMN", label: i18n.creationPanel.assetsOption.dmn, disabled: false },
+    { value: "RULE", label: i18n.creationPanel.assetsOption.rule, disabled: false },
   ];
 
-  const [assetType, setAssetType] = React.useState("");
+  const [assetType, setAssetType] = React.useState<"" | "DMN" | "RULE">("");
   const [isAutoFillTableEnabled, setAutoFillTableEnabled] = React.useState(true);
   const [isStatelessSessionRule, setStatelessSessionRule] = React.useState(false);
   const [isTestSkipped, setTestSkipped] = React.useState(false);
   const [kieSessionRule, setKieSessionRule] = React.useState("");
   const [ruleFlowGroup, setRuleFlowGroup] = React.useState("");
+  const testScenarioEditorStoreApi = useTestScenarioEditorStoreApi();
+
+  const createTestScenario = useCallback(
+    (
+      assetType: string,
+      isStatelessSessionRule: boolean,
+      isTestSkipped: boolean,
+      kieSessionRule: string,
+      ruleFlowGroup: string
+    ) =>
+      testScenarioEditorStoreApi.setState((state) => {
+        const settings = state.scesim.model.ScenarioSimulationModel.settings;
+        settings.dmnFilePath = assetType === "DMN" ? { __$$text: "./MockedDMNName.dmn" } : undefined;
+        settings.dmnName = assetType === "DMN" ? { __$$text: "MockedDMNName.dmn" } : undefined;
+        settings.dmnNamespace = assetType === "DMN" ? { __$$text: "https:\\kiegroup" } : undefined;
+        (settings.dmoSession = assetType === "RULE" && kieSessionRule ? { __$$text: kieSessionRule } : undefined),
+          (settings.ruleFlowGroup = assetType === "RULE" && ruleFlowGroup ? { __$$text: ruleFlowGroup } : undefined),
+          (settings.skipFromBuild = { __$$text: isTestSkipped }),
+          (settings.stateless = assetType === "RULE" ? { __$$text: isStatelessSessionRule } : undefined),
+          (settings.type = { __$$text: assetType });

Review Comment:
   Fixed, 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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#issuecomment-2410495862

   @jomarko The table UX should be considered completed (and well covered by e2e test provided by @kbowers-ibm). There are some KI identified here https://github.com/apache/incubator-kie-issues/issues/453. 
   The setting dock is completed too. The selector of data object works with simple cases, this still need to be extended with more complex cases. 


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] kie-issues#1463: Test Scenario Editor: Manage `@kie-tools/scesim-editor`'s state with Zustand + Immer [incubator-kie-tools]

Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #2628:
URL: https://github.com/apache/incubator-kie-tools/pull/2628#issuecomment-2423670545

   Finally green!!


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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