From f5ebd7df36633b36937a2c0ebd55624f45cdc822 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 11 Oct 2023 10:11:17 +0200 Subject: [PATCH 1/2] deps: update diagram-js to v12.4.0 Closes #557 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d02577606..dbcf21e96b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "SEE LICENSE IN LICENSE", "dependencies": { "bpmn-moddle": "^8.0.1", - "diagram-js": "^12.3.0", + "diagram-js": "^12.4.0", "diagram-js-direct-editing": "^2.0.0", "ids": "^1.0.3", "inherits-browser": "^0.1.0", @@ -3259,9 +3259,9 @@ "dev": true }, "node_modules/diagram-js": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-12.3.0.tgz", - "integrity": "sha512-sE9MieoQiifVGPPztVjdDYdU1oJEztN1gG0RksCBNYH0rOTpEnAw4hmRdBqrDsdJen08EmFGfcoTbeZ9W2NCqA==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-12.4.0.tgz", + "integrity": "sha512-13FdUkX+HsAnOmfiFtmdPUB3qImsy3ulwLWJ4qZCCY3p4GyTTWSDfsFnowr34CDtBIfpo4HVF9HGIRh9z/a6+A==", "dependencies": { "@bpmn-io/diagram-js-ui": "^0.2.2", "clsx": "^2.0.0", @@ -16504,9 +16504,9 @@ "dev": true }, "diagram-js": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-12.3.0.tgz", - "integrity": "sha512-sE9MieoQiifVGPPztVjdDYdU1oJEztN1gG0RksCBNYH0rOTpEnAw4hmRdBqrDsdJen08EmFGfcoTbeZ9W2NCqA==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/diagram-js/-/diagram-js-12.4.0.tgz", + "integrity": "sha512-13FdUkX+HsAnOmfiFtmdPUB3qImsy3ulwLWJ4qZCCY3p4GyTTWSDfsFnowr34CDtBIfpo4HVF9HGIRh9z/a6+A==", "requires": { "@bpmn-io/diagram-js-ui": "^0.2.2", "clsx": "^2.0.0", diff --git a/package.json b/package.json index 81e9741fd6..4745cebf36 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ }, "dependencies": { "bpmn-moddle": "^8.0.1", - "diagram-js": "^12.3.0", + "diagram-js": "^12.4.0", "diagram-js-direct-editing": "^2.0.0", "ids": "^1.0.3", "inherits-browser": "^0.1.0", From 76b134ee1d3b6ec918f131f69ef1ed4a9cb95e35 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 11 Oct 2023 10:12:40 +0200 Subject: [PATCH 2/2] fix: ensure lanes aren't resized when using space tool --- .../modeling/behavior/FixHoverBehavior.js | 10 +++++ .../modeling/behavior/FixHoverBehaviorSpec.js | 42 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/lib/features/modeling/behavior/FixHoverBehavior.js b/lib/features/modeling/behavior/FixHoverBehavior.js index 48f55421b0..554495cc8c 100644 --- a/lib/features/modeling/behavior/FixHoverBehavior.js +++ b/lib/features/modeling/behavior/FixHoverBehavior.js @@ -114,6 +114,16 @@ export default function FixHoverBehavior(elementRegistry, eventBus, canvas) { } }); + // ensure lanes aren't resized without their parent participant when using + // space tool + eventBus.on('spaceTool.move', HIGHEST_PRIORITY, function(event) { + var hover = event.hover; + + if (hover && is(hover, 'bpmn:Lane')) { + event.hover = getLanesRoot(hover); + } + }); + } FixHoverBehavior.$inject = [ diff --git a/test/spec/features/modeling/behavior/FixHoverBehaviorSpec.js b/test/spec/features/modeling/behavior/FixHoverBehaviorSpec.js index 4caec34364..49b078f5a0 100644 --- a/test/spec/features/modeling/behavior/FixHoverBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/FixHoverBehaviorSpec.js @@ -613,4 +613,46 @@ describe('features/modeling/behavior - fix hover', function() { }); + + describe('space tool', function() { + + var diagramXML = require('./FixHoverBehavior.participant.bpmn'); + + beforeEach(bootstrapModeler(diagramXML, { + modules: testModules + })); + + beforeEach(inject(function(dragging) { + dragging.setOptions({ manual: true }); + })); + + + it('should participant', inject( + function(dragging, elementRegistry, spaceTool) { + + // given + var lane = elementRegistry.get('Lane_1'), + participant = elementRegistry.get('Participant_1'); + + spaceTool.activateMakeSpace(canvasEvent({ x: 150, y: 0 })); + + expect(participant.width).to.equal(600); + + // when + dragging.hover({ element: lane }); + + dragging.move(canvasEvent({ x: 250, y: 0 }, { + button: 0, + shiftKey: true + })); + + dragging.end(); + + // then + expect(participant.width).to.equal(700); + } + )); + + }); + }); \ No newline at end of file