Skip to content

Commit

Permalink
feat: allow custom entryIds
Browse files Browse the repository at this point in the history
  • Loading branch information
marstamm authored and merge-me[bot] committed Jun 7, 2023
1 parent 9776d7e commit 278d4a6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/utils/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@ export function getEntryIds(report) {
const {
data = {},
id,
path
path,
entryIds
} = report;

if (entryIds) {
return entryIds;
}

if (isPropertyError(data, 'isExecutable')) {
return [ 'isExecutable' ];
}
Expand Down Expand Up @@ -257,7 +262,7 @@ export function getEntryIds(report) {
}

export function getErrorMessage(id, report) {
const { data } = report;
const { data = {} } = report;

// do not override FEEL message
if (data.type === ERROR_TYPES.FEEL_EXPRESSION_INVALID) {
Expand Down
21 changes: 21 additions & 0 deletions test/spec/utils/properties-panel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ describe('utils/properties-panel', function() {

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

it('should keep original entryIds', async function() {

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

const rule = () => ({
check: (node, reporter) => {
reporter.report(node.id, 'My Custom Message' , { entryIds: [ 'myCustomEntry' ] });
}
});

const report = await getLintError(node, rule);

// when
const entryIds = getEntryIds(report);

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


it('executable-process - Executable (process)', async function() {

// given
Expand Down

0 comments on commit 278d4a6

Please sign in to comment.