diff --git a/lib/utils/properties-panel.js b/lib/utils/properties-panel.js index c427317..8c8b81b 100644 --- a/lib/utils/properties-panel.js +++ b/lib/utils/properties-panel.js @@ -22,7 +22,11 @@ const TIMER_PROPERTIES = [ */ export function getErrors(reports, element) { return reports.reduce((errors, report) => { - if (!element || getBusinessObject(element).get('id') !== report.id) { + const { category } = report; + + if (!element + || getBusinessObject(element).get('id') !== report.id + || category !== 'error') { return errors; } @@ -298,10 +302,6 @@ export function getErrorMessage(id, report) { return 'Cannot be an expression.'; } - if (data.type === ERROR_TYPES.SECRET_EXPRESSION_FORMAT_DEPRECATED) { - return 'Secret expression format deprecated.'; - } - if (id === 'isExecutable') { const { parentNode } = data; @@ -384,7 +384,11 @@ export function getErrorMessage(id, report) { return 'Type must be defined.'; } - if (id === 'messageSubscriptionCorrelationKey') { + if (id === 'messageSubscriptionCorrelationKey' + && [ + ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED, + ERROR_TYPES.PROPERTY_REQUIRED + ].includes(data.type)) { return 'Subscription correlation key must be defined.'; } diff --git a/test/spec/utils/properties-panel-info.bpmn b/test/spec/utils/properties-panel-info.bpmn new file mode 100644 index 0000000..491a82b --- /dev/null +++ b/test/spec/utils/properties-panel-info.bpmn @@ -0,0 +1,43 @@ + + + + + SequenceFlow_1 + + + + + + + + SequenceFlow_1 + SequenceFlow_2 + + + + SequenceFlow_2 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/utils/properties-panel.spec.js b/test/spec/utils/properties-panel.spec.js index be575a5..56f2172 100644 --- a/test/spec/utils/properties-panel.spec.js +++ b/test/spec/utils/properties-panel.spec.js @@ -21,6 +21,7 @@ import { } from './lint-helper'; import propertiesPanelXML from './properties-panel.bpmn'; +import propertiesPanelInfoXML from './properties-panel-info.bpmn'; import propertiesPanelPlatformXML from './properties-panel-platform.bpmn'; describe('utils/properties-panel', function() { @@ -1590,7 +1591,7 @@ describe('utils/properties-panel', function() { // then expect(entryIds).to.eql([ 'messageSubscriptionCorrelationKey' ]); - expectErrorMessage(entryIds[ 0 ], 'Secret expression format deprecated.', report); + expectNoErrorMessage(entryIds[ 0 ], report); }); @@ -1622,7 +1623,7 @@ describe('utils/properties-panel', function() { // then expect(entryIds).to.eql([ 'ServiceTask_1-input-0-source' ]); - expectErrorMessage(entryIds[ 0 ], 'Secret expression format deprecated.', report); + expectNoErrorMessage(entryIds[ 0 ], report); }); @@ -1654,7 +1655,7 @@ describe('utils/properties-panel', function() { // then expect(entryIds).to.eql([ 'ServiceTask_1-extensionProperty-0-value' ]); - expectErrorMessage(entryIds[ 0 ], 'Secret expression format deprecated.', report); + expectNoErrorMessage(entryIds[ 0 ], report); }); }); @@ -1759,6 +1760,25 @@ describe('utils/properties-panel', function() { }); }); + + it('should not return errors for category info', async function() { + + // given + const linter = new Linter(); + + const { root } = await createModdle(propertiesPanelInfoXML); + + const reports = await linter.lint(root); + + // when + let element = root.rootElements[ 0 ].flowElements.find(({ id }) => id === 'Task_1'); + + let errors = getErrors(reports, element); + + // then + expect(errors).to.be.empty; + }); + }); }); @@ -1825,4 +1845,8 @@ function expectErrorMessage(id, expectedErrorMessage, report) { // then expect(errorMessage).to.equal(expectedErrorMessage); +} + +function expectNoErrorMessage(id, report) { + expectErrorMessage(id, undefined, report); } \ No newline at end of file