From 13192efe0b144fe7b6dae602124244b65004c104 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 30 Jan 2022 17:07:49 +0100 Subject: [PATCH] fix(planes): use utility --- .../modeling/behavior/SubProcessPlaneBehavior.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/features/modeling/behavior/SubProcessPlaneBehavior.js b/lib/features/modeling/behavior/SubProcessPlaneBehavior.js index 27407123..b36297ca 100644 --- a/lib/features/modeling/behavior/SubProcessPlaneBehavior.js +++ b/lib/features/modeling/behavior/SubProcessPlaneBehavior.js @@ -9,6 +9,7 @@ import { getMid } from 'diagram-js/lib/layout/LayoutUtil'; import { getBBox } from 'diagram-js/lib/util/Elements'; import { getPlaneIdFromShape, + getShapeIdFromPlane, isPlane, toPlaneId } from '../../../util/DrilldownUtil'; @@ -310,12 +311,12 @@ export default function SubProcessPlaneBehavior( return; } - var id = planeId(element); + var id = getPlaneIdFromShape(element); var parent = elementRegistry.get(id); if (parent) { - // Don't copy invisible root element + // do not copy invisible root element children.push.apply(children, parent.children); } }); @@ -333,7 +334,8 @@ export default function SubProcessPlaneBehavior( return; } - var parentId = parent.id.replace(planePostfix, ''); + var parentId = getShapeIdFromPlane(parent); + var referencedShape = find(elements, function(element) { return element.id === parentId; }); @@ -381,7 +383,7 @@ SubProcessPlaneBehavior.prototype._moveChildrenToShape = function(source, target 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) { return !child.hidden; });