Skip to content

refactor: directly override svgCanvas2D.getTextCss#3046

Merged
tbouffard merged 3 commits into
masterfrom
refactor/no_mxSvgCanvas2D.getTextCss_prototype_override
Mar 4, 2024
Merged

refactor: directly override svgCanvas2D.getTextCss#3046
tbouffard merged 3 commits into
masterfrom
refactor/no_mxSvgCanvas2D.getTextCss_prototype_override

Conversation

@tbouffard

@tbouffard tbouffard commented Mar 1, 2024

Copy link
Copy Markdown
Member

Previously, this was done by modifying the mxSvgCanvas2D prototype. The new implementation limits side effects on applications that use mxGraph directly, and doesn't modify code the lib doesn't own.

The mxGraph implementation overriding is required to ensure that the label pointer-events is set to 'none'. New integration tests have been added to validate the old behavior and ensure that the refactoring has preserved it. In particular, more tests check the labels of a greater number of BPMN element types, and the value of the "pointer-events" property of labels is explicitly checked.

The overriding implementation has been simplified to reduce the copy/paste of mxGraph code. Instead, it now calls the standard mxGraph implementation with specific settings.

Notes

Continue the work started in #3043.

Previously, this was done by modifying the svgCanvas2D prototype.
The new implementation limits side effects on applications that use mxGraph directly, and don't modify code the lib
doesn't own.

The mxGraph implementation overriding is required to ensure that the label pointer-events is set to 'none'.
New integration tests have been added to validate the old behavior and ensure that the refactoring has preserved it.
In particular, more tests check the labels of a greater number of BPMN element types, and the value of the "pointer-events"
property of labels is explicitly checked.

The overriding implementation has been simplified to reduce the copy/paste of mxGraph code. Instead, it now calls the
standard mxGraph implementation with specific settings.
@tbouffard tbouffard added the refactoring Code refactoring label Mar 1, 2024
@github-actions

github-actions Bot commented Mar 1, 2024

Copy link
Copy Markdown

♻️ PR Preview 79996cd has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions

github-actions Bot commented Mar 1, 2024

Copy link
Copy Markdown

♻️ PR Preview 79996cd has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

Comment thread src/component/mxgraph/shape/utils.ts Outdated
@sonarqubecloud

sonarqubecloud Bot commented Mar 4, 2024

Copy link
Copy Markdown

@tbouffard tbouffard requested a review from csouchet March 4, 2024 08:03
@tbouffard tbouffard marked this pull request as ready for review March 4, 2024 08:03
@tbouffard tbouffard merged commit 1c613c8 into master Mar 4, 2024
@tbouffard tbouffard deleted the refactor/no_mxSvgCanvas2D.getTextCss_prototype_override branch March 4, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants