@camunda/linting 1.3.0 → 2.0.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.
@@ -17,6 +17,12 @@ const TIMER_PROPERTIES = [
17
17
  'timeDuration'
18
18
  ];
19
19
 
20
+ const TIMER_PROPERTY_LABELS = {
21
+ timeCycle: 'Cycle',
22
+ timeDate: 'Date',
23
+ timeDuration: 'Duration'
24
+ };
25
+
20
26
  const executionPlatformLabels = {
21
27
  'Camunda Cloud': {
22
28
  'default': 'Camunda',
@@ -361,6 +367,10 @@ function getPropertyNotAllowedErrorMessage(report, executionPlatform, executionP
361
367
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Condition expression> is only supported if the source is an <Exclusive Gateway> or <Inclusive Gateway>`;
362
368
  }
363
369
 
370
+ if (is(node, 'bpmn:TimerEventDefinition') && TIMER_PROPERTIES.includes(property)) {
371
+ return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <${ TIMER_PROPERTY_LABELS[ property ] }>`, executionPlatform, executionPlatformVersion, allowedVersion);
372
+ }
373
+
364
374
  return message;
365
375
  }
366
376
 
@@ -48,9 +48,14 @@ export function getEntryIds(report) {
48
48
  const {
49
49
  data = {},
50
50
  id,
51
- path
51
+ path,
52
+ entryIds
52
53
  } = report;
53
54
 
55
+ if (entryIds) {
56
+ return entryIds;
57
+ }
58
+
54
59
  if (isPropertyError(data, 'isExecutable')) {
55
60
  return [ 'isExecutable' ];
56
61
  }
@@ -174,10 +179,6 @@ export function getEntryIds(report) {
174
179
  return [ 'conditionExpression' ];
175
180
  }
176
181
 
177
- if (isPropertyError(data, 'timeDuration', 'bpmn:TimerEventDefinition')) {
178
- return [ 'timerEventDefinitionDurationValue' ];
179
- }
180
-
181
182
  if (isPropertyError(data, 'completionCondition', 'bpmn:MultiInstanceLoopCharacteristics')) {
182
183
  return [ 'multiInstance-completionCondition' ];
183
184
  }
@@ -200,6 +201,12 @@ export function getEntryIds(report) {
200
201
  return [ 'timerEventDefinitionValue' ];
201
202
  }
202
203
 
204
+ if (isPropertyError(data, 'timeCycle', 'bpmn:TimerEventDefinition')
205
+ || isPropertyError(data, 'timeDate', 'bpmn:TimerEventDefinition')
206
+ || isPropertyError(data, 'timeDuration', 'bpmn:TimerEventDefinition')) {
207
+ return [ 'timerEventDefinitionType' ];
208
+ }
209
+
203
210
  const LIST_PROPERTIES = [
204
211
  [ 'zeebe:Input', 'input' ],
205
212
  [ 'zeebe:Output', 'output' ],
@@ -257,7 +264,7 @@ export function getEntryIds(report) {
257
264
  }
258
265
 
259
266
  export function getErrorMessage(id, report) {
260
- const { data } = report;
267
+ const { data = {} } = report;
261
268
 
262
269
  // do not override FEEL message
263
270
  if (data.type === ERROR_TYPES.FEEL_EXPRESSION_INVALID) {
@@ -342,7 +349,11 @@ export function getErrorMessage(id, report) {
342
349
  return 'Process ID must be defined.';
343
350
  }
344
351
 
345
- if (id === 'taskDefinitionType' || id === 'timerEventDefinitionType') {
352
+ if (id === 'taskDefinitionType') {
353
+ return 'Type must be defined.';
354
+ }
355
+
356
+ if (id === 'timerEventDefinitionType' && data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
346
357
  return 'Type must be defined.';
347
358
  }
348
359
 
@@ -370,6 +381,10 @@ export function getErrorMessage(id, report) {
370
381
  return 'Condition expression must be defined.';
371
382
  }
372
383
 
384
+ if (id === 'timerEventDefinitionType' && data.type === ERROR_TYPES.PROPERTY_NOT_ALLOWED) {
385
+ return 'Type not supported.';
386
+ }
387
+
373
388
  if (id === 'timerEventDefinitionValue') {
374
389
  if (data.type === ERROR_TYPES.EXPRESSION_REQUIRED) {
375
390
  return 'Value must be defined.';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "bpmn-moddle": "^8.0.0",
31
31
  "bpmnlint": "^8.0.0",
32
- "bpmnlint-plugin-camunda-compat": "^1.3.1",
32
+ "bpmnlint-plugin-camunda-compat": "^1.3.2",
33
33
  "bpmnlint-utils": "^1.0.2",
34
34
  "min-dash": "^4.0.0",
35
35
  "min-dom": "^4.1.0",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "bpmn-js": "^11.1.1",
41
- "bpmn-js-properties-panel": "^1.20.0",
42
- "camunda-bpmn-js-behaviors": "^0.5.0",
41
+ "bpmn-js-properties-panel": "^2.0.0",
42
+ "camunda-bpmn-js-behaviors": "^0.6.0",
43
43
  "chai": "^4.3.7",
44
44
  "cross-env": "^7.0.3",
45
45
  "eslint": "^8.32.0",
@@ -59,7 +59,7 @@
59
59
  "webpack": "^5.75.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "bpmn-js-properties-panel": ">= 1.10.0"
62
+ "bpmn-js-properties-panel": ">= 2.0.0"
63
63
  },
64
64
  "peerDependenciesMeta": {
65
65
  "bpmn-js-properties-panel": {