Skip to content

Commit

Permalink
fix: fix properties panel entry ID for user task Priority
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Sep 9, 2024
1 parent caf1f36 commit 5fd8b81
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
7 changes: 2 additions & 5 deletions lib/utils/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,11 @@ export function getEntryIds(report) {
return ids;
}

if (isExpressionValueNotAllowedError(data, 'priority', 'zeebe:PriorityDefinition')) {
if (isExpressionValueNotAllowedError(data, 'priority', 'zeebe:PriorityDefinition')
|| isExtensionElementNotAllowedError(data, 'zeebe:PriorityDefinition', 'bpmn:UserTask')) {
return [ 'priorityDefinitionPriority' ];
}

if (isExtensionElementNotAllowedError(data, 'zeebe:PriorityDefinition', 'bpmn:UserTask')) {
return [ 'priorityDefinition' ];
}

if (isPropertyError(data, 'propagateAllParentVariables', 'zeebe:CalledElement')) {
return [ 'propagateAllParentVariables' ];
}
Expand Down
29 changes: 27 additions & 2 deletions test/spec/utils/properties-panel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,32 @@ describe('utils/properties-panel', function() {
});


it('user task - Priority', async function() {
it('user task - Priority not supported', async function() {

// given
const node = createElement('bpmn:UserTask', {
extensionElements: createElement('bpmn:ExtensionElements', {
values: [
createElement('zeebe:PriorityDefinition')
]
})
});

const { default: rule } = await import('bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-priority-definition');

const report = await getLintError(node, rule, { version: '8.5' });

// when
const entryIds = getEntryIds(report);

// then
expect(entryIds).to.eql([ 'priorityDefinitionPriority' ]);

expectErrorMessage(entryIds[ 0 ], 'Only supported by Camunda 8.6 or newer.', report);
});


it('user task - Priority value not supported', async function() {

// given
const node = createElement('bpmn:UserTask', {
Expand All @@ -1737,7 +1762,7 @@ describe('utils/properties-panel', function() {

const { default: rule } = await import('bpmnlint-plugin-camunda-compat/rules/camunda-cloud/priority-definition');

const report = await getLintError(node, rule);
const report = await getLintError(node, rule, { version: '8.6' });

// when
const entryIds = getEntryIds(report);
Expand Down

0 comments on commit 5fd8b81

Please sign in to comment.