parent
49cc8dc7ea
commit
d32da90013
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
"rules": {
|
||||
"indent": [ 2, 2, { "VariableDeclarator": { "const": 3, "let": 2, "var": 2 } } ],
|
||||
"indent": [ 2, 2, {
|
||||
"VariableDeclarator": { "var": 2, "let": 2, "const": 3 },
|
||||
"FunctionDeclaration": { "body": 1, "parameters": 2 }
|
||||
} ],
|
||||
"keyword-spacing": [ 2 ],
|
||||
"mocha/no-exclusive-tests": 2,
|
||||
"no-console": 0,
|
||||
|
|
|
@ -452,7 +452,7 @@ module.exports = PathMap;
|
|||
////////// helpers //////////
|
||||
|
||||
// copied from https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js
|
||||
var tokenRegex = /\{([^\}]+)\}/g,
|
||||
var tokenRegex = /\{([^}]+)\}/g,
|
||||
objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches .xxxxx or ["xxxxx"] to run over object properties
|
||||
|
||||
function replacer(all, key, obj) {
|
||||
|
|
|
@ -14,7 +14,8 @@ var assign = require('lodash/object/assign'),
|
|||
/**
|
||||
* A provider for BPMN 2.0 elements context pad
|
||||
*/
|
||||
function ContextPadProvider(config, injector, eventBus, contextPad, modeling,
|
||||
function ContextPadProvider(
|
||||
config, injector, eventBus, contextPad, modeling,
|
||||
elementFactory, connect, create, popupMenu,
|
||||
canvas, rules, translate) {
|
||||
|
||||
|
@ -137,7 +138,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||
|
||||
if (typeof title !== 'string') {
|
||||
options = title;
|
||||
title = translate('Append {type}', { type: type.replace(/^bpmn\:/, '') });
|
||||
title = translate('Append {type}', { type: type.replace(/^bpmn:/, '') });
|
||||
}
|
||||
|
||||
function appendStart(event, element) {
|
||||
|
@ -244,19 +245,30 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||
if (is(businessObject, 'bpmn:EventBasedGateway')) {
|
||||
|
||||
assign(actions, {
|
||||
'append.receive-task': appendAction('bpmn:ReceiveTask', 'bpmn-icon-receive-task'),
|
||||
'append.message-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
|
||||
'append.receive-task': appendAction(
|
||||
'bpmn:ReceiveTask',
|
||||
'bpmn-icon-receive-task'
|
||||
),
|
||||
'append.message-intermediate-event': appendAction(
|
||||
'bpmn:IntermediateCatchEvent',
|
||||
'bpmn-icon-intermediate-event-catch-message',
|
||||
{ eventDefinitionType: 'bpmn:MessageEventDefinition' }),
|
||||
'append.timer-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
|
||||
{ eventDefinitionType: 'bpmn:MessageEventDefinition' }
|
||||
),
|
||||
'append.timer-intermediate-event': appendAction(
|
||||
'bpmn:IntermediateCatchEvent',
|
||||
'bpmn-icon-intermediate-event-catch-timer',
|
||||
{ eventDefinitionType: 'bpmn:TimerEventDefinition' }),
|
||||
'append.condtion-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
|
||||
{ eventDefinitionType: 'bpmn:TimerEventDefinition' }
|
||||
),
|
||||
'append.condtion-intermediate-event': appendAction(
|
||||
'bpmn:IntermediateCatchEvent',
|
||||
'bpmn-icon-intermediate-event-catch-condition',
|
||||
{ eventDefinitionType: 'bpmn:ConditionalEventDefinition' }),
|
||||
'append.signal-intermediate-event': appendAction('bpmn:IntermediateCatchEvent',
|
||||
{ eventDefinitionType: 'bpmn:ConditionalEventDefinition' }
|
||||
),
|
||||
'append.signal-intermediate-event': appendAction(
|
||||
'bpmn:IntermediateCatchEvent',
|
||||
'bpmn-icon-intermediate-event-catch-signal',
|
||||
{ eventDefinitionType: 'bpmn:SignalEventDefinition' })
|
||||
{ eventDefinitionType: 'bpmn:SignalEventDefinition' }
|
||||
)
|
||||
});
|
||||
} else
|
||||
|
||||
|
@ -276,11 +288,22 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||
!isEventSubProcess(businessObject)) {
|
||||
|
||||
assign(actions, {
|
||||
'append.end-event': appendAction('bpmn:EndEvent', 'bpmn-icon-end-event-none'),
|
||||
'append.gateway': appendAction('bpmn:ExclusiveGateway', 'bpmn-icon-gateway-xor'),
|
||||
'append.append-task': appendAction('bpmn:Task', 'bpmn-icon-task'),
|
||||
'append.intermediate-event': appendAction('bpmn:IntermediateThrowEvent',
|
||||
'bpmn-icon-intermediate-event-none')
|
||||
'append.end-event': appendAction(
|
||||
'bpmn:EndEvent',
|
||||
'bpmn-icon-end-event-none'
|
||||
),
|
||||
'append.gateway': appendAction(
|
||||
'bpmn:ExclusiveGateway',
|
||||
'bpmn-icon-gateway-xor'
|
||||
),
|
||||
'append.append-task': appendAction(
|
||||
'bpmn:Task',
|
||||
'bpmn-icon-task'
|
||||
),
|
||||
'append.intermediate-event': appendAction(
|
||||
'bpmn:IntermediateThrowEvent',
|
||||
'bpmn-icon-intermediate-event-none'
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,18 +10,12 @@ var is = require('../../util/ModelUtil').is;
|
|||
|
||||
var getBBox = require('diagram-js/lib/util/Elements').getBBox;
|
||||
|
||||
|
||||
function BpmnEditorActions(
|
||||
injector,
|
||||
canvas, elementRegistry, selection,
|
||||
spaceTool,
|
||||
lassoTool,
|
||||
handTool,
|
||||
globalConnect,
|
||||
distributeElements,
|
||||
alignElements,
|
||||
directEditing,
|
||||
searchPad,
|
||||
modeling) {
|
||||
injector, canvas, elementRegistry,
|
||||
selection, spaceTool, lassoTool, handTool,
|
||||
globalConnect, distributeElements, alignElements,
|
||||
directEditing, searchPad, modeling) {
|
||||
|
||||
injector.invoke(EditorActions, this);
|
||||
|
||||
|
@ -115,7 +109,9 @@ inherits(BpmnEditorActions, EditorActions);
|
|||
|
||||
BpmnEditorActions.$inject = [
|
||||
'injector',
|
||||
'canvas', 'elementRegistry', 'selection',
|
||||
'canvas',
|
||||
'elementRegistry',
|
||||
'selection',
|
||||
'spaceTool',
|
||||
'lassoTool',
|
||||
'handTool',
|
||||
|
|
|
@ -5,7 +5,10 @@ var assign = require('lodash/object/assign');
|
|||
/**
|
||||
* A palette provider for BPMN 2.0 elements.
|
||||
*/
|
||||
function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool, handTool, globalConnect, translate) {
|
||||
function PaletteProvider(
|
||||
palette, create, elementFactory,
|
||||
spaceTool, lassoTool, handTool,
|
||||
globalConnect, translate) {
|
||||
|
||||
this._palette = palette;
|
||||
this._create = create;
|
||||
|
@ -56,7 +59,7 @@ PaletteProvider.prototype.getPaletteEntries = function(element) {
|
|||
create.start(event, shape);
|
||||
}
|
||||
|
||||
var shortType = type.replace(/^bpmn\:/, '');
|
||||
var shortType = type.replace(/^bpmn:/, '');
|
||||
|
||||
return {
|
||||
group: group,
|
||||
|
|
|
@ -16,7 +16,9 @@ var replaceOptions = require ('../replace/ReplaceOptions');
|
|||
/**
|
||||
* This module is an element agnostic replace menu provider for the popup menu.
|
||||
*/
|
||||
function ReplaceMenuProvider(popupMenu, modeling, moddle, bpmnReplace, rules, translate) {
|
||||
function ReplaceMenuProvider(
|
||||
popupMenu, modeling, moddle,
|
||||
bpmnReplace, rules, translate) {
|
||||
|
||||
this._popupMenu = popupMenu;
|
||||
this._modeling = modeling;
|
||||
|
@ -28,7 +30,14 @@ function ReplaceMenuProvider(popupMenu, modeling, moddle, bpmnReplace, rules, tr
|
|||
this.register();
|
||||
}
|
||||
|
||||
ReplaceMenuProvider.$inject = [ 'popupMenu', 'modeling', 'moddle', 'bpmnReplace', 'rules', 'translate' ];
|
||||
ReplaceMenuProvider.$inject = [
|
||||
'popupMenu',
|
||||
'modeling',
|
||||
'moddle',
|
||||
'bpmnReplace',
|
||||
'rules',
|
||||
'translate'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,15 +27,17 @@ var CUSTOM_PROPERTIES = [
|
|||
|
||||
function toggeling(element, target) {
|
||||
|
||||
var oldCollapsed = has(element, 'collapsed') ?
|
||||
element.collapsed : !isExpanded(element);
|
||||
var oldCollapsed = (
|
||||
has(element, 'collapsed') ? element.collapsed : !isExpanded(element)
|
||||
);
|
||||
|
||||
var targetCollapsed;
|
||||
|
||||
if (has(target, 'collapsed') || has(target, 'isExpanded')) {
|
||||
// property is explicitly set so use it
|
||||
targetCollapsed = has(target, 'collapsed') ?
|
||||
target.collapsed : !target.isExpanded;
|
||||
targetCollapsed = (
|
||||
has(target, 'collapsed') ? target.collapsed : !target.isExpanded
|
||||
);
|
||||
} else {
|
||||
// keep old state
|
||||
targetCollapsed = oldCollapsed;
|
||||
|
|
|
@ -240,22 +240,26 @@ function isSameOrganization(a, b) {
|
|||
}
|
||||
|
||||
function isMessageFlowSource(element) {
|
||||
return is(element, 'bpmn:InteractionNode') &&
|
||||
return (
|
||||
is(element, 'bpmn:InteractionNode') &&
|
||||
!isForCompensation(element) && (
|
||||
!is(element, 'bpmn:Event') || (
|
||||
is(element, 'bpmn:ThrowEvent') &&
|
||||
hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function isMessageFlowTarget(element) {
|
||||
return is(element, 'bpmn:InteractionNode') &&
|
||||
return (
|
||||
is(element, 'bpmn:InteractionNode') &&
|
||||
!isForCompensation(element) && (
|
||||
!is(element, 'bpmn:Event') || (
|
||||
is(element, 'bpmn:CatchEvent') &&
|
||||
hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -301,36 +305,41 @@ function hasEventDefinitionOrNone(element, eventDefinition) {
|
|||
}
|
||||
|
||||
function isSequenceFlowSource(element) {
|
||||
return is(element, 'bpmn:FlowNode') &&
|
||||
return (
|
||||
is(element, 'bpmn:FlowNode') &&
|
||||
!is(element, 'bpmn:EndEvent') &&
|
||||
!isEventSubProcess(element) &&
|
||||
!(is(element, 'bpmn:IntermediateThrowEvent') &&
|
||||
hasEventDefinition(element, 'bpmn:LinkEventDefinition')
|
||||
) &&
|
||||
!isCompensationBoundary(element) &&
|
||||
!isForCompensation(element);
|
||||
!isForCompensation(element)
|
||||
);
|
||||
}
|
||||
|
||||
function isSequenceFlowTarget(element) {
|
||||
return is(element, 'bpmn:FlowNode') &&
|
||||
return (
|
||||
is(element, 'bpmn:FlowNode') &&
|
||||
!is(element, 'bpmn:StartEvent') &&
|
||||
!is(element, 'bpmn:BoundaryEvent') &&
|
||||
!isEventSubProcess(element) &&
|
||||
!(is(element, 'bpmn:IntermediateCatchEvent') &&
|
||||
hasEventDefinition(element, 'bpmn:LinkEventDefinition')
|
||||
) &&
|
||||
!isForCompensation(element);
|
||||
|
||||
!isForCompensation(element)
|
||||
);
|
||||
}
|
||||
|
||||
function isEventBasedTarget(element) {
|
||||
return is(element, 'bpmn:ReceiveTask') || (
|
||||
return (
|
||||
is(element, 'bpmn:ReceiveTask') || (
|
||||
is(element, 'bpmn:IntermediateCatchEvent') && (
|
||||
hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||
|
||||
hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||
|
||||
hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||
|
||||
hasEventDefinition(element, 'bpmn:SignalEventDefinition')
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -710,8 +719,10 @@ function canCreate(shape, target, source, position) {
|
|||
|
||||
function canResize(shape, newBounds) {
|
||||
if (is(shape, 'bpmn:SubProcess')) {
|
||||
return (!!isExpanded(shape)) && (
|
||||
return (
|
||||
isExpanded(shape) && (
|
||||
!newBounds || (newBounds.width >= 100 && newBounds.height >= 80)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
"chai": "^4.1.2",
|
||||
"chai-match": "^1.1.1",
|
||||
"common-shakeify": "^0.4.4",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint": "^4.14.0",
|
||||
"eslint-plugin-mocha": "^4.9.0",
|
||||
"grunt": "^0.4.4",
|
||||
"grunt-cli": "^0.1.13",
|
||||
|
|
|
@ -21,8 +21,8 @@ function CustomElementFactory(injector) {
|
|||
return self.baseCreate(elementType, assign({ type: 'label' }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));
|
||||
}
|
||||
|
||||
if (/^custom\:/.test(type)) {
|
||||
type = attrs.type.replace(/^custom\:/, '');
|
||||
if (/^custom:/.test(type)) {
|
||||
type = attrs.type.replace(/^custom:/, '');
|
||||
|
||||
businessObject = {};
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ CustomRenderer.$inject = [ 'eventBus', 'styles' ];
|
|||
|
||||
|
||||
CustomRenderer.prototype.canRender = function(element) {
|
||||
return /^custom\:/.test(element.type);
|
||||
return /^custom:/.test(element.type);
|
||||
};
|
||||
|
||||
CustomRenderer.prototype.drawShape = function(visuals, element) {
|
||||
|
@ -140,7 +140,7 @@ CustomRenderer.prototype.drawConnection = function(visuals, element) {
|
|||
};
|
||||
|
||||
CustomRenderer.prototype.getShapePath = function(element) {
|
||||
var type = element.type.replace(/^custom\:/, '');
|
||||
var type = element.type.replace(/^custom:/, '');
|
||||
|
||||
var shapes = {
|
||||
triangle: this.getTrianglePath,
|
||||
|
|
|
@ -15,7 +15,7 @@ function isType(element, type) {
|
|||
}
|
||||
|
||||
function isCustom(element) {
|
||||
return element && /^custom\:/.test(element.type);
|
||||
return element && /^custom:/.test(element.type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -371,8 +371,8 @@ describe('features - context-pad', function() {
|
|||
}));
|
||||
|
||||
|
||||
it('should hide wrench if replacement is disallowed',
|
||||
inject(function(elementRegistry, contextPad, customRules) {
|
||||
it('should hide wrench if replacement is disallowed', inject(
|
||||
function(elementRegistry, contextPad, customRules) {
|
||||
|
||||
// given
|
||||
var element = elementRegistry.get('StartEvent_1');
|
||||
|
@ -393,8 +393,8 @@ describe('features - context-pad', function() {
|
|||
));
|
||||
|
||||
|
||||
it('should show wrench if replacement is allowed',
|
||||
inject(function(elementRegistry, contextPad, customRules) {
|
||||
it('should show wrench if replacement is allowed', inject(
|
||||
function(elementRegistry, contextPad, customRules) {
|
||||
|
||||
// given
|
||||
var element = elementRegistry.get('EndEvent_1');
|
||||
|
@ -417,8 +417,8 @@ describe('features - context-pad', function() {
|
|||
|
||||
describe('create + <CTRL>', function() {
|
||||
|
||||
it('should open replace',
|
||||
inject(function(create, dragging, canvas, elementFactory) {
|
||||
it('should open replace', inject(
|
||||
function(create, dragging, canvas, elementFactory) {
|
||||
|
||||
// given
|
||||
var rootShape = canvas.getRootElement(),
|
||||
|
@ -442,8 +442,8 @@ describe('features - context-pad', function() {
|
|||
));
|
||||
|
||||
|
||||
it('should open boundary event replace menu',
|
||||
inject(function(create, dragging, canvas, elementFactory, modeling, popupMenu) {
|
||||
it('should open boundary event replace menu', inject(
|
||||
function(create, dragging, canvas, elementFactory, modeling, popupMenu) {
|
||||
|
||||
// given
|
||||
var rootShape = canvas.getRootElement();
|
||||
|
@ -469,8 +469,8 @@ describe('features - context-pad', function() {
|
|||
));
|
||||
|
||||
|
||||
it('should not open non-existing replace menu',
|
||||
inject(function(create, dragging, canvas, elementFactory) {
|
||||
it('should not open non-existing replace menu', inject(
|
||||
function(create, dragging, canvas, elementFactory) {
|
||||
// given
|
||||
var rootShape = canvas.getRootElement(),
|
||||
dataObject = elementFactory.createShape({ type: 'bpmn:DataObjectReference' }),
|
||||
|
|
|
@ -60,8 +60,8 @@ describe('features/move - drop', function() {
|
|||
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
|
||||
|
||||
|
||||
it('should remove flow if target and source have different parents',
|
||||
inject(function(elementRegistry, modeling) {
|
||||
it('should remove flow if target and source have different parents', inject(
|
||||
function(elementRegistry, modeling) {
|
||||
|
||||
// given
|
||||
var task_1 = elementRegistry.get('ID_Task_1'),
|
||||
|
@ -74,10 +74,12 @@ describe('features/move - drop', function() {
|
|||
// then
|
||||
expect(flow.parent).to.be.null;
|
||||
expect(flow.businessObject.$parent).to.be.null;
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
it('should update flow parent if target and source have same parents', inject(function(elementRegistry, modeling) {
|
||||
it('should update flow parent if target and source have same parents', inject(
|
||||
function(elementRegistry, modeling) {
|
||||
|
||||
// given
|
||||
var task_1 = elementRegistry.get('ID_Task_1'),
|
||||
|
@ -91,7 +93,8 @@ describe('features/move - drop', function() {
|
|||
// then
|
||||
expect(flow.parent).to.eql(parent);
|
||||
expect(flow.businessObject.$parent).to.eql(parent.businessObject);
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -153,7 +153,8 @@ describe('features/modeling - create participant', function() {
|
|||
}));
|
||||
|
||||
|
||||
it('should detach DI on update canvas root', inject(function(canvas, elementFactory, commandStack, modeling, elementRegistry) {
|
||||
it('should detach DI on update canvas root', inject(
|
||||
function(canvas, elementFactory, commandStack, modeling, elementRegistry) {
|
||||
|
||||
// when
|
||||
modeling.makeCollaboration();
|
||||
|
@ -166,7 +167,8 @@ describe('features/modeling - create participant', function() {
|
|||
// then
|
||||
expect(startEventDi.$parent).to.not.be.ok;
|
||||
expect(rootShapeDi.planeElement).not.to.include(startEventDi);
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@ describe('features/modeling/behavior - data store', function() {
|
|||
var dataStoreShape = modeling.createShape(
|
||||
{ type: 'bpmn:DataStoreReference' },
|
||||
{ x: 220, y: 220 },
|
||||
participantElement);
|
||||
participantElement
|
||||
);
|
||||
|
||||
var dataStoreReference = dataStoreShape.businessObject;
|
||||
|
||||
|
@ -55,7 +56,8 @@ describe('features/modeling/behavior - data store', function() {
|
|||
var dataStoreShape = modeling.createShape(
|
||||
{ type: 'bpmn:DataStoreReference' },
|
||||
{ x: 420, y: 220 },
|
||||
subProcessElement);
|
||||
subProcessElement
|
||||
);
|
||||
|
||||
var dataStoreReference = dataStoreShape.businessObject;
|
||||
|
||||
|
|
|
@ -150,8 +150,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
}));
|
||||
|
||||
|
||||
it('should connect start -> target -> end (with bendpointBefore inside bbox)',
|
||||
inject(function(modeling, elementRegistry, elementFactory) {
|
||||
it('should connect start -> target -> end (with bendpointBefore inside bbox)', inject(
|
||||
function(modeling, elementRegistry, elementFactory) {
|
||||
// given
|
||||
var taskShape = elementFactory.createShape({ type: 'bpmn:Task' }),
|
||||
sequenceFlow = elementRegistry.get('SequenceFlow_1'),
|
||||
|
@ -173,8 +173,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
));
|
||||
|
||||
|
||||
it('should connect start -> target -> end (with bendpointAfter inside bbox)',
|
||||
inject(function(modeling, elementRegistry, elementFactory) {
|
||||
it('should connect start -> target -> end (with bendpointAfter inside bbox)', inject(
|
||||
function(modeling, elementRegistry, elementFactory) {
|
||||
|
||||
// given
|
||||
var taskShape = elementFactory.createShape({ type: 'bpmn:Task' }),
|
||||
|
@ -199,6 +199,7 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
|
||||
});
|
||||
|
||||
|
||||
describe('move', function() {
|
||||
|
||||
beforeEach(inject(function(dragging) {
|
||||
|
@ -263,8 +264,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
}));
|
||||
|
||||
|
||||
it('should connect start -> target -> end (hovering parent)',
|
||||
inject(function(dragging, move, elementRegistry, selection, canvas) {
|
||||
it('should connect start -> target -> end (hovering parent)', inject(
|
||||
function(dragging, move, elementRegistry, selection, canvas) {
|
||||
|
||||
// given
|
||||
var intermediateThrowEvent = elementRegistry.get('IntermediateThrowEvent_foo');
|
||||
|
@ -323,8 +324,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
));
|
||||
|
||||
|
||||
it('should connect start -> target -> end (with bendpointBefore inside bbox)',
|
||||
inject(function(elementRegistry, selection, move, dragging) {
|
||||
it('should connect start -> target -> end (with bendpointBefore inside bbox)', inject(
|
||||
function(elementRegistry, selection, move, dragging) {
|
||||
// given
|
||||
var task3 = elementRegistry.get('Task_3'),
|
||||
sequenceFlow = elementRegistry.get('SequenceFlow_1'),
|
||||
|
@ -356,8 +357,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
));
|
||||
|
||||
|
||||
it('should connect start -> target -> end (with bendpointAfter inside bbox)',
|
||||
inject(function(elementRegistry, selection, move, dragging) {
|
||||
it('should connect start -> target -> end (with bendpointAfter inside bbox)', inject(
|
||||
function(elementRegistry, selection, move, dragging) {
|
||||
// given
|
||||
var task3 = elementRegistry.get('Task_3'),
|
||||
sequenceFlow = elementRegistry.get('SequenceFlow_1'),
|
||||
|
@ -389,7 +390,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
));
|
||||
|
||||
|
||||
it('should connect start -> target', inject(function(modeling, elementRegistry, selection, move, dragging) {
|
||||
it('should connect start -> target', inject(
|
||||
function(modeling, elementRegistry, selection, move, dragging) {
|
||||
|
||||
// given
|
||||
var endEventShape = elementRegistry.get('EndEvent_foo');
|
||||
|
@ -426,10 +428,12 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
originalWaypoints.slice(0, 2),
|
||||
{ x: 340, y: 281 }
|
||||
]));
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
it('should connect target -> end', inject(function(modeling, elementRegistry, dragging, selection, move) {
|
||||
it('should connect target -> end', inject(
|
||||
function(modeling, elementRegistry, dragging, selection, move) {
|
||||
|
||||
var startEventShape = elementRegistry.get('StartEvent_foo');
|
||||
|
||||
|
@ -465,11 +469,12 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
{ x: 338, y: 228 },
|
||||
originalWaypoints.slice(2)
|
||||
]));
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
it('should undo',
|
||||
inject(function(modeling, elementRegistry, dragging, selection, move, commandStack) {
|
||||
it('should undo', inject(
|
||||
function(modeling, elementRegistry, dragging, selection, move, commandStack) {
|
||||
|
||||
// given
|
||||
var startEventShape = elementRegistry.get('StartEvent_foo');
|
||||
|
@ -504,7 +509,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
|
||||
// split target at insertion point
|
||||
expect(sequenceFlow).to.have.waypoints(flatten([ originalWaypoints ]));
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
});
|
||||
|
||||
|
@ -513,7 +519,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
|
||||
describe('rules', function() {
|
||||
|
||||
it('should not insert participant', inject(function(rules, elementRegistry, elementFactory) {
|
||||
it('should not insert participant', inject(
|
||||
function(rules, elementRegistry, elementFactory) {
|
||||
|
||||
// given
|
||||
var participantShape = elementFactory.createShape({ type: 'bpmn:Participant' });
|
||||
|
@ -531,10 +538,12 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
|
||||
// then
|
||||
expect(canDrop).to.be.false;
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
it('should not insert multiple with "move"', inject(function(elementRegistry, selection, move, dragging) {
|
||||
it('should not insert multiple with "move"', inject(
|
||||
function(elementRegistry, selection, move, dragging) {
|
||||
|
||||
// given
|
||||
var intermediateThrowEvent = elementRegistry.get('IntermediateThrowEvent_foo'),
|
||||
|
@ -569,7 +578,8 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
// then
|
||||
expect(intermediateThrowEvent).to.have.position(intInitPosition);
|
||||
expect(endEventShape).to.have.position(endInitPosition);
|
||||
}));
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
it('should not insert on sequence flow label', inject(function(bpmnRules, elementRegistry) {
|
||||
|
@ -586,6 +596,7 @@ describe('modeling/behavior - drop on connection', function() {
|
|||
// then
|
||||
expect(canInsert).to.be.false;
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -388,7 +388,6 @@ describe('features/modeling - collapse and expand elements', function() {
|
|||
|
||||
describe('resize', function() {
|
||||
|
||||
|
||||
it('is centered and has default bounds',
|
||||
inject(function(elementRegistry, bpmnReplace) {
|
||||
|
||||
|
@ -425,7 +424,6 @@ describe('features/modeling - collapse and expand elements', function() {
|
|||
|
||||
describe('undo', function() {
|
||||
|
||||
|
||||
it('collapsed marker is removed',
|
||||
inject(function(elementRegistry, bpmnReplace, commandStack) {
|
||||
|
||||
|
@ -509,10 +507,8 @@ describe('features/modeling - collapse and expand elements', function() {
|
|||
|
||||
describe('attaching marker', function() {
|
||||
|
||||
|
||||
describe('collapsed', function() {
|
||||
|
||||
|
||||
it('add ad-hoc-marker does not call toggleProvider',
|
||||
inject(function(eventBus, bpmnReplace, elementRegistry) {
|
||||
|
||||
|
@ -567,7 +563,6 @@ describe('features/modeling - collapse and expand elements', function() {
|
|||
|
||||
describe('expanded', function() {
|
||||
|
||||
|
||||
it('add ad-hoc-marker does not call toggleProvider',
|
||||
inject(function(eventBus, bpmnReplace, elementRegistry) {
|
||||
|
||||
|
@ -619,8 +614,6 @@ describe('features/modeling - collapse and expand elements', function() {
|
|||
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue