Skip to content

Commit

Permalink
chore: persist all entryIds in the report
Browse files Browse the repository at this point in the history
  • Loading branch information
marstamm committed Jul 6, 2023
1 parent 8dbcba9 commit 4bec830
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to [@camunda/linting](https://github.com/camunda/linting) ar

___Note:__ Yet to be released changes appear here._

* `CHORE`: persist all `entryIds` in the report ([#63](https://github.com/camunda/linting/pull/63))

## 3.0.0

* `FEAT`: rule errors are now reported as `rule-error` category instead of `error` ([#109](https://github.com/bpmn-io/bpmnlint/pull/109))
Expand Down
2 changes: 1 addition & 1 deletion lib/Linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Linter {
this._modeler
),
propertiesPanel: {
entryId: entryIds[ Math.max(0, entryIds.length - 1) ]
entryIds
},
rule
};
Expand Down
4 changes: 2 additions & 2 deletions lib/modeler/Linting.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ export default class Linting {
this._selection.select(element);
}

const { entryId } = propertiesPanel;
const { entryIds = [] } = propertiesPanel;

// TODO(philippfromme): remove timeout once properties panel is fixed
setTimeout(() => {
this._eventBus.fire('propertiesPanel.showEntry', {
id: entryId
id: entryIds[ Math.max(0, entryIds.length - 1) ]
});
});
}
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export function getEntryIds(report) {
data = {},
id,
path,
entryIds
propertiesPanel = {}
} = report;

if (entryIds) {
return entryIds;
if (propertiesPanel.entryIds) {
return propertiesPanel.entryIds;
}

if (isPropertyError(data, 'isExecutable')) {
Expand Down
10 changes: 9 additions & 1 deletion test/spec/utils/properties-panel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ describe('utils/properties-panel', function() {

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

Expand Down

0 comments on commit 4bec830

Please sign in to comment.