This is an automated email from the ASF dual-hosted git repository.
tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new bcb3880f468 kie-issues#1459: Decision and BKM nodes properties cannot
be edited from inside BEE due to focus being lost after a character is typed
(#2902)
bcb3880f468 is described below
commit bcb3880f468001da849f256e61188cf98c8166c9
Author: Kusuma04-dev <[email protected]>
AuthorDate: Wed Mar 26 20:14:59 2025 +0530
kie-issues#1459: Decision and BKM nodes properties cannot be edited from
inside BEE due to focus being lost after a character is typed (#2902)
---
.../src/propertiesPanel/BkmProperties.tsx | 33 ++++----
.../DecisionTableInputHeaderCell.tsx | 2 +-
.../DecisionTableInputRuleCell.tsx | 2 +-
.../DecisionTableOutputHeaderCell.tsx | 2 +-
.../DecisionTableOutputRuleCell.tsx | 2 +-
.../DecisionTableRootCell.tsx | 2 +-
.../ExpressionRootCell.tsx | 2 +-
.../FunctionDefinitionParametersCell.tsx | 2 +-
.../FunctionDefinitionRootCell.tsx | 2 +-
.../InformationItemCell.tsx | 2 +-
.../InvocationFunctionCallCell.tsx | 2 +-
.../IteratorVariableCell.tsx | 2 +-
.../LiteralExpressionContentCell.tsx | 2 +-
.../src/propertiesPanel/DecisionProperties.tsx | 98 ++++++++++------------
.../Fields.tsx | 8 +-
.../propertiesPanel/bee/bkmPropertiesPanel.ts | 48 +++++++++++
.../propertiesPanel/bee/decisionPropertiesPanel.ts | 65 ++++++++++++++
.../propertiesPanel/beePropertiesPanel.ts | 6 ++
.../propertiesPanel/decisionPropertiesPanel.ts | 16 ++--
.../parts/allowedAnswersProperties.ts | 33 ++++++++
.../propertiesPanel/parts/questionProperties.ts | 33 ++++++++
.../drgElements/changeBkmProperties.spec.ts | 14 ++++
.../drgElements/changeDecisionProperties.spec.ts | 24 ++++++
23 files changed, 306 insertions(+), 96 deletions(-)
diff --git a/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx
b/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx
index 884565ba3d9..fa83bcf2299 100644
--- a/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx
+++ b/packages/dmn-editor/src/propertiesPanel/BkmProperties.tsx
@@ -22,7 +22,6 @@ import { DMN15__tBusinessKnowledgeModel } from
"@kie-tools/dmn-marshaller/dist/s
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
import { ClipboardCopy } from
"@patternfly/react-core/dist/js/components/ClipboardCopy";
import { FormGroup } from "@patternfly/react-core/dist/js/components/Form";
-import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea";
import { DocumentationLinksFormGroup } from "./DocumentationLinksFormGroup";
import { TypeRefSelector } from "../dataTypes/TypeRefSelector";
import { useDmnEditorStore, useDmnEditorStoreApi } from
"../store/StoreContext";
@@ -33,6 +32,7 @@ import { useCallback, useMemo } from "react";
import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api";
import { useSettings } from "../settings/DmnEditorSettingsContext";
import { useRefactor } from "../refactor/RefactorConfirmationDialog";
+import { TextField, TextFieldType } from "./Fields";
export function BkmProperties({
bkm,
@@ -98,26 +98,21 @@ export function BkmProperties({
/>
</FormGroup>
- <FormGroup label="Description">
- <TextArea
- aria-label={"Description"}
- type={"text"}
- isDisabled={isReadOnly}
- value={bkm.description?.__$$text}
- onChange={(newDescription) => {
- setState((state) => {
- (
- state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tBusinessKnowledgeModel>
- ).description = {
+ <TextField
+ title={"Description"}
+ type={TextFieldType.TEXT_AREA}
+ isReadOnly={isReadOnly}
+ initialValue={bkm.description?.__$$text || ""}
+ onChange={(newDescription) => {
+ setState((state) => {
+ (state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tBusinessKnowledgeModel>).description =
+ {
__$$text: newDescription,
};
- });
- }}
- placeholder={"Enter a description..."}
- style={{ resize: "vertical", minHeight: "40px" }}
- rows={6}
- />
- </FormGroup>
+ });
+ }}
+ placeholder={"Enter a description..."}
+ />
<FormGroup label="ID">
<ClipboardCopy isReadOnly={true} hoverTip="Copy" clickTip="Copied">
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx
index 7dbe7d13a1f..5759e3d203a 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputHeaderCell.tsx
@@ -20,7 +20,7 @@
import * as React from "react";
import { useCallback, useMemo, useState } from "react";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
-import { ContentField, DescriptionField, ExpressionLanguageField, NameField,
TypeRefField } from "./Fields";
+import { ContentField, DescriptionField, ExpressionLanguageField, NameField,
TypeRefField } from "../Fields";
import { FormGroup, FormSection } from
"@patternfly/react-core/dist/js/components/Form";
import { DMN15__tInputClause } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx
index c7b49b928df..6ddc047c54e 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableInputRuleCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { DescriptionField, ExpressionLanguageField, TypeRefField } from
"./Fields";
+import { DescriptionField, ExpressionLanguageField, TypeRefField } from
"../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { DMN15__tDecisionTable, DMN15__tUnaryTests } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx
index b2833303ca7..8f33e76745b 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputHeaderCell.tsx
@@ -20,7 +20,7 @@
import * as React from "react";
import { useCallback, useMemo, useState } from "react";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
-import { ContentField, DescriptionField, ExpressionLanguageField, NameField,
TypeRefField } from "./Fields";
+import { ContentField, DescriptionField, ExpressionLanguageField, NameField,
TypeRefField } from "../Fields";
import { FormGroup, FormSection } from
"@patternfly/react-core/dist/js/components/Form";
import { DMN15__tDecision, DMN15__tOutputClause } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx
index c65bad38d39..163afaf7506 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableOutputRuleCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { DescriptionField, ExpressionLanguageField, TypeRefField } from
"./Fields";
+import { DescriptionField, ExpressionLanguageField, TypeRefField } from
"../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import {
DMN15__tDecisionTable,
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx
index bbc22e5fb58..b2717b4648a 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/DecisionTableRootCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { DescriptionField, TextField, TextFieldType } from "./Fields";
+import { DescriptionField, TextField, TextFieldType } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { DMN15__tDecisionTable } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ExpressionRootCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ExpressionRootCell.tsx
index 7aba9337735..2254d227cb2 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ExpressionRootCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/ExpressionRootCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { DescriptionField } from "./Fields";
+import { DescriptionField } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { AllExpressionsWithoutTypes } from "../../dataTypes/DataTypeSpec";
import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx
index d946840c174..16e87aefdba 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionParametersCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useCallback, useMemo, useState } from "react";
-import { DescriptionField, NameField, TypeRefField } from "./Fields";
+import { DescriptionField, NameField, TypeRefField } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { useDmnEditor } from "../../DmnEditorContext";
import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx
index 4d85f287b9d..1db5b4351be 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/FunctionDefinitionRootCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { DescriptionField, TextField, TextFieldType } from "./Fields";
+import { DescriptionField, TextField, TextFieldType } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater";
import { ClipboardCopy } from
"@patternfly/react-core/dist/js/components/ClipboardCopy";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx
index 9e6f0181466..62edb37ef55 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InformationItemCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useCallback, useMemo } from "react";
-import { DescriptionField, NameField, TypeRefField } from "./Fields";
+import { DescriptionField, NameField, TypeRefField } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { DMN15__tInformationItem } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx
index 49af9d91377..d92c0878148 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/InvocationFunctionCallCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { TextField, TextFieldType } from "./Fields";
+import { TextField, TextFieldType } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { useDmnEditorStore } from "../../store/StoreContext";
import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx
index 62844db0930..c87e8e78640 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/IteratorVariableCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { TextField, TextFieldType } from "./Fields";
+import { TextField, TextFieldType } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { useDmnEditorStore } from "../../store/StoreContext";
import { useBoxedExpressionUpdater } from "./useBoxedExpressionUpdater";
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx
index 320e163f353..8f5d8f7603d 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx
+++
b/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/LiteralExpressionContentCell.tsx
@@ -19,7 +19,7 @@
import * as React from "react";
import { useMemo } from "react";
-import { DescriptionField, ExpressionLanguageField } from "./Fields";
+import { DescriptionField, ExpressionLanguageField } from "../Fields";
import { BoxedExpressionIndex } from
"../../boxedExpressions/boxedExpressionIndex";
import { DMN15__tLiteralExpression } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
diff --git a/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx
b/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx
index d38ba38717d..288cbfbe26f 100644
--- a/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx
+++ b/packages/dmn-editor/src/propertiesPanel/DecisionProperties.tsx
@@ -22,7 +22,6 @@ import { DMN15__tDecision } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
import { ClipboardCopy } from
"@patternfly/react-core/dist/js/components/ClipboardCopy";
import { FormGroup } from "@patternfly/react-core/dist/js/components/Form";
-import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea";
import { DocumentationLinksFormGroup } from "./DocumentationLinksFormGroup";
import { TypeRefSelector } from "../dataTypes/TypeRefSelector";
import { useDmnEditorStore, useDmnEditorStoreApi } from
"../store/StoreContext";
@@ -33,6 +32,7 @@ import { useCallback, useMemo } from "react";
import { generateUuid } from "@kie-tools/boxed-expression-component/dist/api";
import { useSettings } from "../settings/DmnEditorSettingsContext";
import { useRefactor } from "../refactor/RefactorConfirmationDialog";
+import { TextField, TextFieldType } from "./Fields";
export function DecisionProperties({
decision,
@@ -96,24 +96,20 @@ export function DecisionProperties({
/>
</FormGroup>
- <FormGroup label="Description">
- <TextArea
- aria-label={"Description"}
- type={"text"}
- isDisabled={isReadOnly}
- value={decision.description?.__$$text}
- onChange={(newDescription) => {
- setState((state) => {
- (state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tDecision>).description = {
- __$$text: newDescription,
- };
- });
- }}
- placeholder={"Enter a description..."}
- style={{ resize: "vertical", minHeight: "40px" }}
- rows={6}
- />
- </FormGroup>
+ <TextField
+ title={"Description"}
+ type={TextFieldType.TEXT_AREA}
+ isReadOnly={isReadOnly}
+ initialValue={decision.description?.__$$text || ""}
+ onChange={(newDescription) => {
+ setState((state) => {
+ (state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tDecision>).description = {
+ __$$text: newDescription,
+ };
+ });
+ }}
+ placeholder={"Enter a description..."}
+ />
<FormGroup label="ID">
<ClipboardCopy isReadOnly={true} hoverTip="Copy" clickTip="Copied">
@@ -121,43 +117,35 @@ export function DecisionProperties({
</ClipboardCopy>
</FormGroup>
- <FormGroup label="Question">
- <TextArea
- aria-label={"Question"}
- type={"text"}
- isDisabled={isReadOnly}
- value={decision.question?.__$$text}
- onChange={(newQuestion) => {
- setState((state) => {
- (state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tDecision>).question = {
- __$$text: newQuestion,
- };
- });
- }}
- placeholder={"Enter a question..."}
- style={{ resize: "vertical", minHeight: "40px" }}
- rows={6}
- />
- </FormGroup>
+ <TextField
+ title={"Question"}
+ type={TextFieldType.TEXT_AREA}
+ isReadOnly={isReadOnly}
+ initialValue={decision.question?.__$$text || ""}
+ onChange={(newQuestion) => {
+ setState((state) => {
+ (state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tDecision>).question = {
+ __$$text: newQuestion,
+ };
+ });
+ }}
+ placeholder={"Enter a question..."}
+ />
- <FormGroup label="Allowed answers">
- <TextArea
- aria-label={"Allowed answers"}
- type={"text"}
- isDisabled={isReadOnly}
- value={decision.allowedAnswers?.__$$text}
- onChange={(newAllowedAnswers) => {
- setState((state) => {
- (state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tDecision>).allowedAnswers = {
- __$$text: newAllowedAnswers,
- };
- });
- }}
- placeholder={"Enter allowed answers..."}
- style={{ resize: "vertical", minHeight: "40px" }}
- rows={3}
- />
- </FormGroup>
+ <TextField
+ title={"Allowed answers"}
+ type={TextFieldType.TEXT_AREA}
+ isReadOnly={isReadOnly}
+ initialValue={decision.allowedAnswers?.__$$text || ""}
+ onChange={(newAllowedAnswers) => {
+ setState((state) => {
+ (state.dmn.model.definitions.drgElement![index] as
Normalized<DMN15__tDecision>).allowedAnswers = {
+ __$$text: newAllowedAnswers,
+ };
+ });
+ }}
+ placeholder={"Enter allowed answers..."}
+ />
<DocumentationLinksFormGroup
isReadOnly={isReadOnly}
diff --git
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/Fields.tsx
b/packages/dmn-editor/src/propertiesPanel/Fields.tsx
similarity index 96%
rename from
packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/Fields.tsx
rename to packages/dmn-editor/src/propertiesPanel/Fields.tsx
index b7919e03089..bc5f9aac412 100644
---
a/packages/dmn-editor/src/propertiesPanel/BoxedExpressionPropertiesPanelComponents/Fields.tsx
+++ b/packages/dmn-editor/src/propertiesPanel/Fields.tsx
@@ -20,13 +20,13 @@
import * as React from "react";
import { useEffect, useState } from "react";
import { FormGroup } from "@patternfly/react-core/dist/js/components/Form";
-import { InlineFeelNameInput } from "../../feel/InlineFeelNameInput";
+import { InlineFeelNameInput } from "../feel/InlineFeelNameInput";
import { TextArea } from "@patternfly/react-core/dist/js/components/TextArea";
-import { ExpressionPath } from "../../boxedExpressions/boxedExpressionIndex";
+import { ExpressionPath } from "../boxedExpressions/boxedExpressionIndex";
import { TextInput } from
"@patternfly/react-core/dist/js/components/TextInput";
-import { TypeRefSelector } from "../../dataTypes/TypeRefSelector";
+import { TypeRefSelector } from "../dataTypes/TypeRefSelector";
import { UniqueNameIndex } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/Dmn15Spec";
-import { State } from "../../store/Store";
+import { State } from "../store/Store";
export function ContentField(props: {
initialValue: string;
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/bee/bkmPropertiesPanel.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/bee/bkmPropertiesPanel.ts
new file mode 100644
index 00000000000..1f50714e232
--- /dev/null
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/bee/bkmPropertiesPanel.ts
@@ -0,0 +1,48 @@
+/*
+ * 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 { Page } from "@playwright/test";
+import { BeePropertiesPanelBase } from "./beePropertiesPanelBase";
+import { DescriptionProperties } from "../parts/descriptionProperties";
+import { Diagram } from "../../diagram";
+import { NameAndDataTypeCell } from
"@kie-tools/boxed-expression-component/tests-e2e/api/nameAndDataTypeCell";
+
+export class BkmPropertiesPanel extends BeePropertiesPanelBase {
+ private descriptionProperties: DescriptionProperties;
+
+ constructor(
+ public diagram: Diagram,
+ public page: Page
+ ) {
+ super(diagram, page);
+ this.descriptionProperties = new DescriptionProperties(this.panel());
+ }
+
+ public async setDescription(args: { newDescription: string }) {
+ await this.descriptionProperties.setDescription({ ...args });
+ }
+
+ public async getDescription() {
+ return await this.descriptionProperties.getDescription();
+ }
+
+ public expressionHeaderCell() {
+ return new NameAndDataTypeCell(this.page.getByRole("columnheader", { name:
"New BKM (<Undefined>)" }));
+ }
+}
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/bee/decisionPropertiesPanel.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/bee/decisionPropertiesPanel.ts
new file mode 100644
index 00000000000..7cadfb05f6a
--- /dev/null
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/bee/decisionPropertiesPanel.ts
@@ -0,0 +1,65 @@
+/*
+ * 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 { Page } from "@playwright/test";
+import { BeePropertiesPanelBase } from "./beePropertiesPanelBase";
+import { DescriptionProperties } from "../parts/descriptionProperties";
+import { QuestionProperties } from "../parts/questionProperties";
+import { AllowedAnswersProperties } from "../parts/allowedAnswersProperties";
+import { Diagram } from "../../diagram";
+
+export class DecisionPropertiesPanel extends BeePropertiesPanelBase {
+ private descriptionProperties: DescriptionProperties;
+ private questionProperties: QuestionProperties;
+ private allowedAnswersProperties: AllowedAnswersProperties;
+
+ constructor(
+ public diagram: Diagram,
+ public page: Page
+ ) {
+ super(diagram, page);
+ this.descriptionProperties = new DescriptionProperties(this.panel());
+ this.questionProperties = new QuestionProperties(this.panel());
+ this.allowedAnswersProperties = new AllowedAnswersProperties(this.panel());
+ }
+
+ public async setDescription(args: { newDescription: string }) {
+ await this.descriptionProperties.setDescription({ ...args });
+ }
+
+ public async getDescription() {
+ return await this.descriptionProperties.getDescription();
+ }
+
+ public async setQuestion(args: { newQuestion: string }) {
+ await this.questionProperties.setQuestion({ ...args });
+ }
+
+ public async getQuestion() {
+ return await this.questionProperties.getQuestion();
+ }
+
+ public async setAllowedAnswers(args: { newAllowedAnswers: string }) {
+ await this.allowedAnswersProperties.setAllowedAnswers({ ...args });
+ }
+
+ public async getAllowedAnswers() {
+ return await this.allowedAnswersProperties.getAllowedAnswers();
+ }
+}
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/beePropertiesPanel.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/beePropertiesPanel.ts
index aab15d21ba5..2a52bfdefc5 100644
---
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/beePropertiesPanel.ts
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/beePropertiesPanel.ts
@@ -23,12 +23,16 @@ import { DecisionTableInputRulePropertiesPanel } from
"./bee/decisionTableInputR
import { DecisionTableOutputHeaderPropertiesPanel } from
"./bee/decisionTableOutputHeaderPropertiesPanel";
import { DecisionTableOutputRulePropertiesPanel } from
"./bee/decisionTableOutputRulePropertiesPanel";
import { Diagram } from "../diagram";
+import { DecisionPropertiesPanel } from "./bee/decisionPropertiesPanel";
+import { BkmPropertiesPanel } from "./bee/bkmPropertiesPanel";
export class BeePropertiesPanel {
public decisionTableInputHeader: DecisionTableInputHeaderPropertiesPanel;
public decisionTableInputRule: DecisionTableInputRulePropertiesPanel;
public decisionTableOutputHeader: DecisionTableOutputHeaderPropertiesPanel;
public decisionTableOutputRule: DecisionTableOutputRulePropertiesPanel;
+ public decisionNode: DecisionPropertiesPanel;
+ public bkmNode: BkmPropertiesPanel;
constructor(
public diagram: Diagram,
@@ -39,6 +43,8 @@ export class BeePropertiesPanel {
this.decisionTableInputRule = new
DecisionTableInputRulePropertiesPanel(diagram, page);
this.decisionTableOutputHeader = new
DecisionTableOutputHeaderPropertiesPanel(diagram, page);
this.decisionTableOutputRule = new
DecisionTableOutputRulePropertiesPanel(diagram, page);
+ this.decisionNode = new DecisionPropertiesPanel(diagram, page);
+ this.bkmNode = new BkmPropertiesPanel(diagram, page);
}
public async open() {
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionPropertiesPanel.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionPropertiesPanel.ts
index 6cff539d82d..8084bd868b1 100644
---
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionPropertiesPanel.ts
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/decisionPropertiesPanel.ts
@@ -27,6 +27,8 @@ import { DescriptionProperties } from
"./parts/descriptionProperties";
import { DataTypeProperties } from "./parts/dataTypeProperties";
import { DataType } from "../dataTypes";
import { NameProperties } from "./parts/nameProperties";
+import { QuestionProperties } from "./parts/questionProperties";
+import { AllowedAnswersProperties } from "./parts/allowedAnswersProperties";
export class DecisionPropertiesPanel extends PropertiesPanelBase {
private nameProperties: NameProperties;
@@ -35,6 +37,8 @@ export class DecisionPropertiesPanel extends
PropertiesPanelBase {
private documentationProperties: DocumentationProperties;
private fontProperties: FontProperties;
private shapeProperties: ShapeProperties;
+ private questionProperties: QuestionProperties;
+ private allowedAnswersProperties: AllowedAnswersProperties;
constructor(
public diagram: Diagram,
@@ -47,6 +51,8 @@ export class DecisionPropertiesPanel extends
PropertiesPanelBase {
this.documentationProperties = new DocumentationProperties(this.panel(),
page);
this.fontProperties = new FontProperties(this.panel());
this.shapeProperties = new ShapeProperties(this.panel());
+ this.questionProperties = new QuestionProperties(this.panel());
+ this.allowedAnswersProperties = new AllowedAnswersProperties(this.panel());
}
public async setName(args: { newName: string }) {
@@ -78,21 +84,19 @@ export class DecisionPropertiesPanel extends
PropertiesPanelBase {
}
public async setQuestion(args: { newQuestion: string }) {
- await this.panel().getByPlaceholder("Enter a
question...").fill(args.newQuestion);
- await this.panel().getByPlaceholder("Enter a question...").press("Tab");
+ await this.questionProperties.setQuestion({ ...args });
}
public async getQuestion() {
- return await this.panel().getByPlaceholder("Enter a
question...").inputValue();
+ return await this.questionProperties.getQuestion();
}
public async setAllowedAnswers(args: { newAllowedAnswers: string }) {
- await this.panel().getByPlaceholder("Enter allowed
answers...").fill(args.newAllowedAnswers);
- await this.panel().getByPlaceholder("Enter allowed
answers...").press("Tab");
+ await this.allowedAnswersProperties.setAllowedAnswers({ ...args });
}
public async getAllowedAnswers() {
- return await this.panel().getByPlaceholder("Enter allowed
answers...").inputValue();
+ return await this.allowedAnswersProperties.getAllowedAnswers();
}
public async setFont(args: {
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/allowedAnswersProperties.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/allowedAnswersProperties.ts
new file mode 100644
index 00000000000..a64a67fac52
--- /dev/null
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/allowedAnswersProperties.ts
@@ -0,0 +1,33 @@
+/*
+ * 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 { Locator } from "@playwright/test";
+
+export class AllowedAnswersProperties {
+ constructor(public panel: Locator) {}
+
+ public async setAllowedAnswers(args: { newAllowedAnswers: string }) {
+ await this.panel.getByPlaceholder("Enter allowed
answers...").fill(args.newAllowedAnswers);
+ await this.panel.getByPlaceholder("Enter allowed answers...").press("Tab");
+ }
+
+ public async getAllowedAnswers() {
+ return await this.panel.getByPlaceholder("Enter allowed
answers...").inputValue();
+ }
+}
diff --git
a/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/questionProperties.ts
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/questionProperties.ts
new file mode 100644
index 00000000000..20751d5e741
--- /dev/null
+++
b/packages/dmn-editor/tests-e2e/__fixtures__/propertiesPanel/parts/questionProperties.ts
@@ -0,0 +1,33 @@
+/*
+ * 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 { Locator } from "@playwright/test";
+
+export class QuestionProperties {
+ constructor(public panel: Locator) {}
+
+ public async setQuestion(args: { newQuestion: string }) {
+ await this.panel.getByPlaceholder("Enter a
question...").fill(args.newQuestion);
+ await this.panel.getByPlaceholder("Enter a question...").press("Tab");
+ }
+
+ public async getQuestion() {
+ return await this.panel.getByPlaceholder("Enter a
question...").inputValue();
+ }
+}
diff --git
a/packages/dmn-editor/tests-e2e/drgElements/changeBkmProperties.spec.ts
b/packages/dmn-editor/tests-e2e/drgElements/changeBkmProperties.spec.ts
index 99aef5f81be..5a7701b2c40 100644
--- a/packages/dmn-editor/tests-e2e/drgElements/changeBkmProperties.spec.ts
+++ b/packages/dmn-editor/tests-e2e/drgElements/changeBkmProperties.spec.ts
@@ -137,4 +137,18 @@ test.describe("Change Properties - BKM", () => {
await expect(diagram.get()).toHaveScreenshot("change-bkm-position.png");
});
+ test("should change the BKM node properties using the BEE properties panel",
async ({
+ nodes,
+ beePropertiesPanel,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/1459",
+ });
+ await nodes.edit({ name: DefaultNodeName.BKM });
+ await beePropertiesPanel.bkmNode.expressionHeaderCell().select();
+
+ await beePropertiesPanel.bkmNode.setDescription({ newDescription: "New
Description" });
+ expect(await beePropertiesPanel.bkmNode.getDescription()).toBe("New
Description");
+ });
});
diff --git
a/packages/dmn-editor/tests-e2e/drgElements/changeDecisionProperties.spec.ts
b/packages/dmn-editor/tests-e2e/drgElements/changeDecisionProperties.spec.ts
index 20456b594fa..9800f124199 100644
--- a/packages/dmn-editor/tests-e2e/drgElements/changeDecisionProperties.spec.ts
+++ b/packages/dmn-editor/tests-e2e/drgElements/changeDecisionProperties.spec.ts
@@ -158,4 +158,28 @@ test.describe("Change Properties - Decision", () => {
await
expect(diagram.get()).toHaveScreenshot("change-decision-position.png");
});
+
+ test("should change the Decision node properties using the BEE properties
panel", async ({
+ nodes,
+ bee,
+ beePropertiesPanel,
+ }) => {
+ test.info().annotations.push({
+ type: TestAnnotations.REGRESSION,
+ description:
"https://github.com/apache/incubator-kie-issues/issues/1459",
+ });
+ await nodes.edit({ name: DefaultNodeName.DECISION });
+ await bee.selectExpressionMenu.selectContext();
+
+ await bee.expression.asContext().expressionHeaderCell.select();
+
+ await beePropertiesPanel.decisionNode.setDescription({ newDescription:
"New Description" });
+ expect(await beePropertiesPanel.decisionNode.getDescription()).toBe("New
Description");
+
+ await beePropertiesPanel.decisionNode.setAllowedAnswers({
newAllowedAnswers: "New Allowed Answers" });
+ expect(await
beePropertiesPanel.decisionNode.getAllowedAnswers()).toBe("New Allowed
Answers");
+
+ await beePropertiesPanel.decisionNode.setQuestion({ newQuestion: "New
Question" });
+ expect(await beePropertiesPanel.decisionNode.getQuestion()).toBe("New
Question");
+ });
});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]