mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-11 09:36:07 +00:00
chore(ordering): throw on missing order
Throw a proper exception of we fail to compute an elements ordering.
This commit is contained in:
parent
9cb2fa123d
commit
5f266b20df
@ -99,6 +99,10 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
|
||||
element.order = order = computeOrder(element);
|
||||
}
|
||||
|
||||
if (!order) {
|
||||
throw new Error('no order for <' + element.id + '>');
|
||||
}
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
@ -116,10 +120,7 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
|
||||
}
|
||||
|
||||
if (!actualParent) {
|
||||
throw new Error(translate('no parent for {element} in {parent}', {
|
||||
element: element.id,
|
||||
parent: newParent.id
|
||||
}));
|
||||
throw new Error('no parent for <' + element.id + '> in <' + newParent.id + '>');
|
||||
}
|
||||
|
||||
return actualParent;
|
||||
@ -137,12 +138,10 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
|
||||
|
||||
var elementOrder = getOrder(element);
|
||||
|
||||
|
||||
if (elementOrder.containers) {
|
||||
newParent = findActualParent(element, newParent, elementOrder.containers);
|
||||
}
|
||||
|
||||
|
||||
var currentIndex = newParent.children.indexOf(element);
|
||||
|
||||
var insertIndex = findIndex(newParent.children, function(child) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user