@camunda/linting 0.7.0 → 0.7.1

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.
package/lib/Linter.js CHANGED
@@ -10,7 +10,7 @@ import { isString } from 'min-dash';
10
10
  import modelerModdle from 'modeler-moddle/resources/modeler.json';
11
11
  import zeebeModdle from 'zeebe-bpmn-moddle/resources/zeebe.json';
12
12
 
13
- import { getErrorMessage } from './utils/error-messages';
13
+ import { getErrorMessage, getExecutionPlatformLabel } from './utils/error-messages';
14
14
  import { getEntryIds } from './utils/properties-panel';
15
15
 
16
16
  const moddle = new BpmnModdle({
@@ -128,20 +128,6 @@ function getConfigName(executionPlatform, executionPlatformVersion) {
128
128
  ].join('-');
129
129
  }
130
130
 
131
- const executionPlatformLabels = {
132
- 'Camunda Cloud': {
133
- '1.0': 'Camunda 8 (Zeebe 1.0)',
134
- '1.1': 'Camunda 8 (Zeebe 1.1)',
135
- '1.2': 'Camunda 8 (Zeebe 1.2)',
136
- '1.3': 'Camunda 8 (Zeebe 1.3)',
137
- '8.0': 'Camunda 8'
138
- }
139
- };
140
-
141
- function getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) {
142
- return executionPlatformLabels[ executionPlatform ] && executionPlatformLabels[ executionPlatform ][ executionPlatformVersion ];
143
- }
144
-
145
131
  function toLowerCase(string) {
146
132
  return string.toLowerCase();
147
133
  }
@@ -65,6 +65,31 @@ export function getErrorMessage(report, executionPlatformLabel, modeler = 'deskt
65
65
  return message;
66
66
  }
67
67
 
68
+ const executionPlatformLabels = {
69
+ 'Camunda Cloud': {
70
+ 'defaultPlatformName': 'Camunda',
71
+ '1.0': 'Camunda 8 (Zeebe 1.0)',
72
+ '1.1': 'Camunda 8 (Zeebe 1.1)',
73
+ '1.2': 'Camunda 8 (Zeebe 1.2)',
74
+ '1.3': 'Camunda 8 (Zeebe 1.3)',
75
+ '8.0': 'Camunda 8'
76
+ }
77
+ };
78
+
79
+ export function getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) {
80
+ const translatedLabel = executionPlatformLabels[ executionPlatform ] && executionPlatformLabels[ executionPlatform ][ executionPlatformVersion ];
81
+
82
+ if (translatedLabel) {
83
+ return translatedLabel;
84
+ }
85
+
86
+ if (executionPlatformLabels[executionPlatform] && executionPlatformLabels[executionPlatform]['defaultPlatformName']) {
87
+ executionPlatform = executionPlatformLabels[executionPlatform]['defaultPlatformName'];
88
+ }
89
+
90
+ return `${ executionPlatform } ${ executionPlatformVersion }`;
91
+ }
92
+
68
93
  function getIndefiniteArticle(type) {
69
94
  if ([
70
95
  'Error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {