-
Notifications
You must be signed in to change notification settings - Fork 36
fix: correctly ignore activity and task label bounds #3434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The position (x and y coordinates) were not ignored. Only the global positioning of the label, relative to the shape was updated. Also rename some visual tests prior adding new ones.
|
🎊 PR Preview b6f4d82 has been successfully built and deployed to https://process-analytics-bpmn-visualization-js-demo_preview-pr-3434.surge.sh 🕐 Build time: 0.011s 🤖 By surge-preview |
|
🎊 PR Preview b6f4d82 has been successfully built and deployed to https://process-analytics-bpmn-visualization-js-doc_preview-pr-3434.surge.sh 🕐 Build time: 0.011s 🤖 By surge-preview |
|
| export function isLabelBoundsIgnored(shape: Shape, ignoreBpmnActivityLabelBounds: boolean, ignoreBpmnTaskLabelBounds: boolean): boolean { | ||
| const kind = shape.bpmnElement.kind; | ||
| if (ShapeUtil.isPoolOrLane(kind)) { | ||
| return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: restore comment
| return true; | |
| // pool/lane label bounds are not managed for now (use hard coded values) | |
| return true; |
| const imageSnapshotConfigurator = ignoreBpmnActivityLabelBounds | ||
| ? new ImageSnapshotConfigurator(new ImageSnapshotThresholdsActivityLabelBoundsIgnored(), 'bpmn-rendering-ignore-options/ignored') | ||
| : new ImageSnapshotConfigurator(new ImageSnapshotThresholdsActivityLabelBounds(), 'bpmn-rendering-ignore-options/not-ignored'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: Use a single MultiBrowserImageSnapshotThresholds class to managed both ignored/not-ignored use case as done in https://github.com/process-analytics/bpmn-visualization-js/blob/v0.47.0/test/e2e/bpmn.theme.test.ts#L68
The key would be the use case and not the name of the diagram
The same applies to the other test
| [ShapeBpmnElementKind.GATEWAY_PARALLEL, false], | ||
| ]; | ||
|
|
||
| test.each(cases)('should ignore %s label bounds? %s', (kind, expected) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: try to inline the cases variable (apply to all tests)
| return true; | ||
| } | ||
|
|
||
| if (ignoreBpmnActivityLabelBounds && ShapeUtil.isActivity(kind)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep a single return including the all conditions




The position (x and y coordinates) were not ignored.
Only the global positioning of the label, relative to the shape was updated.
Also rename some visual tests prior adding new ones, including test for ignore label styles as well.