@camunda/linting 0.5.0-alpha.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ :root {
2
+ --color-red-360-100-45: hsl(360, 100%, 45%);
3
+ --color-white: hsl(0, 0%, 100%);
4
+
5
+ --linting-annotation-background-color: var(--color-red-360-100-45);
6
+ --linting-annotation-fill-color: var(--color-white);
7
+ }
8
+
9
+ .djs-overlays:not(.selected) .bjs-linting-annotation {
10
+ opacity: 0.5;
11
+ }
12
+
13
+ .djs-overlays.selected .bjs-linting-annotation,
14
+ .djs-overlays .bjs-linting-annotation:hover {
15
+ opacity: 1;
16
+ }
17
+
18
+ .bjs-linting-annotation {
19
+ display: flex;
20
+ flex-direction: row;
21
+ align-items: center;
22
+ padding: 1px;
23
+ border-radius: 2px;
24
+ background-color: var(--linting-annotation-background-color);
25
+ cursor: default;
26
+ z-index: 100000;
27
+ }
28
+
29
+ .bjs-linting-annotation > svg {
30
+ fill: var(--linting-annotation-fill-color);
31
+ width: 18px;
32
+ height: 18px;
33
+ }
@@ -1,13 +1,14 @@
1
1
  import { getErrors } from '../utils/properties-panel';
2
2
 
3
3
  export default class Linting {
4
- constructor(canvas, elementRegistry, eventBus, lintingAnnotations, selection) {
4
+ constructor(canvas, config, elementRegistry, eventBus, lintingAnnotations, selection) {
5
5
  this._canvas = canvas;
6
6
  this._elementRegistry = elementRegistry;
7
7
  this._eventBus = eventBus;
8
8
  this._lintingAnnotations = lintingAnnotations;
9
9
  this._selection = selection;
10
10
 
11
+ this._active = config && config.active || false;
11
12
  this._reports = [];
12
13
 
13
14
  eventBus.on('selection.changed', () => this._update());
@@ -43,20 +44,25 @@ export default class Linting {
43
44
  }
44
45
 
45
46
  activate() {
47
+ this._active = true;
48
+
46
49
  this._update();
47
50
  }
48
51
 
49
52
  deactivate() {
50
- this._update([]);
53
+ this._active = false;
54
+
55
+ this._update();
51
56
  }
52
57
 
53
- _update(reports) {
54
- if (!reports) {
55
- reports = this._reports;
56
- }
58
+ isActive() {
59
+ return this._active;
60
+ }
61
+
62
+ _update() {
57
63
 
58
64
  // set annotations
59
- this._lintingAnnotations.setErrors(reports);
65
+ this._lintingAnnotations.setErrors(this.isActive() ? this._reports : []);
60
66
 
61
67
  // set properties panel errors
62
68
  const selectedElement = this._getSelectedElement();
@@ -85,6 +91,7 @@ export default class Linting {
85
91
 
86
92
  Linting.$inject = [
87
93
  'canvas',
94
+ 'config.linting',
88
95
  'elementRegistry',
89
96
  'eventBus',
90
97
  'lintingAnnotations',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "0.5.0-alpha.1",
3
+ "version": "0.5.0",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -62,6 +62,7 @@
62
62
  }
63
63
  },
64
64
  "files": [
65
+ "assets",
65
66
  "lib",
66
67
  "modeler.js"
67
68
  ],
package/CHANGELOG.md DELETED
@@ -1,66 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to [@camunda/linting](https://github.com/camunda/linting) are documented here. We use [semantic versioning](http://semver.org/) for releases.
4
-
5
- ## Unreleased
6
-
7
- ___Note:__ Yet to be released changes appear here._
8
-
9
- ## 0.5.0-alpha.1
10
-
11
- * `FIX`: publish modeler.js
12
-
13
- ## 0.5.0-alpha.0
14
-
15
- * `FEAT`: add bpmn-js plugin for canvas and properties panel errors ([#11](https://github.com/camunda/linting/pull/11))
16
- * `FEAT`: add no-zeebe-properties rule ([#43](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/43))
17
-
18
- ## 0.4.1
19
-
20
- * `DEPS`: broaden supported versions range of `bpmn-js-properties-panel`
21
-
22
- ## 0.4.0
23
-
24
- * `FEAT`: add duplicate task headers rule ([#41](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/41))
25
-
26
- ## 0.3.5
27
-
28
- * `FIX`: ignore null properties ([#39](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/39))
29
-
30
- ## 0.3.4
31
-
32
- * `FIX`: make `bpmn-moddle` and `zeebe-bpmn-moddle` production dependencies ([#9](https://github.com/camunda/linting/pull/9))
33
-
34
- ## 0.3.3
35
-
36
- * `FIX`: fix business rule task error message in properties panel ([#8](https://github.com/camunda/linting/pull/8))
37
-
38
- ## 0.3.2
39
-
40
- * `FIX`: make `modeler-moddle` dependency ([e9d53714](https://github.com/camunda/linting/commit/e9d5371456cd2e783ae2c7c0c3ca0f4c5047db1a))
41
-
42
- ## 0.3.1
43
-
44
- * `FIX`: include `properties-panel.js` in published package ([a532ba5b](https://github.com/camunda/linting/commit/a532ba5b7bf0b126477c218484e668c418875b4e))
45
-
46
- ## 0.3.0
47
-
48
- * `FEAT`: add properties panel entry ID to reports ([#7](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/7))
49
- * `FEAT`: add #getErrors function that creates properties panel errors from reports ([#7](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/7))
50
- * `FEAT`: adjust connectors error message ([#6](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/6))
51
-
52
- ### BREAKING CHANGES
53
-
54
- * #lint is not static anymore, Linter must be instantiated
55
-
56
- ## 0.2.0
57
-
58
- * `FEAT`: add templates rule ([#31](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/31))
59
-
60
- ## 0.1.1
61
-
62
- * `FIX`: lint subscription only if start event child of sub process ([#34](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/34))
63
-
64
- ## 0.1.0
65
-
66
- * `FEAT`: initial release bundling [bpmnlint](https://github.com/bpmn-io/bpmnlint) and [bpmnlint-plugin-camunda-compat](https://github.com/camunda/bpmnlint-plugin-camunda-compat/) and Camunda specific functionality ([#1](https://github.com/camunda/linting/pull/1))