Skip to content

Commit

Permalink
incorporate review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jomarko committed Apr 2, 2024
1 parent 654d7fa commit 118c202
Show file tree
Hide file tree
Showing 29 changed files with 536 additions and 313 deletions.
35 changes: 18 additions & 17 deletions packages/dmn-editor/src/propertiesPanel/FontOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,23 +373,24 @@ export function FontOptions({ startExpanded, nodeIds }: { startExpanded: boolean
</ToggleGroup>
</div>
<br />
<Select
ouiaId="node-font-style-selector"
toggleRef={toggleRef}
variant={SelectVariant.single}
aria-label={"Select font style"}
isOpen={isFontFamilySelectOpen}
onSelect={onSelectFont}
onToggle={() => setFontFamilySelectOpen((prev) => !prev)}
selections={fontFamily ?? ""}
isDisabled={false}
maxHeight={inViewTimezoneSelect.maxHeight}
direction={inViewTimezoneSelect.direction}
>
{WEBSAFE_FONTS_LIST.map((fontName, index) => (
<SelectOption key={index} value={fontName} style={{ fontFamily: fontName }} />
))}
</Select>
<div data-testid="node-font-style-selector">
<Select
toggleRef={toggleRef}
variant={SelectVariant.single}
aria-label={"Select font style"}
isOpen={isFontFamilySelectOpen}
onSelect={onSelectFont}
onToggle={() => setFontFamilySelectOpen((prev) => !prev)}
selections={fontFamily ?? ""}
isDisabled={false}
maxHeight={inViewTimezoneSelect.maxHeight}
direction={inViewTimezoneSelect.direction}
>
{WEBSAFE_FONTS_LIST.map((fontName, index) => (
<SelectOption key={index} value={fontName} style={{ fontFamily: fontName }} />
))}
</Select>
</div>
</div>
</FormSection>
)}
Expand Down
63 changes: 39 additions & 24 deletions packages/dmn-editor/tests/e2e/__fixtures__/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ import { Nodes } from "./nodes";
import { Editor } from "./editor";
import { Edges } from "./edges";
import { JsonModel } from "./jsonModel";
import { GeneralProperties } from "./propertiesPanel/generalProperties";
import { PropertiesPanelBase } from "./propertiesPanel/propertiesPanelBase";
import { ContainerNodeGeneralProperties } from "./propertiesPanel/containerNodeGeneralProperties";
import { DecisionProperties } from "./propertiesPanel/decisionProperties";
import { KnowledgeSourceProperties } from "./propertiesPanel/knowledgeSourceProperties";
import { TextAnnotationProperties } from "./propertiesPanel/textAnnotationProperties";
import { DecisionServicePropertiesPanel } from "./propertiesPanel/decisionServicePropertiesPanel";
import { DecisionPropertiesPanel } from "./propertiesPanel/decisionPropertiesPanel";
import { KnowledgeSourcePropertiesPanel } from "./propertiesPanel/knowledgeSourcePropertiesPanel";
import { TextAnnotationProperties as TextAnnotationPropertiesPanel } from "./propertiesPanel/textAnnotationPropertiesPanel";
import { BkmPropertiesPanel } from "./propertiesPanel/bkmPropertiesPanel";
import { InputDataPropertiesPanel } from "./propertiesPanel/inputDataPropertiesPanel";
import { GroupPropertiesPanel } from "./propertiesPanel/groupPropertiesPanel";
import { DiagramPropertiesPanel } from "./propertiesPanel/diagramPropertiesPanel";
import { MultipleNodesPropertiesPanel } from "./propertiesPanel/multipleNodesPropertiesPanel";

type DmnEditorFixtures = {
diagram: Diagram;
Expand All @@ -38,12 +41,15 @@ type DmnEditorFixtures = {
jsonModel: JsonModel;
nodes: Nodes;
palette: Palette;
generalProperties: GeneralProperties;
decisionProperties: DecisionProperties;
knowledgeSourceProperties: KnowledgeSourceProperties;
textAnnotationProperties: TextAnnotationProperties;
propertiesPanel: PropertiesPanelBase;
containerNodeGeneralProperties: ContainerNodeGeneralProperties;
bkmPropertiesPanel: BkmPropertiesPanel;
decisionPropertiesPanel: DecisionPropertiesPanel;
decisionServicePropertiesPanel: DecisionServicePropertiesPanel;
diagramPropertiesPanel: DiagramPropertiesPanel;
groupPropertiesPanel: GroupPropertiesPanel;
inputDataPropertiesPanel: InputDataPropertiesPanel;
knowledgeSourcePropertiesPanel: KnowledgeSourcePropertiesPanel;
multipleNodesPropertiesPanel: MultipleNodesPropertiesPanel;
textAnnotationPropertiesPanel: TextAnnotationPropertiesPanel;
};

export const test = base.extend<DmnEditorFixtures>({
Expand All @@ -65,23 +71,32 @@ export const test = base.extend<DmnEditorFixtures>({
palette: async ({ page, diagram, nodes }, use) => {
await use(new Palette(page, diagram, nodes));
},
generalProperties: async ({ diagram, nodes, page }, use) => {
await use(new GeneralProperties(diagram, nodes, page));
bkmPropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new BkmPropertiesPanel(diagram, nodes, page));
},
decisionProperties: async ({ diagram, nodes, page }, use) => {
await use(new DecisionProperties(diagram, nodes, page));
decisionPropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new DecisionPropertiesPanel(diagram, nodes, page));
},
knowledgeSourceProperties: async ({ diagram, nodes, page }, use) => {
await use(new KnowledgeSourceProperties(diagram, nodes, page));
decisionServicePropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new DecisionServicePropertiesPanel(diagram, nodes, page));
},
textAnnotationProperties: async ({ diagram, nodes, page }, use) => {
await use(new TextAnnotationProperties(diagram, nodes, page));
diagramPropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new DiagramPropertiesPanel(diagram, nodes, page));
},
propertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new PropertiesPanelBase(diagram, nodes, page));
groupPropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new GroupPropertiesPanel(diagram, nodes, page));
},
containerNodeGeneralProperties: async ({ diagram, nodes, page }, use) => {
await use(new ContainerNodeGeneralProperties(diagram, nodes, page));
knowledgeSourcePropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new KnowledgeSourcePropertiesPanel(diagram, nodes, page));
},
inputDataPropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new InputDataPropertiesPanel(diagram, nodes, page));
},
multipleNodesPropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new MultipleNodesPropertiesPanel(diagram, nodes, page));
},
textAnnotationPropertiesPanel: async ({ diagram, nodes, page }, use) => {
await use(new TextAnnotationPropertiesPanel(diagram, nodes, page));
},
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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 { PropertiesPanelBase } from "./propertiesPanelBase";

export class BkmPropertiesPanel extends PropertiesPanelBase {}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { PropertiesPanelBase } from "./propertiesPanelBase";

export class DecisionProperties extends PropertiesPanelBase {
public async changeNodeQuestion(args: { nodeName: string; newQuestion: string }) {
export class DecisionPropertiesPanel extends PropertiesPanelBase {
public async setQuestion(args: { nodeName: string; newQuestion: string }) {
await this.selectNodeByClickToAppropriatePosition({ nodeName: args.nodeName });
await this.panel().getByPlaceholder("Enter a question...").fill(args.newQuestion);
// commit changes by click to the diagram
Expand All @@ -32,7 +32,7 @@ export class DecisionProperties extends PropertiesPanelBase {
return await this.panel().getByPlaceholder("Enter a question...").inputValue();
}

public async changeNodeAllowedAnswers(args: { nodeName: string; newAllowedAnswers: string }) {
public async setAllowedAnswers(args: { nodeName: string; newAllowedAnswers: string }) {
await this.selectNodeByClickToAppropriatePosition({ nodeName: args.nodeName });
await this.panel().getByPlaceholder("Enter allowed answers...").fill(args.newAllowedAnswers);
// commit changes by click to the diagram
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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 { NodePosition } from "../nodes";
import { PropertiesPanelBase } from "./propertiesPanelBase";

export class DecisionServicePropertiesPanel extends PropertiesPanelBase {
public async selectNodeByClickToAppropriatePosition(args: { nodeName: string }) {
await this.nodes.select({ name: args.nodeName, position: NodePosition.TOP });
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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 { PropertiesPanelBase } from "./propertiesPanelBase";

export class DiagramPropertiesPanel extends PropertiesPanelBase {}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
*/

import { NodePosition } from "../nodes";
import { GeneralProperties } from "./generalProperties";

import { PropertiesPanelBase } from "./propertiesPanelBase";
/**
* Please use this fixture for manipulation with 'Decision Service' and 'Group' nodes
*/
export class ContainerNodeGeneralProperties extends GeneralProperties {
export class GroupPropertiesPanel extends PropertiesPanelBase {
public async selectNodeByClickToAppropriatePosition(args: { nodeName: string }) {
await this.nodes.select({ name: args.nodeName, position: NodePosition.TOP });
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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 { PropertiesPanelBase } from "./propertiesPanelBase";

export class InputDataPropertiesPanel extends PropertiesPanelBase {}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { PropertiesPanelBase } from "./propertiesPanelBase";

export class KnowledgeSourceProperties extends PropertiesPanelBase {
public async changeNodeSourceType(args: { nodeName: string; newSourceType: string }) {
export class KnowledgeSourcePropertiesPanel extends PropertiesPanelBase {
public async setSourceType(args: { nodeName: string; newSourceType: string }) {
await this.selectNodeByClickToAppropriatePosition({ nodeName: args.nodeName });
await this.panel().getByPlaceholder("Enter source type...").fill(args.newSourceType);
// commit changes by click to the diagram
Expand All @@ -32,7 +32,7 @@ export class KnowledgeSourceProperties extends PropertiesPanelBase {
return await this.panel().getByPlaceholder("Enter source type...").inputValue();
}

public async changeNodeLocationURI(args: { nodeName: string; newLocationURI: string }) {
public async setLocationURI(args: { nodeName: string; newLocationURI: string }) {
await this.selectNodeByClickToAppropriatePosition({ nodeName: args.nodeName });
await this.panel().getByPlaceholder("Enter location URI...").fill(args.newLocationURI);
// commit changes by click to the diagram
Expand Down
Loading

0 comments on commit 118c202

Please sign in to comment.