feat: select participant by click but not move

Related to https://github.com/camunda/camunda-modeler/issues/2859
This commit is contained in:
Maciej Barelkowski 2022-05-16 09:39:28 +02:00 committed by Nico Rehwaldt
parent 29941e63a4
commit 1b7ce15d2e
2 changed files with 19 additions and 3 deletions

View File

@ -68,6 +68,12 @@ BpmnInteractionEvents.prototype.createParticipantHit = function(element, gfx) {
// remove existing hits
this._interactionEvents.removeHits(gfx);
// add body hit
this._interactionEvents.createBoxHit(gfx, 'no-move', {
width: element.width,
height: element.height
});
// add outline hit
this._interactionEvents.createBoxHit(gfx, 'click-stroke', {
width: element.width,
@ -89,6 +95,12 @@ BpmnInteractionEvents.prototype.createSubProcessHit = function(element, gfx) {
// remove existing hits
this._interactionEvents.removeHits(gfx);
// add body hit
this._interactionEvents.createBoxHit(gfx, 'no-move', {
width: element.width,
height: element.height
});
// add outline hit
this._interactionEvents.createBoxHit(gfx, 'click-stroke', {
width: element.width,

View File

@ -25,6 +25,7 @@ var testModules = [
var HIT_ALL_CLS = 'djs-hit-all';
var HIT_CLICK_STROKE_CLS = 'djs-hit-click-stroke';
var HIT_NO_MOVE_CLS = 'djs-hit-no-move';
describe('features/interaction-events', function() {
@ -42,7 +43,7 @@ describe('features/interaction-events', function() {
}));
it('should create two hit zones per participant', inject(function(elementRegistry) {
it('should create THREE hit zones per participant', inject(function(elementRegistry) {
// given
var participant = elementRegistry.get('Participant_1');
@ -50,10 +51,11 @@ describe('features/interaction-events', function() {
// then
expectToHaveChildren(HIT_ALL_CLS, 1, participant);
expectToHaveChildren(HIT_CLICK_STROKE_CLS, 1, participant);
expectToHaveChildren(HIT_NO_MOVE_CLS, 1, participant);
}));
it('should create two hit zones per lane', inject(function(elementRegistry) {
it('should create THREE hit zones per lane', inject(function(elementRegistry) {
// given
var lane = elementRegistry.get('Lane_1');
@ -61,6 +63,7 @@ describe('features/interaction-events', function() {
// then
expectToHaveChildren(HIT_ALL_CLS, 1, lane);
expectToHaveChildren(HIT_CLICK_STROKE_CLS, 1, lane);
expectToHaveChildren(HIT_NO_MOVE_CLS, 1, lane);
}));
@ -98,7 +101,7 @@ describe('features/interaction-events', function() {
}));
it('should create two hit zones per sub process', inject(function(elementRegistry) {
it('should create THREE hit zones per sub process', inject(function(elementRegistry) {
// given
var subProcess = elementRegistry.get('SubProcess_1');
@ -106,6 +109,7 @@ describe('features/interaction-events', function() {
// then
expectToHaveChildren(HIT_ALL_CLS, 1, subProcess);
expectToHaveChildren(HIT_CLICK_STROKE_CLS, 1, subProcess);
expectToHaveChildren(HIT_NO_MOVE_CLS, 1, subProcess);
}));