From b100cdfa0b2951cc9b3d5542ebd03cb0d9bfd2cb Mon Sep 17 00:00:00 2001 From: Daniel <150448993+sombrek@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:04:42 +0100 Subject: [PATCH] fix: support rendering of gateway without marker --- lib/features/modeling/ElementFactory.js | 6 ++---- lib/features/palette/PaletteProvider.js | 3 +-- test/spec/features/modeling/ElementFactorySpec.js | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/features/modeling/ElementFactory.js b/lib/features/modeling/ElementFactory.js index 8aa486d30d..3679fbf460 100644 --- a/lib/features/modeling/ElementFactory.js +++ b/lib/features/modeling/ElementFactory.js @@ -216,11 +216,9 @@ ElementFactory.prototype.createElement = function(elementType, attrs) { } if (is(businessObject, 'bpmn:ExclusiveGateway')) { - if (has(attrs, 'isMarkerVisible')) { - if (attrs.isMarkerVisible === undefined) { + if (has(di, 'isMarkerVisible')) { + if (di.isMarkerVisible === undefined) { di.isMarkerVisible = false; - } else { - attrs = applyAttribute(di, attrs, 'isMarkerVisible'); } } else { di.isMarkerVisible = true; diff --git a/lib/features/palette/PaletteProvider.js b/lib/features/palette/PaletteProvider.js index 36d136c01d..707af314d5 100644 --- a/lib/features/palette/PaletteProvider.js +++ b/lib/features/palette/PaletteProvider.js @@ -172,8 +172,7 @@ PaletteProvider.prototype.getPaletteEntries = function() { ), 'create.exclusive-gateway': createAction( 'bpmn:ExclusiveGateway', 'gateway', 'bpmn-icon-gateway-none', - translate('Create gateway'), - { isMarkerVisible: true } + translate('Create gateway') ), 'create.task': createAction( 'bpmn:Task', 'activity', 'bpmn-icon-task', diff --git a/test/spec/features/modeling/ElementFactorySpec.js b/test/spec/features/modeling/ElementFactorySpec.js index 0c910fb553..87c45cab5c 100644 --- a/test/spec/features/modeling/ElementFactorySpec.js +++ b/test/spec/features/modeling/ElementFactorySpec.js @@ -212,7 +212,7 @@ describe('features - element factory', function() { // when var shape = elementFactory.createShape({ type: 'bpmn:ExclusiveGateway', - isMarkerVisible: true + di: { isMarkerVisible: true } }); // then @@ -225,7 +225,7 @@ describe('features - element factory', function() { // when var shape = elementFactory.createShape({ type: 'bpmn:ExclusiveGateway', - isMarkerVisible: false + di: { isMarkerVisible: false } }); // then