Merge branch 'master' into develop
This commit is contained in:
commit
1f706fd9b8
|
@ -8,6 +8,11 @@ ___Note:__ Yet to be released changes appear here._
|
|||
|
||||
* `FEAT`: rework container drag interaction to prevent accidental dragging of participants and sub-processes ([#1097](https://github.com/bpmn-io/bpmn-js/pull/1097), [#957](https://github.com/bpmn-io/bpmn-js/issues/957))
|
||||
|
||||
## 4.0.4
|
||||
|
||||
* `FIX`: creating `bpmn:Participant` on single `bpmn:Group` throwing error ([#1133](https://github.com/bpmn-io/bpmn-js/issues/1133))
|
||||
* `CHORE`: bump to `diagram-js@4.0.3`
|
||||
|
||||
## 4.0.3
|
||||
|
||||
* `FIX`: prevent dropping on labels and `bpmn:Group` elements ([#1131](https://github.com/bpmn-io/bpmn-js/pull/1131))
|
||||
|
|
|
@ -48,6 +48,11 @@ export default function CreateParticipantBehavior(canvas, eventBus, modeling) {
|
|||
!isConnection(element);
|
||||
});
|
||||
|
||||
// ensure for available children to calculate bounds
|
||||
if (!children.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var childrenBBox = getBBox(children);
|
||||
|
||||
var participantBounds = getParticipantBounds(shape, childrenBBox);
|
||||
|
|
|
@ -342,6 +342,39 @@ describe('features/modeling - create participant', function() {
|
|||
|
||||
});
|
||||
|
||||
|
||||
describe('fitting participant (only groups)', function() {
|
||||
|
||||
var processDiagramXML = require('../../../../fixtures/bpmn/collaboration/process-empty.bpmn');
|
||||
|
||||
beforeEach(bootstrapModeler(processDiagramXML, { modules: testModules }));
|
||||
|
||||
it('should fit participant', inject(
|
||||
function(canvas, create, dragging, elementFactory, modeling) {
|
||||
|
||||
// given
|
||||
var process = canvas.getRootElement(),
|
||||
processGfx = canvas.getGraphics(process),
|
||||
participant = elementFactory.createParticipantShape(),
|
||||
participantBo = participant.businessObject,
|
||||
groupElement = elementFactory.createShape({ type: 'bpmn:Group' });
|
||||
|
||||
modeling.createShape(groupElement, { x: 100, y: 100 }, process);
|
||||
|
||||
// when
|
||||
create.start(canvasEvent({ x: 100, y: 100 }), participant);
|
||||
dragging.hover({ element: process, gfx: processGfx });
|
||||
|
||||
// then
|
||||
var defaultSize = elementFactory._getDefaultSize(participantBo);
|
||||
|
||||
expect(participant.width).to.equal(defaultSize.width);
|
||||
expect(participant.height).to.equal(defaultSize.height);
|
||||
}
|
||||
));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue