Skip to content

Commit 80207b9

Browse files
committed
Merge branch 'master' into 793-detect_complex_gateway
2 parents 7cc7846 + 35855d9 commit 80207b9

File tree

13 files changed

+264
-224
lines changed

13 files changed

+264
-224
lines changed

.github/workflows/fill-gh-draft-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
contents: write
1515
steps:
1616
# Drafts your next Release notes as Pull Requests are merged into "master"
17-
- uses: release-drafter/release-drafter@v5.20.1
17+
- uses: release-drafter/release-drafter@v5.21.0
1818
env:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1818
- name: Send message to Slack channel
1919
if: success()
20-
uses: slackapi/slack-github-action@v1.21.0
20+
uses: slackapi/slack-github-action@v1.22.0
2121
with:
2222
channel-id: 'CSF7TG6N5'
2323
payload: |

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,11 @@ You can set the BPMN content using one of the following ways:
129129

130130
#### 📜 TypeScript Support
131131

132-
`bpmn-visualization` provides type definitions, so the integration should work out of the box in TypeScript projects.
132+
`bpmn-visualization` provides type definitions, so the integration works out of the box in TypeScript projects.
133133

134-
Depending on the build system used by the TypeScript project, it may get the following type errors:
134+
`bpmn-visualization` requires **TypeScript 4.5** or greater.
135+
136+
Depending on the TypeScript configuration of the project, the following errors can occur:
135137
- error TS2688: Cannot find type definition file for 'typed-mxgraph'
136138
- error TS7016: Could not find a declaration file for module 'mxgraph'
137139

package-lock.json

Lines changed: 190 additions & 201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bpmn-visualization",
3-
"version": "0.26.1-post",
3+
"version": "0.26.2-post",
44
"description": "A TypeScript library for visualizing process execution data on BPMN diagrams",
55
"keywords": [
66
"bpmn2",
@@ -38,7 +38,7 @@
3838
"type": "git",
3939
"url": "git+https://github.com/process-analytics/bpmn-visualization-js.git"
4040
},
41-
"browser": "dist/bpmn-visualization.min.js",
41+
"browser": "dist/bpmn-visualization.esm.js",
4242
"main": "dist/bpmn-visualization.cjs.js",
4343
"module": "dist/bpmn-visualization.esm.js",
4444
"types": "dist/bpmn-visualization.d.ts",
@@ -90,7 +90,7 @@
9090
"dependencies": {
9191
"@typed-mxgraph/typed-mxgraph": "~1.0.7",
9292
"entities": "~4.3.1",
93-
"fast-xml-parser": "4.0.9",
93+
"fast-xml-parser": "4.0.10",
9494
"lodash.debounce": "~4.0.8",
9595
"lodash.throttle": "~4.1.1",
9696
"mxgraph": "4.2.2",
@@ -105,19 +105,19 @@
105105
"@types/lodash.debounce": "~4.0.7",
106106
"@types/lodash.throttle": "~4.1.7",
107107
"@types/minimist": "~1.2.2",
108-
"@typescript-eslint/eslint-plugin": "~5.37.0",
109-
"@typescript-eslint/parser": "~5.37.0",
108+
"@typescript-eslint/eslint-plugin": "~5.38.0",
109+
"@typescript-eslint/parser": "~5.38.0",
110110
"asciidoctor": "~2.2.6",
111-
"autoprefixer": "~10.4.9",
111+
"autoprefixer": "~10.4.12",
112112
"clipboardy": "~3.0.0",
113113
"cross-env": "~7.0.3",
114114
"cssnano": "~5.1.13",
115115
"debug": "~4.3.4",
116-
"eslint": "~8.23.1",
116+
"eslint": "~8.24.0",
117117
"eslint-config-prettier": "~8.5.0",
118118
"eslint-plugin-jest": "~27.0.4",
119119
"eslint-plugin-notice": "~0.9.10",
120-
"eslint-plugin-playwright": "~0.11.1",
120+
"eslint-plugin-playwright": "~0.11.2",
121121
"eslint-plugin-prettier": "~4.2.1",
122122
"expect-playwright": "~0.8.0",
123123
"fs-extra": "~10.1.0",
@@ -133,22 +133,22 @@
133133
"minimist": "~1.2.6",
134134
"npm-run-all": "~4.1.5",
135135
"pinst": "~3.0.0",
136-
"playwright": "~1.25.2",
136+
"playwright": "~1.26.0",
137137
"postcss": "~8.4.14",
138138
"postcss-cli": "~10.0.0",
139139
"prettier": "~2.7.1",
140140
"rimraf": "~3.0.2",
141-
"rollup": "~2.79.0",
141+
"rollup": "~2.79.1",
142142
"rollup-plugin-auto-external": "~2.0.0",
143143
"rollup-plugin-node-externals": "~5.0.0",
144144
"rollup-plugin-sizes": "~1.0.4",
145145
"rollup-plugin-terser": "~7.0.2",
146146
"rollup-plugin-typescript2": "~0.34.0",
147147
"tailwindcss": "~3.1.8",
148148
"ts-jest": "~27.1.4",
149-
"typedoc": "~0.23.14",
149+
"typedoc": "~0.23.15",
150150
"typescript": "~4.8.3",
151-
"vite": "~3.1.0"
151+
"vite": "~3.1.3"
152152
},
153153
"lint-staged": {
154154
"*.{js,mjs,ts}": [

rollup.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ const pluginsBundleIIFE = [
3232
// to have sizes of dependencies listed at the end of build log
3333
sizes(),
3434
];
35+
const iifeBundleFile = 'dist/bpmn-visualization.min.js';
3536
const outputIIFE = {
36-
file: pkg.browser.replace('.min.js', '.js'),
37+
file: iifeBundleFile.replace('.min.js', '.js'),
3738
name: 'bpmnvisu',
3839
format: 'iife',
3940
};
@@ -47,7 +48,7 @@ const configIIFEMinified = {
4748
input: libInput,
4849
output: {
4950
...outputIIFE,
50-
file: pkg.browser,
51+
file: iifeBundleFile,
5152
},
5253
plugins: withMinification(pluginsBundleIIFE),
5354
};

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sonar.organization=process-analytics
44

55
# This is the name and version displayed in the SonarCloud UI.
66
sonar.projectName=bpmn-visualization
7-
sonar.projectVersion=0.26.1-post
7+
sonar.projectVersion=0.26.2-post
88

99
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
1010
sonar.sources=src

src/component/registry/bpmn-model-filters.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import type BpmnModel from '../../model/bpmn/internal/BpmnModel';
2020
import type { ModelFilter } from '../options';
2121
import { ensureIsArray } from '../helpers/array-utils';
2222

23+
/**
24+
* @internal
25+
*/
2326
export class ModelFiltering {
2427
filter(bpmnModel: BpmnModel, modelFilter?: ModelFilter): BpmnModel {
2528
const poolIdsFilter: string[] = [];

src/component/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { mxgraph } from './mxgraph/initializer';
1818

1919
// WARN: this constant is automatically updated at release time by the 'manage-version-in-files.mjs' script.
2020
// So, if you modify the name of this file or this constant, please update the script accordingly.
21-
const libVersion = '0.26.1-post';
21+
const libVersion = '0.26.2-post';
2222

2323
/**
2424
* @internal

test/config/jest.image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function saveAndRegisterImages(matcherContext: MatcherContext, received: Buffer,
5353
// Manage expected and received images
5454
const baseImagePathWithName = `${options.customDiffDir}/${snapshotIdentifier}`;
5555
const expectedImagePath = `${baseImagePathWithName}-expected.png`;
56-
copyFileSync(`${options.customSnapshotsDir}/${snapshotIdentifier}-snap.png`, expectedImagePath);
56+
copyFileSync(`${options.customSnapshotsDir}/${snapshotIdentifier}.png`, expectedImagePath);
5757
// this image is generated by jest-image-snapshot when activating `storeReceivedOnFailure`
5858
const receivedImagePath = `${baseImagePathWithName}-received.png`;
5959

test/e2e/bpmn.rendering.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class ImageSnapshotThresholds extends MultiBrowserImageSnapshotThresholds {
266266
[
267267
'labels.04.fonts',
268268
{
269-
macos: 0.61 / 100, // 0.6044319789370367%
269+
macos: 0.71 / 100, // 0.703880504764276%
270270
},
271271
],
272272
[

test/integration/dom.css.classes.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ describe('Bpmn Elements registry - CSS class management', () => {
4040
htmlElementLookup.expectServiceTask('serviceTask_1_2', { label: 'Service Task 1.2', additionalClasses: ['class1', 'class2', 'class3'] });
4141
htmlElementLookup.expectEndEvent('endEvent_message_1', ShapeBpmnEventDefinitionKind.MESSAGE, { label: 'message end 2', additionalClasses: ['class2', 'class3'] });
4242
htmlElementLookup.expectSequenceFlow('Flow_1bewc4s', { label: 'link', additionalClasses: ['class2', 'class3'] });
43+
44+
// add several classes by passing classes in a single string separated with spaces
45+
// not documented in the API but this is working
46+
bpmnVisualization.bpmnElementsRegistry.addCssClasses(['endEvent_message_1'], ['extra-class1 extra-class2 extra-class3']);
47+
htmlElementLookup.expectEndEvent('endEvent_message_1', ShapeBpmnEventDefinitionKind.MESSAGE, {
48+
additionalClasses: ['class2', 'class3', 'extra-class1', 'extra-class2', 'extra-class3'],
49+
});
4350
});
4451

4552
it('BPMN element does not exist', () => {
@@ -91,6 +98,20 @@ describe('Bpmn Elements registry - CSS class management', () => {
9198
bpmnVisualization.bpmnElementsRegistry.removeCssClasses(['lane_01', 'userTask_0'], ['class1', 'class3']);
9299
htmlElementLookup.expectLane('lane_01', { label: 'Lane 3', additionalClasses: ['class2'] });
93100
htmlElementLookup.expectUserTask('userTask_0', { label: 'User Task 0', additionalClasses: ['class2'] });
101+
102+
// remove several classes by passing classes in a single string separated with spaces
103+
// this is not working (remember this is working for 'add css classes')
104+
bpmnVisualization.bpmnElementsRegistry.addCssClasses(['userTask_0'], ['extra-class1', 'extra-class2', 'extra-class3']);
105+
htmlElementLookup.expectUserTask('userTask_0', { additionalClasses: ['class2', 'extra-class1', 'extra-class2', 'extra-class3'] });
106+
bpmnVisualization.bpmnElementsRegistry.removeCssClasses(['userTask_0'], ['extra-class1 extra-class2 extra-class3']);
107+
htmlElementLookup.expectUserTask('userTask_0', { additionalClasses: ['class2', 'extra-class1', 'extra-class2', 'extra-class3'] });
108+
109+
// add the class with spaces and remove them with spaces
110+
const extraClassNamesToAddThenRemove = ['extra-class1 extra-class2 extra-class3'];
111+
bpmnVisualization.bpmnElementsRegistry.addCssClasses(['lane_01'], extraClassNamesToAddThenRemove);
112+
htmlElementLookup.expectLane('lane_01', { additionalClasses: ['class2', 'extra-class1', 'extra-class2', 'extra-class3'] });
113+
bpmnVisualization.bpmnElementsRegistry.removeCssClasses(['lane_01'], extraClassNamesToAddThenRemove);
114+
htmlElementLookup.expectLane('lane_01', { additionalClasses: ['class2'] });
94115
});
95116

96117
it('BPMN element does not exist', () => {
@@ -117,6 +138,20 @@ describe('Bpmn Elements registry - CSS class management', () => {
117138
bpmnVisualization.bpmnElementsRegistry.toggleCssClasses(['lane_02', 'gateway_01'], ['class1', 'class3', 'class4']);
118139
htmlElementLookup.expectLane('lane_02', { label: 'Lane 2', additionalClasses: ['class2', 'class4'] });
119140
htmlElementLookup.expectExclusiveGateway('gateway_01', { label: 'gateway 1', additionalClasses: ['class4'] });
141+
142+
// toggle several classes by passing classes in a single string separated with spaces
143+
// this is not working (remember this is working for 'add css classes')
144+
bpmnVisualization.bpmnElementsRegistry.toggleCssClasses(['gateway_01'], ['extra-class1', 'extra-class2']);
145+
htmlElementLookup.expectExclusiveGateway('gateway_01', { additionalClasses: ['class4', 'extra-class1', 'extra-class2'] });
146+
bpmnVisualization.bpmnElementsRegistry.toggleCssClasses(['gateway_01'], ['extra-class1 extra-class2']);
147+
htmlElementLookup.expectExclusiveGateway('gateway_01', { additionalClasses: ['class4', 'extra-class1', 'extra-class2', 'extra-class1', 'extra-class2'] });
148+
149+
// add the class with spaces and remove them with spaces
150+
const extraClassNamesToAddThenRemove = ['extra-class1 extra-class3'];
151+
bpmnVisualization.bpmnElementsRegistry.toggleCssClasses(['lane_02'], extraClassNamesToAddThenRemove);
152+
htmlElementLookup.expectLane('lane_02', { additionalClasses: ['class2', 'class4', 'extra-class1', 'extra-class3'] });
153+
bpmnVisualization.bpmnElementsRegistry.toggleCssClasses(['lane_02'], extraClassNamesToAddThenRemove);
154+
htmlElementLookup.expectLane('lane_02', { additionalClasses: ['class2', 'class4'] });
120155
});
121156

122157
it('BPMN element does not exist', () => {

test/unit/component/registry/css-registry.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ describe('manage css classes for BPMN cells', () => {
7777
expect(cssRegistry.getClassNames(bpmnElementId)).toEqual(classNames);
7878
});
7979

80+
it('register several classes with a single string parameter', () => {
81+
const bpmnElementId = 'bpmn-id';
82+
const classNames = ['class-name-1 class-name-2'];
83+
84+
const result = cssRegistry.addClassNames(bpmnElementId, classNames);
85+
86+
expect(result).toBeTruthy();
87+
expect(cssRegistry.getClassNames(bpmnElementId)).toEqual(classNames);
88+
});
89+
8090
it('a class name should be registered only once, when add it twice', () => {
8191
const bpmnElementId = 'bpmn-id';
8292
cssRegistry.addClassNames(bpmnElementId, ['class-name-1', 'class-name-2']);
@@ -87,7 +97,7 @@ describe('manage css classes for BPMN cells', () => {
8797
expect(cssRegistry.getClassNames(bpmnElementId)).toEqual(['class-name-1', 'class-name-2']);
8898
});
8999

90-
it('the unregistered class names should be registered, when the other are already registered', () => {
100+
it('register several classes several times, check classes order', () => {
91101
const bpmnElementId = 'bpmn-id';
92102
cssRegistry.addClassNames(bpmnElementId, ['class-name-1', 'class-name-2']);
93103

0 commit comments

Comments
 (0)