Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Local Space Tool #1972

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/features/modeling/behavior/FixHoverBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ export default function FixHoverBehavior(elementRegistry, eventBus, canvas) {
}
});

// ensure lanes aren't resized without their parent participant when using
// space tool
eventBus.on('spaceTool.move', HIGHEST_PRIORITY, function(event) {
var hover = event.hover;

if (hover && is(hover, 'bpmn:Lane')) {
event.hover = getLanesRoot(hover);
}
});

}

FixHoverBehavior.$inject = [
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
},
"dependencies": {
"bpmn-moddle": "^8.0.1",
"diagram-js": "^12.3.0",
"diagram-js": "^12.4.0",
"diagram-js-direct-editing": "^2.0.0",
"ids": "^1.0.3",
"inherits-browser": "^0.1.0",
Expand Down
42 changes: 42 additions & 0 deletions test/spec/features/modeling/behavior/FixHoverBehaviorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,46 @@ describe('features/modeling/behavior - fix hover', function() {

});


describe('space tool', function() {

var diagramXML = require('./FixHoverBehavior.participant.bpmn');

beforeEach(bootstrapModeler(diagramXML, {
modules: testModules
}));

beforeEach(inject(function(dragging) {
dragging.setOptions({ manual: true });
}));


it('should <spaceTool.move> participant', inject(
function(dragging, elementRegistry, spaceTool) {

// given
var lane = elementRegistry.get('Lane_1'),
participant = elementRegistry.get('Participant_1');

spaceTool.activateMakeSpace(canvasEvent({ x: 150, y: 0 }));

expect(participant.width).to.equal(600);

// when
dragging.hover({ element: lane });

dragging.move(canvasEvent({ x: 250, y: 0 }, {
button: 0,
shiftKey: true
}));

dragging.end();

// then
expect(participant.width).to.equal(700);
}
));

});

});