You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
848 B
35 lines
848 B
import { is } from '../../../util/ModelUtil'; |
|
|
|
var COLLAB_ERR_MSG = 'flow elements must be children of pools/participants'; |
|
|
|
export default function ModelingFeedback(eventBus, tooltips, translate) { |
|
|
|
function showError(position, message, timeout) { |
|
tooltips.add({ |
|
position: { |
|
x: position.x + 5, |
|
y: position.y + 5 |
|
}, |
|
type: 'error', |
|
timeout: timeout || 2000, |
|
html: '<div>' + message + '</div>' |
|
}); |
|
} |
|
|
|
eventBus.on([ 'shape.move.rejected', 'create.rejected' ], function(event) { |
|
var context = event.context, |
|
shape = context.shape, |
|
target = context.target; |
|
|
|
if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) { |
|
showError(event, translate(COLLAB_ERR_MSG)); |
|
} |
|
}); |
|
|
|
} |
|
|
|
ModelingFeedback.$inject = [ |
|
'eventBus', |
|
'tooltips', |
|
'translate' |
|
];
|
|
|