From 90e995bddb31388867cb53722a2acb6ddcda083d Mon Sep 17 00:00:00 2001 From: Maciej Barelkowski Date: Tue, 7 May 2024 19:28:09 +0200 Subject: [PATCH] deps: update to `dmn-js@16.3.0` deps: update to `camunda-dmn-js@2.3.1` feat: allow to open BKM from overview --- CHANGELOG.md | 13 + client/package.json | 5 +- client/src/app/tabs/cloud-dmn/DmnEditor.js | 17 ++ .../tabs/cloud-dmn/__tests__/DmnEditorSpec.js | 112 ++++++++ .../app/tabs/cloud-dmn/modeler/DmnModeler.js | 7 + client/src/app/tabs/dmn/DmnEditor.js | 17 ++ .../src/app/tabs/dmn/OverviewContainer.less | 174 ++++++------ .../app/tabs/dmn/__tests__/DmnEditorSpec.js | 112 ++++++++ client/src/app/tabs/dmn/getDmnEditMenu.js | 14 + client/src/app/tabs/dmn/modeler/DmnModeler.js | 7 + .../open-drg-element/OpenDrgElement.js | 234 ++++++++-------- .../tabs/dmn/util/__tests__/configureSpec.js | 40 +++ client/src/app/tabs/dmn/util/configure.js | 1 + client/src/styles/_modeling.less | 2 + .../dmn/CloudDmnModelerSpec.js | 50 +++- .../bpmn-io-modelers/dmn/DmnModelerSpec.js | 50 +++- client/test/bpmn-io-modelers/dmn/diagram.dmn | 64 +++-- package-lock.json | 256 +++++++++++------- .../client/TestEditorEvents.js | 2 +- 19 files changed, 850 insertions(+), 327 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed61ecdac6..a37bcd039f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ ___Note:__ Yet to be released changes appear here._ * `DEPS`: update to `bpmn-js-element-templates@1.15.1` * `DEPS`: update to `camunda-bpmn-js@4.5.1` +* `DEPS`: update to `camunda-dmn-js@2.3.1` +* `DEPS`: update to `dmn-js@16.3.0` ### BPMN @@ -17,6 +19,17 @@ ___Note:__ Yet to be released changes appear here._ * `FIX`: preserve valid user input when changing element template ([bpmn-io/bpmn-js-element-templates#86](https://github.com/bpmn-io/bpmn-js-element-templates/pull/86), [#4249](https://github.com/camunda/camunda-modeler/issues/4249)) * `FIX`: mark non-object JSON as invalid example data ([example-data-properties-provider#17](https://github.com/camunda/example-data-properties-provider/pull/17)) +### DMN + +* `FEAT`: context pad position absolute instead of relative to element ([bpmn-io/diagram-js#888](https://github.com/bpmn-io/diagram-js/pull/888)) +* `FEAT`: do not scale context pad and popup menu by default ([bpmn-io/diagram-js#883](https://github.com/bpmn-io/diagram-js/pull/883)) +* `FEAT`: add support for implementing BKM as literal expression ([bpmn-io/dmn-js#704](https://github.com/bpmn-io/dmn-js/issues/704), [bpmn-io/dmn-js#826](https://github.com/bpmn-io/dmn-js/issues/826)) +* `FEAT`: remove background for DRGElements ([bpmn-io/dmn-js#855](https://github.com/bpmn-io/dmn-js/pull/855)) +* `FEAT`: allow to provide accessible names to form fields ([bpmn-io/dmn-js#843](https://github.com/bpmn-io/dmn-js/pull/843)) +* `FIX`: add accessible names to multiple components ([bpmn-io/dmn-js#843](https://github.com/bpmn-io/dmn-js/pull/843)) +* `FIX`: improve contrast +* `FIX`: make table cells visible to screen readers ([bpmn-io/dmn-js#821](https://github.com/bpmn-io/dmn-js/issue/821)) + ## 5.22.0 ### General diff --git a/client/package.json b/client/package.json index 26ba1510eb..d5f995be16 100644 --- a/client/package.json +++ b/client/package.json @@ -34,7 +34,7 @@ "camunda-bpmn-js": "^4.5.1", "camunda-bpmn-moddle": "^7.0.1", "camunda-cmmn-moddle": "^1.0.0", - "camunda-dmn-js": "^2.1.0", + "camunda-dmn-js": "^2.3.1", "camunda-dmn-moddle": "^1.3.0", "canvg": "^4.0.1", "classnames": "^2.5.1", @@ -45,8 +45,9 @@ "diagram-js": "^14.0.0", "diagram-js-direct-editing": "^2.1.2", "diagram-js-origin": "^1.4.0", - "dmn-js": "^16.0.2", + "dmn-js": "^16.3.0", "dmn-js-properties-panel": "^3.3.0", + "dmn-js-shared": "^16.3.0", "drag-tabs": "^2.3.1", "events": "^3.0.0", "formik": "2.0.4", diff --git a/client/src/app/tabs/cloud-dmn/DmnEditor.js b/client/src/app/tabs/cloud-dmn/DmnEditor.js index d25f527155..b08664e31d 100644 --- a/client/src/app/tabs/cloud-dmn/DmnEditor.js +++ b/client/src/app/tabs/cloud-dmn/DmnEditor.js @@ -42,6 +42,7 @@ import CamundaDmnModeler from './modeler'; import { active as isInputActive } from '../../../util/dom/isInput'; import { + getDmnBoxedExpressionEditMenu, getDmnDrdEditMenu, getDmnDecisionTableEditMenu, getDmnLiteralExpressionEditMenu @@ -445,6 +446,22 @@ export class DmnEditor extends CachedComponent { newState.inputActive = true; editMenu = getDmnLiteralExpressionEditMenu(newState); + } else if (activeView.type === 'boxedExpression') { + + // TODO(@barmac): handle boxed expression differently than literal expression when needed + assign(newState, { + defaultCopyCutPaste: true, + defaultUndoRedo: true, + removeSelected: true, + selectAll: true + }); + + // The boxedExpression editor does not fire events when + // elements are selected, so we always set inputActive to true. + // cf. https://github.com/camunda/camunda-modeler/pull/2394 + newState.inputActive = true; + + editMenu = getDmnBoxedExpressionEditMenu(newState); } // ensure backwards compatibility diff --git a/client/src/app/tabs/cloud-dmn/__tests__/DmnEditorSpec.js b/client/src/app/tabs/cloud-dmn/__tests__/DmnEditorSpec.js index 7a98a97a0f..8648a2eaf1 100644 --- a/client/src/app/tabs/cloud-dmn/__tests__/DmnEditorSpec.js +++ b/client/src/app/tabs/cloud-dmn/__tests__/DmnEditorSpec.js @@ -126,6 +126,35 @@ describe('', function() { describe('plugins', function() { + it('should accept plugins', async function() { + + // given + const additionalModule = { + __init__: [ 'foo' ], + foo: [ 'type', noop ] + }; + + // when + const { + instance + } = await renderEditor(diagramXML, { + getPlugins(type) { + switch (type) { + case 'dmn.modeler.boxedExpression.additionalModules': + return [ additionalModule ]; + } + + return []; + } + }); + + // then + const { modeler } = instance.getCached(); + + expect(modeler.modules.boxedExpression.additionalModules).to.include(additionalModule); + }); + + it('should accept plugins', async function() { // given @@ -904,6 +933,62 @@ describe('', function() { }); + + describe('boxed expression', function() { + + it('Remove shortcut should always have role: delete', async function() { + + // given + const changedSpy = sinon.spy(); + + const { instance } = await renderEditor(diagramXML, { + onChanged: changedSpy + }); + + changedSpy.resetHistory(); + + // when + const modeler = instance.getModeler(); + + modeler.open({ type: 'boxedExpression' }); + instance.handleChanged(); + + // then + expect(changedSpy).to.be.calledOnce; + + const state = changedSpy.firstCall.args[0]; + + expect(hasMenuEntry(state.editMenu, 'Remove Selected')).to.be.true; + expect(getMenuEntry(state.editMenu, 'Remove Selected').role).to.equal('delete'); + }); + + + it('should NOT provide find entries', async function() { + + // given + const changedSpy = sinon.spy(); + + const { instance } = await renderEditor(diagramXML, { + onChanged: changedSpy + }); + + changedSpy.resetHistory(); + + // when + const modeler = instance.getModeler(); + + modeler.open({ type: 'boxedExpression' }); + instance.handleChanged(); + + // then + expect(changedSpy).to.be.calledOnce; + + const state = changedSpy.firstCall.args[0]; + expect(hasMenuEntry(state.editMenu, 'Find')).to.be.false; + }); + + }); + }); @@ -963,6 +1048,33 @@ describe('', function() { }); + it('should provide toggle/reset overview entries for boxed expression', async function() { + + // given + const changedSpy = sinon.spy(); + + const { instance } = await renderEditor(diagramXML, { + onChanged: changedSpy + }); + + changedSpy.resetHistory(); + + // when + const modeler = instance.getModeler(); + + modeler.open({ type: 'boxedExpression' }); + instance.handleChanged(); + + // then + expect(changedSpy).to.be.calledOnce; + + const state = changedSpy.firstCall.args[0]; + + expect(hasMenuEntry(state.windowMenu, 'Toggle Overview')).to.be.true; + expect(hasMenuEntry(state.windowMenu, 'Reset Overview')).to.be.true; + }); + + it('should NOT provide toggle/reset overview entries for DRD', async function() { // given diff --git a/client/src/app/tabs/cloud-dmn/modeler/DmnModeler.js b/client/src/app/tabs/cloud-dmn/modeler/DmnModeler.js index 1c108ee2b2..edefb52d7e 100644 --- a/client/src/app/tabs/cloud-dmn/modeler/DmnModeler.js +++ b/client/src/app/tabs/cloud-dmn/modeler/DmnModeler.js @@ -59,6 +59,13 @@ export default class CamundaDmnModeler extends DmnModeler { super({ ...otherOptions, + boxedExpression: mergeModules(otherOptions.boxedExpression, [ + poweredByModule, + executionPlatformModule, + { + viewDrd: NOOP_MODULE + } + ]), drd: mergeModules(drd, [ propertiesPanelKeyboardBindingsModule, executionPlatformModule diff --git a/client/src/app/tabs/dmn/DmnEditor.js b/client/src/app/tabs/dmn/DmnEditor.js index c51ec96cb9..8a83d585ba 100644 --- a/client/src/app/tabs/dmn/DmnEditor.js +++ b/client/src/app/tabs/dmn/DmnEditor.js @@ -42,6 +42,7 @@ import CamundaDmnModeler from './modeler'; import { active as isInputActive } from '../../../util/dom/isInput'; import { + getDmnBoxedExpressionEditMenu, getDmnDrdEditMenu, getDmnDecisionTableEditMenu, getDmnLiteralExpressionEditMenu @@ -445,6 +446,22 @@ export class DmnEditor extends CachedComponent { newState.inputActive = true; editMenu = getDmnLiteralExpressionEditMenu(newState); + } else if (activeView.type === 'boxedExpression') { + + // TODO(@barmac): handle boxed expression differently than literal expression when needed + assign(newState, { + defaultCopyCutPaste: true, + defaultUndoRedo: true, + removeSelected: true, + selectAll: true + }); + + // The boxedExpression editor does not fire events when + // elements are selected, so we always set inputActive to true. + // cf. https://github.com/camunda/camunda-modeler/pull/2394 + newState.inputActive = true; + + editMenu = getDmnBoxedExpressionEditMenu(newState); } // ensure backwards compatibility diff --git a/client/src/app/tabs/dmn/OverviewContainer.less b/client/src/app/tabs/dmn/OverviewContainer.less index 4bc5479dd5..1347f2368b 100644 --- a/client/src/app/tabs/dmn/OverviewContainer.less +++ b/client/src/app/tabs/dmn/OverviewContainer.less @@ -1,87 +1,87 @@ -:local(.OverviewContainer) { - margin: 0 10px 10px 10px; - position: relative; - - background-color: var(--color-grey-225-10-97); - border: solid 1px var(--color-grey-225-10-75); - border-radius: 3px; - - &:not(.open) { - width: 0; - visibility: hidden; - margin-right: 0; - } - - .resize-handle { - cursor: ew-resize; - z-index: 11; - position: absolute; - top: 0; - bottom: 0; - right: -3px; - width: 6px; - user-select: none; - } - - .toggle { - position: absolute; - top: 10px; - right: 10px; - z-index: 11; - opacity: 0.5; - - &:before { - content: '\E80A'; - font-family: 'app'; - font-size: 14px; - } - - &:hover { - opacity: 1; - color: var(--color-blue-205-100-45); - } - } - - .overview-container { - position: relative; - width: 100%; - height: 100%; - - overflow: hidden; - - .dmn-drd-container { - position: relative; - width: 100%; - height: 100%; - - .djs-element { - .djs-outline { - display: none; - } - - &.open, - &.can-open:hover { - .djs-visual { - rect { - stroke: var(--color-blue-205-100-50) !important; - fill: var(--color-blue-205-100-95) !important; - } - - text { - fill: var(--color-blue-205-100-50) !important; - } - } - } - } - - .djs-overlay { - pointer-events: none; - .drill-down-overlay { - color: var(--color-grey-225-10-15); - background: transparent; - } - } - } - } - -} \ No newline at end of file +:local(.OverviewContainer) { + margin: 0 10px 10px 10px; + position: relative; + + background-color: var(--color-grey-225-10-97); + border: solid 1px var(--color-grey-225-10-75); + border-radius: 3px; + + &:not(.open) { + width: 0; + visibility: hidden; + margin-right: 0; + } + + .resize-handle { + cursor: ew-resize; + z-index: 11; + position: absolute; + top: 0; + bottom: 0; + right: -3px; + width: 6px; + user-select: none; + } + + .toggle { + position: absolute; + top: 10px; + right: 10px; + z-index: 11; + opacity: 0.5; + + &:before { + content: '\E80A'; + font-family: 'app'; + font-size: 14px; + } + + &:hover { + opacity: 1; + color: var(--color-blue-205-100-45); + } + } + + .overview-container { + position: relative; + width: 100%; + height: 100%; + + overflow: hidden; + + .dmn-drd-container { + position: relative; + width: 100%; + height: 100%; + + .djs-element { + .djs-outline { + display: none; + } + + &.open, + &.can-open:hover { + .djs-visual { + rect, path { + stroke: var(--color-blue-205-100-50) !important; + fill: var(--color-blue-205-100-95) !important; + } + + text { + fill: var(--color-blue-205-100-50) !important; + } + } + } + } + + .djs-overlay { + pointer-events: none; + .drill-down-overlay { + color: var(--color-grey-225-10-15); + background: transparent; + } + } + } + } + +} diff --git a/client/src/app/tabs/dmn/__tests__/DmnEditorSpec.js b/client/src/app/tabs/dmn/__tests__/DmnEditorSpec.js index 00851a5186..494a5b642b 100644 --- a/client/src/app/tabs/dmn/__tests__/DmnEditorSpec.js +++ b/client/src/app/tabs/dmn/__tests__/DmnEditorSpec.js @@ -126,6 +126,35 @@ describe('', function() { describe('plugins', function() { + it('should accept plugins', async function() { + + // given + const additionalModule = { + __init__: [ 'foo' ], + foo: [ 'type', noop ] + }; + + // when + const { + instance + } = await renderEditor(diagramXML, { + getPlugins(type) { + switch (type) { + case 'dmn.modeler.boxedExpression.additionalModules': + return [ additionalModule ]; + } + + return []; + } + }); + + // then + const { modeler } = instance.getCached(); + + expect(modeler.modules.boxedExpression.additionalModules).to.include(additionalModule); + }); + + it('should accept plugins', async function() { // given @@ -905,6 +934,62 @@ describe('', function() { }); + + describe('boxed expression', function() { + + it('Remove shortcut should always have role: delete', async function() { + + // given + const changedSpy = sinon.spy(); + + const { instance } = await renderEditor(diagramXML, { + onChanged: changedSpy + }); + + changedSpy.resetHistory(); + + // when + const modeler = instance.getModeler(); + + modeler.open({ type: 'boxedExpression' }); + instance.handleChanged(); + + // then + expect(changedSpy).to.be.calledOnce; + + const state = changedSpy.firstCall.args[0]; + + expect(hasMenuEntry(state.editMenu, 'Remove Selected')).to.be.true; + expect(getMenuEntry(state.editMenu, 'Remove Selected').role).to.equal('delete'); + }); + + + it('should NOT provide find entries', async function() { + + // given + const changedSpy = sinon.spy(); + + const { instance } = await renderEditor(diagramXML, { + onChanged: changedSpy + }); + + changedSpy.resetHistory(); + + // when + const modeler = instance.getModeler(); + + modeler.open({ type: 'boxedExpression' }); + instance.handleChanged(); + + // then + expect(changedSpy).to.be.calledOnce; + + const state = changedSpy.firstCall.args[0]; + expect(hasMenuEntry(state.editMenu, 'Find')).to.be.false; + }); + + }); + }); @@ -964,6 +1049,33 @@ describe('', function() { }); + it('should provide toggle/reset overview entries for boxed expression', async function() { + + // given + const changedSpy = sinon.spy(); + + const { instance } = await renderEditor(diagramXML, { + onChanged: changedSpy + }); + + changedSpy.resetHistory(); + + // when + const modeler = instance.getModeler(); + + modeler.open({ type: 'boxedExpression' }); + instance.handleChanged(); + + // then + expect(changedSpy).to.be.calledOnce; + + const state = changedSpy.firstCall.args[0]; + + expect(hasMenuEntry(state.windowMenu, 'Toggle Overview')).to.be.true; + expect(hasMenuEntry(state.windowMenu, 'Reset Overview')).to.be.true; + }); + + it('should NOT provide toggle/reset overview entries for DRD', async function() { // given diff --git a/client/src/app/tabs/dmn/getDmnEditMenu.js b/client/src/app/tabs/dmn/getDmnEditMenu.js index b134896190..d5d2f0d8b5 100644 --- a/client/src/app/tabs/dmn/getDmnEditMenu.js +++ b/client/src/app/tabs/dmn/getDmnEditMenu.js @@ -89,3 +89,17 @@ export function getDmnLiteralExpressionEditMenu(state) { getSelectionEntries(state) ]; } + +export function getDmnBoxedExpressionEditMenu(state) { + const { defaultCopyCutPaste } = state; + + const copyCutPasteEntries = defaultCopyCutPaste + ? getDefaultCopyCutPasteEntries(true) + : getCopyCutPasteEntries(state); + + return [ + getUndoRedoEntries(state), + copyCutPasteEntries, + getSelectionEntries(state) + ]; +} diff --git a/client/src/app/tabs/dmn/modeler/DmnModeler.js b/client/src/app/tabs/dmn/modeler/DmnModeler.js index 1c1eb6ebb7..4483e4381e 100644 --- a/client/src/app/tabs/dmn/modeler/DmnModeler.js +++ b/client/src/app/tabs/dmn/modeler/DmnModeler.js @@ -59,6 +59,13 @@ export default class CamundaDmnModeler extends DmnModeler { super({ ...otherOptions, + boxedExpression: mergeModules(otherOptions.boxedExpression, [ + poweredByModule, + executionPlatformModule, + { + viewDrd: NOOP_MODULE + } + ]), drd: mergeModules(drd, [ propertiesPanelKeyboardBindingsModule, executionPlatformModule diff --git a/client/src/app/tabs/dmn/modeler/features/overview/open-drg-element/OpenDrgElement.js b/client/src/app/tabs/dmn/modeler/features/overview/open-drg-element/OpenDrgElement.js index 0ef475cf8f..cc098e81f4 100644 --- a/client/src/app/tabs/dmn/modeler/features/overview/open-drg-element/OpenDrgElement.js +++ b/client/src/app/tabs/dmn/modeler/features/overview/open-drg-element/OpenDrgElement.js @@ -1,118 +1,116 @@ -/** - * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. - * - * Camunda licenses this file to you under the MIT; you may not use this file - * except in compliance with the MIT License. - */ - -import { isAny } from 'dmn-js-shared/lib/util/ModelUtil'; - -import { getBBox } from 'diagram-js/lib/util/Elements'; - -const CAN_OPEN_DRG_ELEMENT_MARKER = 'can-open', - CURRENT_OPEN_DRG_ELEMENT_MARKER = 'open'; - - -export default class OpenDrgElement { - constructor(canvas, elementRegistry, eventBus) { - this._canvas = canvas; - - let currentOpenDrgElementId; - - eventBus.on('import.done', () => { - elementRegistry.forEach(element => { - if (this.canOpenDrgElement(element)) { - canvas.addMarker(element, CAN_OPEN_DRG_ELEMENT_MARKER); - } - }); - - if (currentOpenDrgElementId) { - const currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); - - if (currentOpenDrgElement) { - canvas.addMarker(currentOpenDrgElement, CURRENT_OPEN_DRG_ELEMENT_MARKER); - } - } - }); - - eventBus.on('overviewOpen', () => { - if (currentOpenDrgElementId) { - const currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); - - if (currentOpenDrgElement) { - this.centerViewbox(currentOpenDrgElement); - } - } - }); - - // highlight open DRG element and optionally center viewbox around it - eventBus.on('drgElementOpened', ({ id }) => { - let currentOpenDrgElement; - - // (1) remove hightlight from previously open DRG element - if (currentOpenDrgElementId) { - currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); - - if (currentOpenDrgElement) { - canvas.removeMarker(currentOpenDrgElement, CURRENT_OPEN_DRG_ELEMENT_MARKER); - } - } - - currentOpenDrgElementId = id; - - currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); - - // (2) add highlight to open DRG element - if (currentOpenDrgElement) { - canvas.addMarker(currentOpenDrgElement, CURRENT_OPEN_DRG_ELEMENT_MARKER); - } - }); - - // open DRG element on click - eventBus.on('element.click', ({ element }) => { - if (!this.canOpenDrgElement(element)) { - return; - } - - const { id } = element; - - eventBus.fire('openDrgElement', { - id - }); - }); - } - - canOpenDrgElement = (element) => { - const { businessObject } = element; - - const hasDecisionLogic = !!businessObject.decisionLogic; - - return isAny(element, [ 'dmn:Decision', 'dmn:LiteralExpression' ]) && hasDecisionLogic; - }; - - centerViewbox = element => { - const viewbox = this._canvas.viewbox(); - - const bBox = getBBox(element); - - const newViewbox = { - x: (bBox.x + bBox.width / 2) - viewbox.outer.width / 2, - y: (bBox.y + bBox.height / 2) - viewbox.outer.height / 2, - width: viewbox.outer.width, - height: viewbox.outer.height - }; - - this._canvas.viewbox(newViewbox); - - this._canvas.zoom(viewbox.scale); - }; -} - -OpenDrgElement.$inject = [ - 'canvas', - 'elementRegistry', - 'eventBus' -]; \ No newline at end of file +/** + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. + * + * Camunda licenses this file to you under the MIT; you may not use this file + * except in compliance with the MIT License. + */ + +import { getBoxedExpression, isAny } from 'dmn-js-shared/lib/util/ModelUtil'; + +import { getBBox } from 'diagram-js/lib/util/Elements'; + +const CAN_OPEN_DRG_ELEMENT_MARKER = 'can-open', + CURRENT_OPEN_DRG_ELEMENT_MARKER = 'open'; + + +export default class OpenDrgElement { + constructor(canvas, elementRegistry, eventBus) { + this._canvas = canvas; + + let currentOpenDrgElementId; + + eventBus.on('import.done', () => { + elementRegistry.forEach(element => { + if (this.canOpenDrgElement(element)) { + canvas.addMarker(element, CAN_OPEN_DRG_ELEMENT_MARKER); + } + }); + + if (currentOpenDrgElementId) { + const currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); + + if (currentOpenDrgElement) { + canvas.addMarker(currentOpenDrgElement, CURRENT_OPEN_DRG_ELEMENT_MARKER); + } + } + }); + + eventBus.on('overviewOpen', () => { + if (currentOpenDrgElementId) { + const currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); + + if (currentOpenDrgElement) { + this.centerViewbox(currentOpenDrgElement); + } + } + }); + + // highlight open DRG element and optionally center viewbox around it + eventBus.on('drgElementOpened', ({ id }) => { + let currentOpenDrgElement; + + // (1) remove hightlight from previously open DRG element + if (currentOpenDrgElementId) { + currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); + + if (currentOpenDrgElement) { + canvas.removeMarker(currentOpenDrgElement, CURRENT_OPEN_DRG_ELEMENT_MARKER); + } + } + + currentOpenDrgElementId = id; + + currentOpenDrgElement = elementRegistry.get(currentOpenDrgElementId); + + // (2) add highlight to open DRG element + if (currentOpenDrgElement) { + canvas.addMarker(currentOpenDrgElement, CURRENT_OPEN_DRG_ELEMENT_MARKER); + } + }); + + // open DRG element on click + eventBus.on('element.click', ({ element }) => { + if (!this.canOpenDrgElement(element)) { + return; + } + + const { id } = element; + + eventBus.fire('openDrgElement', { + id + }); + }); + } + + canOpenDrgElement = (element) => { + const boxedExpression = getBoxedExpression(element); + + return isAny(boxedExpression, [ 'dmn:DecisionTable', 'dmn:LiteralExpression' ]); + }; + + centerViewbox = element => { + const viewbox = this._canvas.viewbox(); + + const bBox = getBBox(element); + + const newViewbox = { + x: (bBox.x + bBox.width / 2) - viewbox.outer.width / 2, + y: (bBox.y + bBox.height / 2) - viewbox.outer.height / 2, + width: viewbox.outer.width, + height: viewbox.outer.height + }; + + this._canvas.viewbox(newViewbox); + + this._canvas.zoom(viewbox.scale); + }; +} + +OpenDrgElement.$inject = [ + 'canvas', + 'elementRegistry', + 'eventBus' +]; diff --git a/client/src/app/tabs/dmn/util/__tests__/configureSpec.js b/client/src/app/tabs/dmn/util/__tests__/configureSpec.js index 9ca55ceb26..d84ec0b3ec 100644 --- a/client/src/app/tabs/dmn/util/__tests__/configureSpec.js +++ b/client/src/app/tabs/dmn/util/__tests__/configureSpec.js @@ -17,6 +17,46 @@ describe('tabs/dmn/util - configure', function() { describe('should recognize plug-in points', function() { + it('dmn.modeler.boxedExpression.additionalModules', function() { + + // given + var module1 = { __id: 1 }; + var module2 = { __id: 2 }; + var existingModule = { __id: 'EXISTING' }; + + var getPlugins = setupPlugins([ + [ 'dmn.modeler.boxedExpression.additionalModules', module1 ], + [ 'dmn.modeler.boxedExpression.additionalModules', module2 ] + ]); + + // when + var { + options, + warnings + } = configureModeler(getPlugins, { + boxedExpression: { + additionalModules: [ + existingModule + ] + } + }); + + // then + expect(options).to.eql({ + boxedExpression: { + additionalModules: [ + existingModule, + module1, + module2 + ] + } + + }); + + expect(warnings).to.be.empty; + }); + + it('dmn.modeler.drd.additionalModules', function() { // given diff --git a/client/src/app/tabs/dmn/util/configure.js b/client/src/app/tabs/dmn/util/configure.js index a8b3cae1bb..6e161d86bd 100644 --- a/client/src/app/tabs/dmn/util/configure.js +++ b/client/src/app/tabs/dmn/util/configure.js @@ -110,6 +110,7 @@ export default function configureModeler( const middlewares = [ moddleExtensionsMiddleware, + additionalModulesMiddleware('boxedExpression'), additionalModulesMiddleware('drd'), additionalModulesMiddleware('decisionTable'), additionalModulesMiddleware('literalExpression'), diff --git a/client/src/styles/_modeling.less b/client/src/styles/_modeling.less index 91d2a72959..1d6fb77708 100644 --- a/client/src/styles/_modeling.less +++ b/client/src/styles/_modeling.less @@ -14,6 +14,8 @@ @import '~camunda-dmn-js/dist/assets/dmn-js-decision-table.css'; @import '~camunda-dmn-js/dist/assets/dmn-js-drd.css'; @import '~camunda-dmn-js/dist/assets/dmn-js-literal-expression.css'; +@import '~camunda-dmn-js/dist/assets/dmn-js-boxed-expression-controls.css'; +@import '~camunda-dmn-js/dist/assets/dmn-js-boxed-expression.css'; @import '~camunda-dmn-js/dist/assets/dmn-js-shared.css'; @import '~@camunda/linting/assets/linting.css'; diff --git a/client/test/bpmn-io-modelers/dmn/CloudDmnModelerSpec.js b/client/test/bpmn-io-modelers/dmn/CloudDmnModelerSpec.js index 6be3f8ff23..6e7e8239f2 100644 --- a/client/test/bpmn-io-modelers/dmn/CloudDmnModelerSpec.js +++ b/client/test/bpmn-io-modelers/dmn/CloudDmnModelerSpec.js @@ -317,11 +317,11 @@ describe('DmnModeler', function() { // when modeler._overview.getActiveViewer().get('eventBus').fire('openDrgElement', { - id: 'Decision_13nychf' + id: 'DecisionTable' }); // then - expect(modeler.getActiveView().element.id).to.equal('Decision_13nychf'); + expect(modeler.getActiveView().element.id).to.equal('DecisionTable'); }); @@ -344,6 +344,52 @@ describe('DmnModeler', function() { expect(spy).to.have.been.called; }); + + describe('#canOpenDrgElement', function() { + + it('should return `true` for a BKM with literal expression', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const bkm = modeler.getDefinitions().get('drgElement').find(element => element.id === 'GetTravelCost'); + + // then + expect(openDrgElement.canOpenDrgElement(bkm)).to.be.true; + }); + + + it('should return `true` for a Decision with literal expression', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const decision = modeler.getDefinitions().get('drgElement').find(element => element.id === 'LiteralExpression'); + + // then + expect(openDrgElement.canOpenDrgElement(decision)).to.be.true; + }); + + + it('should return `true` for a Decision with decision table', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const decision = modeler.getDefinitions().get('drgElement').find(element => element.id === 'DecisionTable'); + + // then + expect(openDrgElement.canOpenDrgElement(decision)).to.be.true; + }); + + + it('should return `false` for a Decision without logic', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const decision = modeler.getDefinitions().get('drgElement').find(element => element.id === 'NoLogic'); + + // then + expect(openDrgElement.canOpenDrgElement(decision)).to.be.false; + }); + }); }); diff --git a/client/test/bpmn-io-modelers/dmn/DmnModelerSpec.js b/client/test/bpmn-io-modelers/dmn/DmnModelerSpec.js index 75f53926cc..3dbc9e50a0 100644 --- a/client/test/bpmn-io-modelers/dmn/DmnModelerSpec.js +++ b/client/test/bpmn-io-modelers/dmn/DmnModelerSpec.js @@ -317,11 +317,11 @@ describe('DmnModeler', function() { // when modeler._overview.getActiveViewer().get('eventBus').fire('openDrgElement', { - id: 'Decision_13nychf' + id: 'DecisionTable' }); // then - expect(modeler.getActiveView().element.id).to.equal('Decision_13nychf'); + expect(modeler.getActiveView().element.id).to.equal('DecisionTable'); }); @@ -344,6 +344,52 @@ describe('DmnModeler', function() { expect(spy).to.have.been.called; }); + + describe('#canOpenDrgElement', function() { + + it('should return `true` for a BKM with literal expression', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const bkm = modeler.getDefinitions().get('drgElement').find(element => element.id === 'GetTravelCost'); + + // then + expect(openDrgElement.canOpenDrgElement(bkm)).to.be.true; + }); + + + it('should return `true` for a Decision with literal expression', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const decision = modeler.getDefinitions().get('drgElement').find(element => element.id === 'LiteralExpression'); + + // then + expect(openDrgElement.canOpenDrgElement(decision)).to.be.true; + }); + + + it('should return `true` for a Decision with decision table', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const decision = modeler.getDefinitions().get('drgElement').find(element => element.id === 'DecisionTable'); + + // then + expect(openDrgElement.canOpenDrgElement(decision)).to.be.true; + }); + + + it('should return `false` for a Decision without logic', async function() { + + // given + const openDrgElement = modeler._overview.getActiveViewer().get('openDrgElement'); + const decision = modeler.getDefinitions().get('drgElement').find(element => element.id === 'NoLogic'); + + // then + expect(openDrgElement.canOpenDrgElement(decision)).to.be.false; + }); + }); }); diff --git a/client/test/bpmn-io-modelers/dmn/diagram.dmn b/client/test/bpmn-io-modelers/dmn/diagram.dmn index 3d217c46fb..7e78d21441 100644 --- a/client/test/bpmn-io-modelers/dmn/diagram.dmn +++ b/client/test/bpmn-io-modelers/dmn/diagram.dmn @@ -1,6 +1,6 @@ - - + + @@ -8,19 +8,28 @@ - + + + + - + - + - + + + + + + + We decide for holidays when we agreed on season + region @@ -30,46 +39,53 @@ season + region - + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - - + + + + + + + + + - \ No newline at end of file + diff --git a/package-lock.json b/package-lock.json index 45ee6c9867..03fbbf5a6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -132,7 +132,7 @@ "camunda-bpmn-js": "^4.5.1", "camunda-bpmn-moddle": "^7.0.1", "camunda-cmmn-moddle": "^1.0.0", - "camunda-dmn-js": "^2.1.0", + "camunda-dmn-js": "^2.3.1", "camunda-dmn-moddle": "^1.3.0", "canvg": "^4.0.1", "classnames": "^2.5.1", @@ -143,8 +143,9 @@ "diagram-js": "^14.0.0", "diagram-js-direct-editing": "^2.1.2", "diagram-js-origin": "^1.4.0", - "dmn-js": "^16.0.2", + "dmn-js": "^16.3.0", "dmn-js-properties-panel": "^3.3.0", + "dmn-js-shared": "^16.3.0", "drag-tabs": "^2.3.1", "events": "^3.0.0", "formik": "2.0.4", @@ -2647,9 +2648,9 @@ "integrity": "sha512-to+unsToePnm7cUeR9TrMzFlETHd/UXmU+ELTRfWZj5XGT41KF6X3L233o3E/GdEs3sk2Tbw/lOLD1avmWkg8A==" }, "node_modules/@bpmn-io/dmn-variable-resolver": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@bpmn-io/dmn-variable-resolver/-/dmn-variable-resolver-0.4.0.tgz", - "integrity": "sha512-8dnFajGAxCg4z4Mz3sxuQSHwAk6iLJSvVwTKEtcxPy0lJLxNR6wB1DDm2+FT2c2Tboff8P7Ne4nTNqqWjD+4WA==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@bpmn-io/dmn-variable-resolver/-/dmn-variable-resolver-0.5.0.tgz", + "integrity": "sha512-PuMU8Iq94+koozmmlJ43oeT6FIBSWHqtuTANiiz94e3VTpAefN3TaTXYDIb70ggHBaq6rL05dseEkubwiB/wSg==" }, "node_modules/@bpmn-io/draggle": { "version": "4.1.0", @@ -9297,20 +9298,20 @@ "license": "MIT" }, "node_modules/camunda-dmn-js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camunda-dmn-js/-/camunda-dmn-js-2.1.0.tgz", - "integrity": "sha512-cv1laSA0ZIlhb//OGfCjxMqIcWErFXZbv4gy7vSj63e5Kk7TirUPPl4qNAATIMHc7PHRppoAtgn43KX5w2q7tA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/camunda-dmn-js/-/camunda-dmn-js-2.3.1.tgz", + "integrity": "sha512-zo6MrP3WV0dYP0mOzyzZ+HscBFsaexZ6ZWBzJjiy8DyTFE1U/Ra0DvzJG9PFsr+EZ3XvGbQGUg9mqGZbz4pKjA==", "dependencies": { "@bpmn-io/align-to-origin": "^0.7.0", "camunda-dmn-moddle": "^1.3.0", - "diagram-js": "^14.3.1", + "diagram-js": "^14.5.2", "diagram-js-grid": "^1.0.0", "diagram-js-origin": "^1.3.4", - "dmn-js-drd": "^16.0.2", + "dmn-js-drd": "^16.3.0", "min-dash": "^4.1.1" }, "peerDependencies": { - "dmn-js": "^16.0.0", + "dmn-js": "^16.1.0", "dmn-js-properties-panel": "^3.2.1", "inferno": "5.6.x" } @@ -11631,9 +11632,9 @@ "license": "MIT" }, "node_modules/diagram-js": { - "version": "14.3.1", - "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-14.3.1.tgz", - "integrity": "sha512-QXwH2kdlTP8cfWDCfYnnhvJ9PXX8UQ/M8TJaeLfcIjJPBOrfSEfLI/wuI7VNtAZZ9munlcGmCnh8hEBtcjB8kA==", + "version": "14.5.2", + "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-14.5.2.tgz", + "integrity": "sha512-FPhLYk5GCdCJD4FM3n6DA1HtjmJ29QoXFXRCMiN1GLN8tobVc3VhaA4oOh5GLkRZGnT2CG5SQ6vmv/1BSB/h5w==", "dependencies": { "@bpmn-io/diagram-js-ui": "^0.2.3", "clsx": "^2.1.0", @@ -11864,25 +11865,60 @@ } }, "node_modules/dmn-js": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/dmn-js/-/dmn-js-16.0.2.tgz", - "integrity": "sha512-BceQR7fq+KIjnsDJAwSotuPLMWLQk2uGeJu7yxYBnB01Fix+X+GDpkuvvCGa/6zTiHDGJa3XDpTsIP4BSE1XSA==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js/-/dmn-js-16.3.0.tgz", + "integrity": "sha512-CBqEkIuvGAcqZ4PtGaAMz461b00gacTkSb2SIyCVWf3qUJCSETdLmQpL4lgiLP7r0Fo5SAkYeSyEccjkQIbLqQ==", "dependencies": { - "dmn-js-decision-table": "^16.0.0", - "dmn-js-drd": "^16.0.2", - "dmn-js-literal-expression": "^16.0.0", - "dmn-js-shared": "^16.0.0" + "dmn-js-boxed-expression": "^16.3.0", + "dmn-js-decision-table": "^16.3.0", + "dmn-js-drd": "^16.3.0", + "dmn-js-literal-expression": "^16.3.0", + "dmn-js-shared": "^16.3.0" + } + }, + "node_modules/dmn-js-boxed-expression": { + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-boxed-expression/-/dmn-js-boxed-expression-16.3.0.tgz", + "integrity": "sha512-48F6zRD2728iSg6XFuvJgdo7q3u5CuumolPu9UnIfeAesYvHH6EdpycilmKiOs7/FB7vqkdGQl1MNxfGAhgLwg==", + "dependencies": { + "@bpmn-io/dmn-variable-resolver": "^0.5.0", + "diagram-js": "^14.5.2", + "dmn-js-shared": "^16.3.0", + "inferno": "~5.6.2", + "min-dash": "^4.0.0", + "min-dom": "^4.0.3", + "table-js": "^9.1.0" + } + }, + "node_modules/dmn-js-boxed-expression/node_modules/component-event": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/component-event/-/component-event-0.2.1.tgz", + "integrity": "sha512-wGA++isMqiDq1jPYeyv2as/Bt/u+3iLW0rEa+8NQ82jAv3TgqMiCM+B2SaBdn2DfLilLjjq736YcezihRYhfxw==" + }, + "node_modules/dmn-js-boxed-expression/node_modules/min-dash": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/min-dash/-/min-dash-4.2.1.tgz", + "integrity": "sha512-to+unsToePnm7cUeR9TrMzFlETHd/UXmU+ELTRfWZj5XGT41KF6X3L233o3E/GdEs3sk2Tbw/lOLD1avmWkg8A==" + }, + "node_modules/dmn-js-boxed-expression/node_modules/min-dom": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/min-dom/-/min-dom-4.1.0.tgz", + "integrity": "sha512-1lj1EyoSwY/UmTeT/hhPiZTsq+vK9D+8FAJ/53iK5jT1otkG9rJTixSKdjmTieEvdfES+sKbbTptzaQJhnacjA==", + "dependencies": { + "component-event": "^0.2.1", + "domify": "^1.4.1", + "min-dash": "^4.0.0" } }, "node_modules/dmn-js-decision-table": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dmn-js-decision-table/-/dmn-js-decision-table-16.0.0.tgz", - "integrity": "sha512-v6o0P1kLlmIavE5YGn53ywwosTzHCTAscU5wuCRQvQ8yF8/EvCvStG+pe092LJo0f5OIDZEE2eTIw+Ur9ZXslA==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-decision-table/-/dmn-js-decision-table-16.3.0.tgz", + "integrity": "sha512-zcmLMFcChCychCDH2LtPDTjxw31gyHZM6OVPzD31MuUN/DnyeCGFRSgSdXxvgUIVfecFzLmxaoEbeS9BLjvn6Q==", "dependencies": { - "@bpmn-io/dmn-variable-resolver": "^0.4.0", + "@bpmn-io/dmn-variable-resolver": "^0.5.0", "css.escape": "^1.5.1", - "diagram-js": "^14.3.1", - "dmn-js-shared": "^16.0.0", + "diagram-js": "^14.5.2", + "dmn-js-shared": "^16.3.0", "escape-html": "^1.0.3", "inferno": "~5.6.2", "min-dash": "^4.0.0", @@ -11912,13 +11948,13 @@ } }, "node_modules/dmn-js-drd": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/dmn-js-drd/-/dmn-js-drd-16.0.2.tgz", - "integrity": "sha512-Ay6tTwZ+nEYz1+qp2tNemCaYh91dHA4Y6ZvVyAO5KraTv0b5iuZsJM65fXE8yjkzdNsJL/Tg0LtfPD9ivy/ZPg==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-drd/-/dmn-js-drd-16.3.0.tgz", + "integrity": "sha512-H3EmOtLd6dgbiLf57e0UIsdv1iAKVfAPQ75fWyzmKy7pdXBgo5IPlGPTL7yaGJqQQor2P7+3hzWUrmevSa8qNg==", "dependencies": { - "diagram-js": "^14.3.1", - "diagram-js-direct-editing": "^2.1.2", - "dmn-js-shared": "^16.0.0", + "diagram-js": "^14.5.2", + "diagram-js-direct-editing": "^3.0.1", + "dmn-js-shared": "^16.3.0", "inherits-browser": "^0.1.0", "min-dash": "^4.0.0", "min-dom": "^4.0.3", @@ -11932,9 +11968,9 @@ "integrity": "sha512-wGA++isMqiDq1jPYeyv2as/Bt/u+3iLW0rEa+8NQ82jAv3TgqMiCM+B2SaBdn2DfLilLjjq736YcezihRYhfxw==" }, "node_modules/dmn-js-drd/node_modules/diagram-js-direct-editing": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/diagram-js-direct-editing/-/diagram-js-direct-editing-2.1.2.tgz", - "integrity": "sha512-VpccLAnLqLF1cp3fk363QUbRVTd/qTcj2oOb+IqgcmOiWszJp7J9Ta6y5GjUvw48hDZpzCatlmWwA4CJ3MaYGQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/diagram-js-direct-editing/-/diagram-js-direct-editing-3.0.1.tgz", + "integrity": "sha512-V44JO55nwFbsRv6tTmrfdz6fIsE3A4YIIqInaeJZyD2EongZzEo4acH9TqsE4hi9R/kAqsyttMKxTAgHplFn8w==", "dependencies": { "min-dash": "^4.0.0", "min-dom": "^4.0.2" @@ -11975,13 +12011,13 @@ "integrity": "sha512-P8T4iwiW1t95vpHVHqrD36Brn7TqFYCPSHIWk9WLJtYK1X4aDd+5cgqcAADIWSjf1/i5idKnpCh9mim8hEdRBg==" }, "node_modules/dmn-js-literal-expression": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dmn-js-literal-expression/-/dmn-js-literal-expression-16.0.0.tgz", - "integrity": "sha512-7zjvuMiSYix6DQm2407CWE++ZnvzoG34FtRsPMOP1AtJyZTKETmW9I9VialpzrEMIyvskLwT+ITNpy4lGMJnog==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-literal-expression/-/dmn-js-literal-expression-16.3.0.tgz", + "integrity": "sha512-8L6CbgL79czszNS6KcQDZU4P04pEHhmPPZXIDmgCC7IFblmdUGCGeFrNULDNKPLssg8b/yRt0vGAuWGdSnWd6A==", "dependencies": { - "@bpmn-io/dmn-variable-resolver": "^0.4.0", - "diagram-js": "^14.3.1", - "dmn-js-shared": "^16.0.0", + "@bpmn-io/dmn-variable-resolver": "^0.5.0", + "diagram-js": "^14.5.2", + "dmn-js-shared": "^16.3.0", "escape-html": "^1.0.3", "inferno": "~5.6.2", "min-dash": "^4.0.0", @@ -12047,12 +12083,12 @@ } }, "node_modules/dmn-js-shared": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dmn-js-shared/-/dmn-js-shared-16.0.0.tgz", - "integrity": "sha512-gsG9rgl6aIZoPPdRW3lN+m+1P7A/pEqowPX/ghxNR6xcpGkp+BEAaviBQka6CWECdYQX8VkzchP9NvoxtLz3oA==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-shared/-/dmn-js-shared-16.3.0.tgz", + "integrity": "sha512-rvW0uNaufyiSpVErYQRhIziyuG8sNWoAmVgv7mDL2nA9nsMM9sekSJ1+7Tdz1pGEgxDPTjwFb2c3irQT90PgDA==", "dependencies": { "@bpmn-io/feel-editor": "^1.3.0", - "diagram-js": "^14.3.1", + "diagram-js": "^14.5.2", "didi": "^10.2.2", "dmn-moddle": "^10.0.0", "ids": "^1.0.5", @@ -33029,9 +33065,9 @@ } }, "@bpmn-io/dmn-variable-resolver": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@bpmn-io/dmn-variable-resolver/-/dmn-variable-resolver-0.4.0.tgz", - "integrity": "sha512-8dnFajGAxCg4z4Mz3sxuQSHwAk6iLJSvVwTKEtcxPy0lJLxNR6wB1DDm2+FT2c2Tboff8P7Ne4nTNqqWjD+4WA==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@bpmn-io/dmn-variable-resolver/-/dmn-variable-resolver-0.5.0.tgz", + "integrity": "sha512-PuMU8Iq94+koozmmlJ43oeT6FIBSWHqtuTANiiz94e3VTpAefN3TaTXYDIb70ggHBaq6rL05dseEkubwiB/wSg==" }, "@bpmn-io/draggle": { "version": "4.1.0", @@ -38002,16 +38038,16 @@ "version": "1.0.0" }, "camunda-dmn-js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camunda-dmn-js/-/camunda-dmn-js-2.1.0.tgz", - "integrity": "sha512-cv1laSA0ZIlhb//OGfCjxMqIcWErFXZbv4gy7vSj63e5Kk7TirUPPl4qNAATIMHc7PHRppoAtgn43KX5w2q7tA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/camunda-dmn-js/-/camunda-dmn-js-2.3.1.tgz", + "integrity": "sha512-zo6MrP3WV0dYP0mOzyzZ+HscBFsaexZ6ZWBzJjiy8DyTFE1U/Ra0DvzJG9PFsr+EZ3XvGbQGUg9mqGZbz4pKjA==", "requires": { "@bpmn-io/align-to-origin": "^0.7.0", "camunda-dmn-moddle": "^1.3.0", - "diagram-js": "^14.3.1", + "diagram-js": "^14.5.2", "diagram-js-grid": "^1.0.0", "diagram-js-origin": "^1.3.4", - "dmn-js-drd": "^16.0.2", + "dmn-js-drd": "^16.3.0", "min-dash": "^4.1.1" }, "dependencies": { @@ -38115,7 +38151,7 @@ "camunda-bpmn-js": "^4.5.1", "camunda-bpmn-moddle": "^7.0.1", "camunda-cmmn-moddle": "^1.0.0", - "camunda-dmn-js": "^2.1.0", + "camunda-dmn-js": "^2.3.1", "camunda-dmn-moddle": "^1.3.0", "canvg": "^4.0.1", "case-sensitive-paths-webpack-plugin": "^2.1.2", @@ -38132,8 +38168,9 @@ "diagram-js": "^14.0.0", "diagram-js-direct-editing": "^2.1.2", "diagram-js-origin": "^1.4.0", - "dmn-js": "^16.0.2", + "dmn-js": "^16.3.0", "dmn-js-properties-panel": "^3.3.0", + "dmn-js-shared": "^16.3.0", "drag-tabs": "^2.3.1", "enzyme": "^3.9.0", "enzyme-adapter-react-16": "^1.12.1", @@ -40114,9 +40151,9 @@ "dev": true }, "diagram-js": { - "version": "14.3.1", - "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-14.3.1.tgz", - "integrity": "sha512-QXwH2kdlTP8cfWDCfYnnhvJ9PXX8UQ/M8TJaeLfcIjJPBOrfSEfLI/wuI7VNtAZZ9munlcGmCnh8hEBtcjB8kA==", + "version": "14.5.2", + "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-14.5.2.tgz", + "integrity": "sha512-FPhLYk5GCdCJD4FM3n6DA1HtjmJ29QoXFXRCMiN1GLN8tobVc3VhaA4oOh5GLkRZGnT2CG5SQ6vmv/1BSB/h5w==", "requires": { "@bpmn-io/diagram-js-ui": "^0.2.3", "clsx": "^2.1.0", @@ -40306,25 +40343,62 @@ } }, "dmn-js": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/dmn-js/-/dmn-js-16.0.2.tgz", - "integrity": "sha512-BceQR7fq+KIjnsDJAwSotuPLMWLQk2uGeJu7yxYBnB01Fix+X+GDpkuvvCGa/6zTiHDGJa3XDpTsIP4BSE1XSA==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js/-/dmn-js-16.3.0.tgz", + "integrity": "sha512-CBqEkIuvGAcqZ4PtGaAMz461b00gacTkSb2SIyCVWf3qUJCSETdLmQpL4lgiLP7r0Fo5SAkYeSyEccjkQIbLqQ==", + "requires": { + "dmn-js-boxed-expression": "^16.3.0", + "dmn-js-decision-table": "^16.3.0", + "dmn-js-drd": "^16.3.0", + "dmn-js-literal-expression": "^16.3.0", + "dmn-js-shared": "^16.3.0" + } + }, + "dmn-js-boxed-expression": { + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-boxed-expression/-/dmn-js-boxed-expression-16.3.0.tgz", + "integrity": "sha512-48F6zRD2728iSg6XFuvJgdo7q3u5CuumolPu9UnIfeAesYvHH6EdpycilmKiOs7/FB7vqkdGQl1MNxfGAhgLwg==", "requires": { - "dmn-js-decision-table": "^16.0.0", - "dmn-js-drd": "^16.0.2", - "dmn-js-literal-expression": "^16.0.0", - "dmn-js-shared": "^16.0.0" + "@bpmn-io/dmn-variable-resolver": "^0.5.0", + "diagram-js": "^14.5.2", + "dmn-js-shared": "^16.3.0", + "inferno": "~5.6.2", + "min-dash": "^4.0.0", + "min-dom": "^4.0.3", + "table-js": "^9.1.0" + }, + "dependencies": { + "component-event": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/component-event/-/component-event-0.2.1.tgz", + "integrity": "sha512-wGA++isMqiDq1jPYeyv2as/Bt/u+3iLW0rEa+8NQ82jAv3TgqMiCM+B2SaBdn2DfLilLjjq736YcezihRYhfxw==" + }, + "min-dash": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/min-dash/-/min-dash-4.2.1.tgz", + "integrity": "sha512-to+unsToePnm7cUeR9TrMzFlETHd/UXmU+ELTRfWZj5XGT41KF6X3L233o3E/GdEs3sk2Tbw/lOLD1avmWkg8A==" + }, + "min-dom": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/min-dom/-/min-dom-4.1.0.tgz", + "integrity": "sha512-1lj1EyoSwY/UmTeT/hhPiZTsq+vK9D+8FAJ/53iK5jT1otkG9rJTixSKdjmTieEvdfES+sKbbTptzaQJhnacjA==", + "requires": { + "component-event": "^0.2.1", + "domify": "^1.4.1", + "min-dash": "^4.0.0" + } + } } }, "dmn-js-decision-table": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dmn-js-decision-table/-/dmn-js-decision-table-16.0.0.tgz", - "integrity": "sha512-v6o0P1kLlmIavE5YGn53ywwosTzHCTAscU5wuCRQvQ8yF8/EvCvStG+pe092LJo0f5OIDZEE2eTIw+Ur9ZXslA==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-decision-table/-/dmn-js-decision-table-16.3.0.tgz", + "integrity": "sha512-zcmLMFcChCychCDH2LtPDTjxw31gyHZM6OVPzD31MuUN/DnyeCGFRSgSdXxvgUIVfecFzLmxaoEbeS9BLjvn6Q==", "requires": { - "@bpmn-io/dmn-variable-resolver": "^0.4.0", + "@bpmn-io/dmn-variable-resolver": "^0.5.0", "css.escape": "^1.5.1", - "diagram-js": "^14.3.1", - "dmn-js-shared": "^16.0.0", + "diagram-js": "^14.5.2", + "dmn-js-shared": "^16.3.0", "escape-html": "^1.0.3", "inferno": "~5.6.2", "min-dash": "^4.0.0", @@ -40356,13 +40430,13 @@ } }, "dmn-js-drd": { - "version": "16.0.2", - "resolved": "https://registry.npmjs.org/dmn-js-drd/-/dmn-js-drd-16.0.2.tgz", - "integrity": "sha512-Ay6tTwZ+nEYz1+qp2tNemCaYh91dHA4Y6ZvVyAO5KraTv0b5iuZsJM65fXE8yjkzdNsJL/Tg0LtfPD9ivy/ZPg==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-drd/-/dmn-js-drd-16.3.0.tgz", + "integrity": "sha512-H3EmOtLd6dgbiLf57e0UIsdv1iAKVfAPQ75fWyzmKy7pdXBgo5IPlGPTL7yaGJqQQor2P7+3hzWUrmevSa8qNg==", "requires": { - "diagram-js": "^14.3.1", - "diagram-js-direct-editing": "^2.1.2", - "dmn-js-shared": "^16.0.0", + "diagram-js": "^14.5.2", + "diagram-js-direct-editing": "^3.0.1", + "dmn-js-shared": "^16.3.0", "inherits-browser": "^0.1.0", "min-dash": "^4.0.0", "min-dom": "^4.0.3", @@ -40376,9 +40450,9 @@ "integrity": "sha512-wGA++isMqiDq1jPYeyv2as/Bt/u+3iLW0rEa+8NQ82jAv3TgqMiCM+B2SaBdn2DfLilLjjq736YcezihRYhfxw==" }, "diagram-js-direct-editing": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/diagram-js-direct-editing/-/diagram-js-direct-editing-2.1.2.tgz", - "integrity": "sha512-VpccLAnLqLF1cp3fk363QUbRVTd/qTcj2oOb+IqgcmOiWszJp7J9Ta6y5GjUvw48hDZpzCatlmWwA4CJ3MaYGQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/diagram-js-direct-editing/-/diagram-js-direct-editing-3.0.1.tgz", + "integrity": "sha512-V44JO55nwFbsRv6tTmrfdz6fIsE3A4YIIqInaeJZyD2EongZzEo4acH9TqsE4hi9R/kAqsyttMKxTAgHplFn8w==", "requires": { "min-dash": "^4.0.0", "min-dom": "^4.0.2" @@ -40412,13 +40486,13 @@ } }, "dmn-js-literal-expression": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dmn-js-literal-expression/-/dmn-js-literal-expression-16.0.0.tgz", - "integrity": "sha512-7zjvuMiSYix6DQm2407CWE++ZnvzoG34FtRsPMOP1AtJyZTKETmW9I9VialpzrEMIyvskLwT+ITNpy4lGMJnog==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-literal-expression/-/dmn-js-literal-expression-16.3.0.tgz", + "integrity": "sha512-8L6CbgL79czszNS6KcQDZU4P04pEHhmPPZXIDmgCC7IFblmdUGCGeFrNULDNKPLssg8b/yRt0vGAuWGdSnWd6A==", "requires": { - "@bpmn-io/dmn-variable-resolver": "^0.4.0", - "diagram-js": "^14.3.1", - "dmn-js-shared": "^16.0.0", + "@bpmn-io/dmn-variable-resolver": "^0.5.0", + "diagram-js": "^14.5.2", + "dmn-js-shared": "^16.3.0", "escape-html": "^1.0.3", "inferno": "~5.6.2", "min-dash": "^4.0.0", @@ -40481,12 +40555,12 @@ } }, "dmn-js-shared": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dmn-js-shared/-/dmn-js-shared-16.0.0.tgz", - "integrity": "sha512-gsG9rgl6aIZoPPdRW3lN+m+1P7A/pEqowPX/ghxNR6xcpGkp+BEAaviBQka6CWECdYQX8VkzchP9NvoxtLz3oA==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/dmn-js-shared/-/dmn-js-shared-16.3.0.tgz", + "integrity": "sha512-rvW0uNaufyiSpVErYQRhIziyuG8sNWoAmVgv7mDL2nA9nsMM9sekSJ1+7Tdz1pGEgxDPTjwFb2c3irQT90PgDA==", "requires": { "@bpmn-io/feel-editor": "^1.3.0", - "diagram-js": "^14.3.1", + "diagram-js": "^14.5.2", "didi": "^10.2.2", "dmn-moddle": "^10.0.0", "ids": "^1.0.5", diff --git a/resources/plugins/test-editor-events/client/TestEditorEvents.js b/resources/plugins/test-editor-events/client/TestEditorEvents.js index 4581622e11..464c7cb427 100644 --- a/resources/plugins/test-editor-events/client/TestEditorEvents.js +++ b/resources/plugins/test-editor-events/client/TestEditorEvents.js @@ -130,7 +130,7 @@ function addDmnModule(extensionModule) { return (config) => { const newConfig = { ...config }; - for (const viewer of [ 'drd', 'decisionTable', 'literalExpression' ]) { + for (const viewer of [ 'drd', 'decisionTable', 'literalExpression', 'boxedExpression' ]) { newConfig[viewer] = newConfig[viewer] || {}; const additionalModules = (newConfig[viewer] && newConfig[viewer].additionalModules) || [];