From 6214772b8519cb82f61c4867b16c112bc6344922 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 7 Dec 2021 22:31:48 +0100 Subject: [PATCH] feat(modeling): don't select start-event inside newly created sub-process The canonical modeling operation shall not be drill down, but continue to model. --- lib/features/palette/PaletteProvider.js | 2 +- test/spec/features/palette/PaletteProviderSpec.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/features/palette/PaletteProvider.js b/lib/features/palette/PaletteProvider.js index 9c2227c5..198a4526 100644 --- a/lib/features/palette/PaletteProvider.js +++ b/lib/features/palette/PaletteProvider.js @@ -90,7 +90,7 @@ PaletteProvider.prototype.getPaletteEntries = function(element) { create.start(event, [ subProcess, startEvent ], { hints: { - autoSelect: [ startEvent ] + autoSelect: [ subProcess ] } }); } diff --git a/test/spec/features/palette/PaletteProviderSpec.js b/test/spec/features/palette/PaletteProviderSpec.js index 444860dd..59149d8d 100644 --- a/test/spec/features/palette/PaletteProviderSpec.js +++ b/test/spec/features/palette/PaletteProviderSpec.js @@ -65,7 +65,7 @@ describe('features/palette', function() { })); - it('should select start event', inject(function(canvas, dragging, selection) { + it('should select sub-process', inject(function(canvas, dragging, selection) { // given var rootElement = canvas.getRootElement(), @@ -82,8 +82,10 @@ describe('features/palette', function() { dragging.end(); // then - expect(selection.get()).to.have.length(1); - expect(is(selection.get()[0], 'bpmn:StartEvent')).to.be.true; + var selected = selection.get(); + + expect(selected).to.have.length(1); + expect(is(selected[0], 'bpmn:SubProcess')).to.be.true; })); });