From 2fff30a2848fb3e2b9f4419d48602702d1f8d486 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Mon, 25 Mar 2019 16:43:41 +0100 Subject: [PATCH] feat(label-editing): support data input/output Related to #951 --- lib/features/label-editing/LabelUtil.js | 15 ++++++++----- .../features/label-editing/LabelEditing.bpmn | 22 +++++++++++++++++++ .../label-editing/LabelEditingProviderSpec.js | 7 ++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/lib/features/label-editing/LabelUtil.js b/lib/features/label-editing/LabelUtil.js index 0e91e675..3432aa8c 100644 --- a/lib/features/label-editing/LabelUtil.js +++ b/lib/features/label-editing/LabelUtil.js @@ -1,12 +1,15 @@ import { is } from '../../util/ModelUtil'; function getLabelAttr(semantic) { - if (is(semantic, 'bpmn:FlowElement') || - is(semantic, 'bpmn:Participant') || - is(semantic, 'bpmn:Lane') || - is(semantic, 'bpmn:SequenceFlow') || - is(semantic, 'bpmn:MessageFlow')) { - + if ( + is(semantic, 'bpmn:FlowElement') || + is(semantic, 'bpmn:Participant') || + is(semantic, 'bpmn:Lane') || + is(semantic, 'bpmn:SequenceFlow') || + is(semantic, 'bpmn:MessageFlow') || + is(semantic, 'bpmn:DataInput') || + is(semantic, 'bpmn:DataOutput') + ) { return 'name'; } diff --git a/test/spec/features/label-editing/LabelEditing.bpmn b/test/spec/features/label-editing/LabelEditing.bpmn index 0c70e0bf..1e7d66a7 100644 --- a/test/spec/features/label-editing/LabelEditing.bpmn +++ b/test/spec/features/label-editing/LabelEditing.bpmn @@ -21,6 +21,16 @@ EndEvent_1 + + + + + DataInput + + + DataOutput + + SequenceFlow_2 @@ -173,6 +183,18 @@ + + + + + + + + + + + + diff --git a/test/spec/features/label-editing/LabelEditingProviderSpec.js b/test/spec/features/label-editing/LabelEditingProviderSpec.js index ed47cc70..2668401d 100644 --- a/test/spec/features/label-editing/LabelEditingProviderSpec.js +++ b/test/spec/features/label-editing/LabelEditingProviderSpec.js @@ -22,6 +22,7 @@ describe('features - label-editing', function() { var diagramXML = require('./LabelEditing.bpmn'); + describe('basics', function() { beforeEach(bootstrapModeler(diagramXML, { @@ -405,7 +406,13 @@ describe('features - label-editing', function() { it('lane without label', directEdit('Lane_2')); + + it('data input', directEdit('DataInput')); + + it('data output', directEdit('DataOutput')); + }); + });