chore(modeling): update BpmnUpdater to hook into element.updateAttachment
BREAKING CHANGE: * The id of the update attachment command changed from 'shape.attach' to 'element.updateAttachment'
This commit is contained in:
parent
fd3afbb508
commit
e237937726
|
@ -154,8 +154,8 @@ function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
|
|||
self.updateAttachment(e.context);
|
||||
}
|
||||
|
||||
this.executed([ 'shape.attach' ], updateAttachment);
|
||||
this.reverted([ 'shape.attach' ], updateAttachment);
|
||||
this.executed([ 'element.updateAttachment' ], updateAttachment);
|
||||
this.reverted([ 'element.updateAttachment' ], updateAttachment);
|
||||
}
|
||||
|
||||
inherits(BpmnUpdater, CommandInterceptor);
|
||||
|
|
|
@ -9,7 +9,7 @@ var modelingModule = require('../../../../lib/features/modeling'),
|
|||
coreModule = require('../../../../lib/core');
|
||||
|
||||
|
||||
describe('features/modeling - attach shape', function() {
|
||||
describe('features/modeling - update attachment', function() {
|
||||
|
||||
var diagramXML = require('../../../fixtures/bpmn/boundary-events.bpmn');
|
||||
|
||||
|
@ -39,12 +39,12 @@ describe('features/modeling - attach shape', function() {
|
|||
}));
|
||||
|
||||
|
||||
describe('shape', function() {
|
||||
describe('should reattach BoundaryEvent', function() {
|
||||
|
||||
it('should reattach', inject(function(modeling, elementRegistry) {
|
||||
it('execute', inject(function(modeling, elementRegistry) {
|
||||
|
||||
// when
|
||||
modeling.updateAttachment(boundaryEventElement, subProcessElement, true);
|
||||
modeling.updateAttachment(boundaryEventElement, subProcessElement);
|
||||
|
||||
// then
|
||||
expect(boundaryEvent.attachedToRef).to.equal(subProcess);
|
||||
|
@ -56,10 +56,10 @@ describe('features/modeling - attach shape', function() {
|
|||
}));
|
||||
|
||||
|
||||
it('should undo', inject(function(elementRegistry, commandStack, modeling) {
|
||||
it('undo', inject(function(elementRegistry, commandStack, modeling) {
|
||||
|
||||
// given
|
||||
modeling.updateAttachment(boundaryEventElement, subProcessElement, true);
|
||||
modeling.updateAttachment(boundaryEventElement, subProcessElement);
|
||||
|
||||
// when
|
||||
commandStack.undo();
|
||||
|
@ -73,10 +73,10 @@ describe('features/modeling - attach shape', function() {
|
|||
}));
|
||||
|
||||
|
||||
it('should redo', inject(function(elementRegistry, commandStack, modeling) {
|
||||
it('redo', inject(function(elementRegistry, commandStack, modeling) {
|
||||
|
||||
// given
|
||||
modeling.updateAttachment(boundaryEventElement, subProcessElement, true);
|
||||
modeling.updateAttachment(boundaryEventElement, subProcessElement);
|
||||
|
||||
// when
|
||||
commandStack.undo();
|
Loading…
Reference in New Issue