From f6f9ac29f2aba2d8c26de3a47b4e4c6df911722b Mon Sep 17 00:00:00 2001 From: Niklas Kiefer Date: Wed, 22 May 2019 08:40:35 +0200 Subject: [PATCH] chore(draw): remove internal label for groups --- lib/draw/BpmnRenderer.js | 23 ++++++----------------- test/spec/draw/BpmnRendererSpec.js | 17 ----------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 455b6c05..936683b3 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -13,6 +13,10 @@ import { isEventSubProcess } from '../util/DiUtil'; +import { + getLabel +} from '../features/label-editing/LabelUtil'; + import { is } from '../util/ModelUtil'; import { @@ -472,7 +476,7 @@ export default function BpmnRenderer( } function renderExternalLabel(parentGfx, element) { - var semantic = getSemantic(element); + var box = { width: 90, height: 30, @@ -480,7 +484,7 @@ export default function BpmnRenderer( y: element.height / 2 + element.y }; - return renderLabel(parentGfx, semantic.name, { + return renderLabel(parentGfx, getLabel(element), { box: box, fitBox: true, style: assign( @@ -1580,8 +1584,6 @@ export default function BpmnRenderer( return outer; }, 'bpmn:Group': function(parentGfx, element) { - var semantic = getSemantic(element), - di = getDi(element); var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, { strokeWidth: 1, @@ -1590,19 +1592,6 @@ export default function BpmnRenderer( pointerEvents: 'none' }); - var categoryValueRef = semantic.categoryValueRef || {}; - - if (categoryValueRef.value) { - var box = di.label ? di.label.bounds : element; - - renderLabel(parentGfx, categoryValueRef.value, { - box: box, - style: { - fill: getStrokeColor(element, defaultStrokeColor) - } - }); - } - return group; }, 'label': function(parentGfx, element) { diff --git a/test/spec/draw/BpmnRendererSpec.js b/test/spec/draw/BpmnRendererSpec.js index 2336c611..1f6d88fc 100644 --- a/test/spec/draw/BpmnRendererSpec.js +++ b/test/spec/draw/BpmnRendererSpec.js @@ -123,23 +123,6 @@ describe('draw - bpmn renderer', function() { }); - it('should render group name', function(done) { - var xml = require('../../fixtures/bpmn/draw/group-name.bpmn'); - - bootstrapViewer(xml).call(this, function(err) { - - inject(function(elementRegistry) { - - var groupGfx = elementRegistry.getGraphics('Group_1'); - - expect(domQuery('.djs-label', groupGfx)).to.exist; - - done(err); - })(); - }); - }); - - it('should render message marker', function(done) { var xml = require('../../fixtures/bpmn/draw/message-marker.bpmn'); bootstrapViewer(xml).call(this, checkErrors(done));