chore(drilldown): ensure `#primaryShape` replaces suffix

This commit is contained in:
Martin Stamm 2022-01-25 13:54:32 +01:00 committed by Philipp Fromme
parent eefa78240b
commit cfb3dd4ace
1 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { getDi, is } from './ModelUtil';
export var planePostfix = '_plane';
export var planeSuffix = '_plane';
/**
* Returns the ID of the plane associated with an element.
@ -11,7 +11,7 @@ export var planePostfix = '_plane';
*/
export function planeId(element) {
if (is(element, 'bpmn:SubProcess')) {
return element.id + planePostfix;
return element.id + planeSuffix;
}
return element.id;
@ -25,7 +25,7 @@ export function planeId(element) {
* @returns
*/
export function asPlaneId(string) {
return string + planePostfix;
return string + planeSuffix;
}
/**
@ -46,5 +46,5 @@ export function isPlane(element) {
* @returns {String}
*/
export function primaryShape(element) {
return element.id.replace(planePostfix, '');
return element.id.replace(new RegExp(planeSuffix + '$'), '');
}