Skip to content

Commit

Permalink
feat: select participant by click but not move
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed May 17, 2022
1 parent 9b1096a commit 7c8f098
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 12 additions & 0 deletions lib/features/interaction-events/BpmnInteractionEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -42,25 +43,27 @@ 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');

// 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');

// then
expectToHaveChildren(HIT_ALL_CLS, 1, lane);
expectToHaveChildren(HIT_CLICK_STROKE_CLS, 1, lane);
expectToHaveChildren(HIT_NO_MOVE_CLS, 1, lane);
}));


Expand Down Expand Up @@ -98,14 +101,15 @@ 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');

// then
expectToHaveChildren(HIT_ALL_CLS, 1, subProcess);
expectToHaveChildren(HIT_CLICK_STROKE_CLS, 1, subProcess);
expectToHaveChildren(HIT_NO_MOVE_CLS, 1, subProcess);
}));


Expand Down

0 comments on commit 7c8f098

Please sign in to comment.