-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functioning Spacetool and tests (#162)
* Add functioning Spacetool and tests * Add space tool tests to visual tests Co-authored-by: jan.ladleif <jan.ladleif@hpi.uni-potsdam.de>
- Loading branch information
Showing
13 changed files
with
686 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { forEach } from 'min-dash'; | ||
import { is } from 'bpmn-js/lib/util/ModelUtil'; | ||
|
||
export default function ChoreoSpaceToolBehavior(eventBus, resize) { | ||
// This overwrites an event listener in SpaceToolBehavior in BpmnJS (due to the higher priority). | ||
// We need to set a different minSize for participants as BpmnJS has the sizes for lanes. | ||
// We also add minDimensions for ChoreoActivities. | ||
eventBus.on('spaceTool.getMinDimensions', 3000, function(context) { | ||
const shapes = context.shapes; | ||
const minDimensions = {}; | ||
|
||
forEach(shapes, function(shape) { | ||
const id = shape.id; | ||
if (is(shape, 'bpmn:ChoreographyActivity')) { | ||
minDimensions[ id ] = resize.computeMinResizeBox({ shape: shape, direction: context.direction }); | ||
} | ||
if (is(shape, 'bpmn:Participant')) { | ||
minDimensions[ id ] = { width: 0, height: 0 }; | ||
} | ||
}); | ||
|
||
return minDimensions; | ||
}); | ||
} | ||
|
||
ChoreoSpaceToolBehavior.$inject = [ | ||
'eventBus', | ||
'resize' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.