diff --git a/lib/utils/properties-panel.js b/lib/utils/properties-panel.js index a459e5a..c427317 100644 --- a/lib/utils/properties-panel.js +++ b/lib/utils/properties-panel.js @@ -226,7 +226,7 @@ export function getEntryIds(report) { ]; for (const [ type, prefix ] of LIST_PROPERTIES) { - if (hasType(data, type) + if (isType(data, type) && getPropertyName(data)) { const index = path[ path.length - 2 ]; @@ -235,7 +235,7 @@ export function getEntryIds(report) { } } - if (hasType(data, 'zeebe:LoopCharacteristics')) { + if (isType(data, 'zeebe:LoopCharacteristics')) { return [ `multiInstance-${getPropertyName(data)}` ]; } @@ -498,14 +498,16 @@ function isPropertyError(data, property, type) { && (!type || is(data.node, type)); } -function hasType(data, type) { - return data.node && is(data.node, type); -} - function getPropertyName(data) { - const propertyKey = data.type === ERROR_TYPES.PROPERTY_REQUIRED ? 'requiredProperty' : 'property'; + if (data.type === ERROR_TYPES.PROPERTY_REQUIRED) { + return data.requiredProperty; + } - return data[ propertyKey ]; + return data.property; +} + +function isType(data, type) { + return data.node && is(data.node, type); } function isOneOfPropertiesRequiredError(data, requiredProperty, type) {