Skip to content

Commit 7a5dc1a

Browse files
authored
fix(BpmnSemantic): don't display properties with undefined values (#575)
Except for the "name" property (found in the header), only valued properties are displayed, so that only data of interest is shown.
1 parent 17f1956 commit 7a5dc1a

File tree

1 file changed

+3
-2
lines changed
  • examples/custom-behavior/javascript-tooltip-and-popover

1 file changed

+3
-2
lines changed

examples/custom-behavior/javascript-tooltip-and-popover/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,14 @@ BPMN Info
153153
<hr>
154154
${computeBpmnInfoForPopover(headerKeys, bpmnSemantic)}
155155
<br>
156-
${computeBpmnInfoForPopover(secondaryKeys, bpmnSemantic, true)}
156+
${computeBpmnInfoForPopover(secondaryKeys, bpmnSemantic, true, true)}
157157
</div>`;
158158
}
159159

160-
function computeBpmnInfoForPopover(keys, bpmnSemantic, sort = false) {
160+
function computeBpmnInfoForPopover(keys, bpmnSemantic, sort = false, filterUndefinedValue = false) {
161161
return keys.map(key => getConvertedBpmnSemanticValue(key, bpmnSemantic))
162162
.sort((a, b) => sort ? a.key.localeCompare(b.key) : 0)
163+
.filter(obj => filterUndefinedValue ? obj.value !== 'N/A' : true)
163164
.map(obj => `<b>${obj.key}</b>: ${obj.value}`)
164165
.join('<br>\n');
165166
}

0 commit comments

Comments
 (0)