Skip to content

refactor: directly override shape.createSvgCanvas#3043

Merged
tbouffard merged 1 commit into
masterfrom
refactor/no_shape.createSvgCanvas_prototype_override
Mar 1, 2024
Merged

refactor: directly override shape.createSvgCanvas#3043
tbouffard merged 1 commit into
masterfrom
refactor/no_shape.createSvgCanvas_prototype_override

Conversation

@tbouffard

@tbouffard tbouffard commented Feb 22, 2024

Copy link
Copy Markdown
Member

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

Testing

The change is validated by integration tests that check that the bpmn-id and the CSS classes in the DOM are correctly
set on both shapes/edges and labels.
This is also validated with the elements-identification.html demo. The CSS class is correctly applied to the label.

@tbouffard tbouffard added depends on another PR ⚠️ Pull request depending on another one. The depending must be merged first refactoring Code refactoring labels Feb 22, 2024
Comment thread src/component/mxgraph/config/ShapeConfigurator.ts Outdated
Previously, this was done by modifying the shape prototype.
The new implementation limits side effects on application that use mxGraph directly, and don't modify code we don't own.

The change is validated by integration tests that check that the bpmn-id and the CSS classes in the DOM are correctly
set on both shapes/edges and labels.
This is also validated with the elements-identification.html demo. The CSS class is correctly applied to the label.
@tbouffard tbouffard force-pushed the refactor/no_shape.createSvgCanvas_prototype_override branch from 4559246 to fd9a1ec Compare March 1, 2024 10:50
@tbouffard tbouffard removed the depends on another PR ⚠️ Pull request depending on another one. The depending must be merged first label Mar 1, 2024
@github-actions

github-actions Bot commented Mar 1, 2024

Copy link
Copy Markdown

♻️ PR Preview fd9a1ec 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 fd9a1ec has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@sonarqubecloud

sonarqubecloud Bot commented Mar 1, 2024

Copy link
Copy Markdown

@tbouffard tbouffard marked this pull request as ready for review March 1, 2024 11:07
@tbouffard tbouffard requested review from csouchet March 1, 2024 11:07
@tbouffard tbouffard merged commit 776e500 into master Mar 1, 2024
@tbouffard tbouffard deleted the refactor/no_shape.createSvgCanvas_prototype_override branch March 1, 2024 14:37
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