dmn-js-shared
Advanced tools
Comparing version 7.3.0 to 7.4.1
@@ -21,3 +21,3 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; | ||
import { is } from '../../../util/ModelUtil'; | ||
import { is, getBusinessObject } from '../../../util/ModelUtil'; | ||
var ID = 'id'; | ||
@@ -37,3 +37,3 @@ | ||
_this.executed('updateProperties', _this.updateIds.bind(_assertThisInitialized(_this))); | ||
_this.executed(['element.updateProperties', 'updateProperties'], _this.updateIds.bind(_assertThisInitialized(_this))); | ||
@@ -50,8 +50,9 @@ return _this; | ||
properties = context.properties; | ||
var bo = getBusinessObject(element); | ||
if (!is(element, 'dmn:DRGElement') || !isIdChange(oldProperties, properties)) { | ||
if (!is(bo, 'dmn:DRGElement') || !isIdChange(oldProperties, properties)) { | ||
return; | ||
} | ||
var drgElements = getDrgElements(element); | ||
var drgElements = getDrgElements(bo); | ||
drgElements.forEach(function (drgElement) { | ||
@@ -75,7 +76,23 @@ updateElementReferences(drgElement, oldProperties.id, properties.id); | ||
function getDrgElements(element) { | ||
var definitions = element.$parent; | ||
var definitions = getDefinitions(element); | ||
var drgElements = definitions.drgElements; | ||
return drgElements; | ||
} | ||
/** | ||
* Walk up the tree until at the root to get to dmn:Definitions. | ||
* | ||
* @param {ModdleElement} element | ||
*/ | ||
function getDefinitions(element) { | ||
var definitions = element; | ||
while (!is(definitions, 'dmn:Definitions')) { | ||
definitions = definitions.$parent; | ||
} | ||
return definitions; | ||
} | ||
function updateElementReferences(element, oldId, id) { | ||
@@ -82,0 +99,0 @@ var handlers = { |
{ | ||
"name": "dmn-js-shared", | ||
"description": "Shared components used by dmn-js", | ||
"version": "7.3.0", | ||
"version": "7.4.1", | ||
"scripts": { | ||
@@ -33,3 +33,3 @@ "test": "karma start", | ||
}, | ||
"gitHead": "2c58f061d66235562671b907d217c501c8ca5038" | ||
"gitHead": "0a1d9b5ad366b1e829cd4eace296180fefb314f5" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
250429
2831