Skip to content

Commit

Permalink
feat(platform): make HTTL an info hint
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Feb 22, 2024
1 parent a65806f commit f297655
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 88 deletions.
4 changes: 0 additions & 4 deletions lib/utils/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,6 @@ export function getErrorMessage(id, report) {
return 'Not supported.';
}

if (id === 'historyTimeToLive') {
return 'Time to live must be defined.';
}

if (id === 'taskScheduleDueDate') {
if (data.type === ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED) {
return 'Not supported.';
Expand Down
28 changes: 1 addition & 27 deletions test/spec/utils/error-messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {
} from '../../../lib/utils/error-messages';

import {
createElement,
createElementCamundaPlatform
createElement
} from '../../helper';

import {
Expand Down Expand Up @@ -2022,31 +2021,6 @@ describe('utils/error-messages', function() {

});


describe('Camunda Platform (Camunda 7)', function() {

describe('property required', function() {

it('should adjust (history time to live)', async function() {

// given
const node = createElementCamundaPlatform('bpmn:Process');

const { default: rule } = await import('bpmnlint-plugin-camunda-compat/rules/camunda-platform/history-time-to-live');

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

// when
const errorMessage = getErrorMessage(report);

// then
expect(errorMessage).to.equal('A <Process> must have a defined <History time to live>');
});

});

});

});

describe('#getExecutionPlatformLabel', function() {
Expand Down
59 changes: 2 additions & 57 deletions test/spec/utils/properties-panel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import {

import {
createElement,
createElementCamundaPlatform,
createModdle,
createModdleCamundaPlatform
createModdle
} from '../../helper';

import {
Expand All @@ -20,7 +18,6 @@ import {

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() {

Expand Down Expand Up @@ -1918,61 +1915,9 @@ describe('utils/properties-panel', function() {

});


describe('Camunda Platform (Camunda 7)', function() {

describe('#getEntryId and #getErrorMessage', function() {

it('History cleanup (no time to live)', async function() {

// given
const node = createElementCamundaPlatform('bpmn:Process', { isExecutable: true });

const { default: rule } = await import('bpmnlint-plugin-camunda-compat/rules/camunda-platform/history-time-to-live');

const report = await getLintError(node, rule, { platform: 'camunda-platform', version: '7.19' });

// when
const entryIds = getEntryIds(report);

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


expectErrorMessage(entryIds[ 0 ], 'Time to live must be defined.', report);
});

});


describe('#getErrors', function() {

it('should return errors', async function() {

// given
const linter = new Linter();

const { root } = await createModdleCamundaPlatform(propertiesPanelPlatformXML);

const reports = await linter.lint(root);

// when
let element = root.rootElements[ 0 ];

let errors = getErrors(reports, element);

// then
expect(errors).to.eql({
historyTimeToLive: 'Time to live must be defined.'
});
});

});

});

});


function expectErrorMessage(id, expectedErrorMessage, report) {

// when
Expand Down

0 comments on commit f297655

Please sign in to comment.