From f1badaf33bcc13a90577a4fff8847fb391cb0049 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Mon, 3 Oct 2022 18:07:30 +0200 Subject: [PATCH 1/3] check falsy instead of non zero for simplicity --- src/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 526eb03..cee9f48 100644 --- a/src/index.js +++ b/src/index.js @@ -35,7 +35,7 @@ let edgesWaitingInstances = getEdgesWaitingInstances(); // Add Overlay on activities activitiesMonitoringData.forEach((value, key) => { // running on time - if (value[0] !== 0) { + if (value[0]) { bpmnVisualization.bpmnElementsRegistry.addOverlays(key, { position: "top-center", label: value[0].toString(), @@ -47,7 +47,7 @@ activitiesMonitoringData.forEach((value, key) => { }); } // running late with risky level - if (value[1] !== 0) { + if (value[1]) { bpmnVisualization.bpmnElementsRegistry.addOverlays(key, { position: "top-left", label: value[1].toString(), @@ -59,7 +59,7 @@ activitiesMonitoringData.forEach((value, key) => { }); } // running late with critical level - if (value[2] !== 0) { + if (value[2]) { bpmnVisualization.bpmnElementsRegistry.addOverlays(key, { position: "top-right", label: value[2].toString(), @@ -73,13 +73,13 @@ activitiesMonitoringData.forEach((value, key) => { }); activitiesMonitoringData.forEach((value, key) => { - if (value[2] !== 0){ + if (value[2]){ bpmnVisualization.bpmnElementsRegistry.addCssClasses(key, "task-running-critical"); } - else if (value[1] !== 0){ + else if (value[1]){ bpmnVisualization.bpmnElementsRegistry.addCssClasses(key, "task-running-risky"); } - else if (value[0] !== 0) + else if (value[0]) bpmnVisualization.bpmnElementsRegistry.addCssClasses(key, "task-running-on-time"); }); From 116a82cdeaab51e8fe01e34fb9c58bd55ebf686b Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Mon, 3 Oct 2022 18:10:29 +0200 Subject: [PATCH 2/3] Revert "revert change not related to doc" This reverts commit f09e41aeefe259810da5abc1be2680b132d2c789. --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index cee9f48..773d9c3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -import { BpmnVisualization, ShapeUtil, FlowKind } from "bpmn-visualization"; +import { BpmnVisualization, ShapeUtil, FlowKind, FitType } from "bpmn-visualization"; // BPMN diagram content conveniently retrieved with Vite (as string) // for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples @@ -17,7 +17,7 @@ footer.innerText = `bpmn-visualization@${version.lib}`; // load and filter a pool bpmnVisualization.load(diagram, { - fit: { type: "Center" }, + fit: { type: FitType.Center }, modelFilter: { pools: [ { From 06d73802a37b5634b9c1785c64b7ba559cc3b6cf Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Mon, 3 Oct 2022 18:10:46 +0200 Subject: [PATCH 3/3] remove unused imports --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 773d9c3..4bd3f2d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -import { BpmnVisualization, ShapeUtil, FlowKind, FitType } from "bpmn-visualization"; +import { BpmnVisualization, FitType } from "bpmn-visualization"; // BPMN diagram content conveniently retrieved with Vite (as string) // for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples