fix(planes): use utility

This commit is contained in:
Philipp 2022-01-30 17:07:49 +01:00 committed by fake-join[bot]
parent 33c3915f85
commit 13192efe0b
1 changed files with 6 additions and 4 deletions

View File

@ -9,6 +9,7 @@ import { getMid } from 'diagram-js/lib/layout/LayoutUtil';
import { getBBox } from 'diagram-js/lib/util/Elements'; import { getBBox } from 'diagram-js/lib/util/Elements';
import { import {
getPlaneIdFromShape, getPlaneIdFromShape,
getShapeIdFromPlane,
isPlane, isPlane,
toPlaneId toPlaneId
} from '../../../util/DrilldownUtil'; } from '../../../util/DrilldownUtil';
@ -310,12 +311,12 @@ export default function SubProcessPlaneBehavior(
return; return;
} }
var id = planeId(element); var id = getPlaneIdFromShape(element);
var parent = elementRegistry.get(id); var parent = elementRegistry.get(id);
if (parent) { if (parent) {
// Don't copy invisible root element // do not copy invisible root element
children.push.apply(children, parent.children); children.push.apply(children, parent.children);
} }
}); });
@ -333,7 +334,8 @@ export default function SubProcessPlaneBehavior(
return; return;
} }
var parentId = parent.id.replace(planePostfix, ''); var parentId = getShapeIdFromPlane(parent);
var referencedShape = find(elements, function(element) { var referencedShape = find(elements, function(element) {
return element.id === parentId; return element.id === parentId;
}); });
@ -381,7 +383,7 @@ SubProcessPlaneBehavior.prototype._moveChildrenToShape = function(source, target
return; return;
} }
// Only change plane if there are no visible children, but don't move them // only change plane if there are no visible children, but don't move them
var visibleChildren = children.filter(function(child) { var visibleChildren = children.filter(function(child) {
return !child.hidden; return !child.hidden;
}); });