Skip to content

Commit

Permalink
[INFRA] Update for [email protected] (#142)
Browse files Browse the repository at this point in the history
* Fix regex for all versions with numbers greater than 9
* Update BPMN Visualization version: 0.12.1
* Update demo version: 0.12.1
  • Loading branch information
tbouffard authored Feb 8, 2021
1 parent 961db33 commit 04dd02b
Show file tree
Hide file tree
Showing 39 changed files with 155 additions and 2,017 deletions.
27 changes: 20 additions & 7 deletions demo/elements-identification.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>BPMN Visualization Non Regression</title>
<link rel="shortcut icon" href="static/img/favicon.ico">
<link rel="shortcut icon" href="./static/img/favicon.ico">
<style>
#main-container {
top: 140px;
Expand Down Expand Up @@ -34,9 +34,23 @@
width: 70%;
}

.test > rect {
/* activity */
.detection-activity > rect:nth-child(1) {
fill: aquamarine;
}
/* gateway */
.detection-gateway > path:nth-child(1) {
stroke: chartreuse;
stroke-width: 4;
}
/* event */
.detection-event > ellipse {
stroke: red;
}
/* lane */
.detection-lane > path:nth-child(3) {
fill: palevioletred;
}
</style>
</head>
<body>
Expand All @@ -50,6 +64,9 @@
<option value="endEvent">End Event</option>
<option value="intermediateCatchEvent">Catch Event</option>
<option value="intermediateThrowEvent">Throw Event</option>
<option value="exclusiveGateway">Exclusive Gateway</option>
<option value="inclusiveGateway">Inclusive Gateway</option>
<option value="parallelGateway">Parallel Gateway</option>
<option value="lane">Lane</option>
</select>
<button id="bpmn-kinds-textarea-clean-btn">Clear</button>
Expand All @@ -60,11 +77,7 @@
<div id="bpmn-container"></div>
</div>

<!-- load global settings -->
<script src="static/js/configureMxGraphGlobals.js"></script>
<!-- load mxGraph client library -->
<script src="static/js/mxClient.min.js"></script>
<!-- load app -->
<script src="static/js/elements-identification.js" type="module"></script>
<script src="./static/js/elements-identification.js" type="module"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion demo/index.es.js

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<title>BPMN Visualization Demo</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css">
<link href="static/css/tailwind.css" rel="stylesheet">
<link rel="shortcut icon" href="static/img/favicon.ico">
<link href="./static/css/tailwind.css" rel="stylesheet">
<link rel="shortcut icon" href="./static/img/favicon.ico">
</head>
<body class="overflow-hidden bg-gray-800 font-sans leading-normal tracking-normal mt-12">
<!--Nav-->
Expand Down Expand Up @@ -104,11 +104,7 @@ <h3 class="font-bold pl-2">Diagram</h3>
</div>
</div>

<!-- load global settings -->
<script src="static/js/configureMxGraphGlobals.js"></script>
<!-- load mxGraph client library -->
<script src="static/js/mxClient.min.js"></script>
<!-- load demo -->
<script src="static/js/demo.js" type="module"></script>
<script src="./static/js/demo.js" type="module"></script>
</body>
</html>
8 changes: 2 additions & 6 deletions demo/lib-integration.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
<head>
<meta charset="UTF-8">
<title>BPMN Visualization Lib Integration</title>
<link rel="shortcut icon" href="static/img/favicon.ico">
<link rel="shortcut icon" href="./static/img/favicon.ico">
</head>
<body>
<div id="bpmn-container-custom"></div>

<!-- load global settings -->
<script src="static/js/configureMxGraphGlobals.js"></script>
<!-- load mxGraph client library -->
<script src="static/js/mxClient.min.js"></script>
<!-- load app -->
<script src="static/js/lib-integration.js" type="module"></script>
<script src="./static/js/lib-integration.js" type="module"></script>
</body>
</html>
8 changes: 2 additions & 6 deletions demo/non-regression.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>BPMN Visualization Non Regression</title>
<link rel="shortcut icon" href="static/img/favicon.ico">
<link rel="shortcut icon" href="./static/img/favicon.ico">
<style>
#bpmn-container {
top: 10px;
Expand All @@ -23,11 +23,7 @@
<div id="fetch-status"></div>
<div id="bpmn-container"></div>

<!-- load global settings -->
<script src="static/js/configureMxGraphGlobals.js"></script>
<!-- load mxGraph client library -->
<script src="static/js/mxClient.min.js"></script>
<!-- load app -->
<script src="static/js/non-regression.js" type="module"></script>
<script src="./static/js/non-regression.js" type="module"></script>
</body>
</html>
10 changes: 3 additions & 7 deletions demo/rendering-diagram.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>BPMN Visualization - Diagram Rendering</title>
<link rel="shortcut icon" href="static/img/favicon.ico">
<link rel="shortcut icon" href="./static/img/favicon.ico">

<style>
.hidden {
Expand Down Expand Up @@ -35,7 +35,7 @@
}
button {
border-radius: 4px;
padding: 0px;
padding: 0;
width:28px;
height:28px;
background-color: #f9dfe8;
Expand Down Expand Up @@ -174,11 +174,7 @@
<div id="bpmn-container"></div>
</div>

<!-- load global settings -->
<script src="static/js/configureMxGraphGlobals.js"></script>
<!-- load mxGraph client library -->
<script src="static/js/mxClient.min.js"></script>
<!-- load app -->
<script src="static/js/rendering-diagram.js" type="module"></script>
<script src="./static/js/rendering-diagram.js" type="module"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion demo/static/css/tailwind.css

Large diffs are not rendered by default.

35 changes: 0 additions & 35 deletions demo/static/js/configureMxGraphGlobals.js

This file was deleted.

28 changes: 26 additions & 2 deletions demo/static/js/elements-identification.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { documentReady, FitType, getElementsByKinds, addCssClasses, log, startBpmnVisualization, updateLoadOptions } from '../../index.es.js';
import { documentReady, FitType, getElementsByKinds, addCssClasses, removeCssClasses, log, startBpmnVisualization, updateLoadOptions, ShapeUtil } from '../../index.es.js';

let lastBpmnIdsWithExtraCssClasses = [];
let lastCssClassName = '';

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
function configureControls() {
Expand All @@ -31,15 +34,36 @@ function configureControls() {
textArea.value += [textHeader, lines].join('\n') + '\n';
textArea.scrollTop = textArea.scrollHeight;

// CSS classes update
removeCssClasses(lastBpmnIdsWithExtraCssClasses, lastCssClassName);
const bpmnIds = elementsByKinds.map(elt => elt.bpmnSemantic.id);
addCssClasses(bpmnIds, 'test');
lastCssClassName = getCustomCssClassName(bpmnKind);
addCssClasses(bpmnIds, lastCssClassName);
lastBpmnIdsWithExtraCssClasses = bpmnIds;
};

document.getElementById('bpmn-kinds-textarea-clean-btn').onclick = function () {
textArea.value = '';
removeCssClasses(lastBpmnIdsWithExtraCssClasses, lastCssClassName);
lastBpmnIdsWithExtraCssClasses = [];
lastCssClassName = '';
};
}

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
function getCustomCssClassName(bpmnKind) {
if (ShapeUtil.isActivity(bpmnKind)) {
return 'detection-activity';
} else if (bpmnKind.includes('Gateway')) {
return 'detection-gateway';
} else if (bpmnKind.includes('Event')) {
return 'detection-event';
} else if (bpmnKind.includes('lane')) {
return 'detection-lane';
}
return 'detection';
}

documentReady(() => {
startBpmnVisualization({
globalOptions: {
Expand Down
Loading

0 comments on commit 04dd02b

Please sign in to comment.