Skip to content

fix: CellOverlay constructor use all parameters to set properties - #159

Merged
tbouffard merged 2 commits into
developmentfrom
fix/overlay_constructor_use_all_parameters
Dec 16, 2022
Merged

fix: CellOverlay constructor use all parameters to set properties#159
tbouffard merged 2 commits into
developmentfrom
fix/overlay_constructor_use_all_parameters

Conversation

@tbouffard

@tbouffard tbouffard commented Dec 14, 2022

Copy link
Copy Markdown
Member

Summary

The align and verticalAlign values passed to the constructor weren't set, so the overlay position was always set to the default one.

The align and verticalAlign properties are now using the AlignValue and VAlignValue types respectively instead of
defining inline types. This improves the consistent in the whole code.

To demonstrate the fix, the Overlays story now set 'align' and 'verticalAlign' randomly.

Screenshots

See the fix in action with the Overlays story that set the overlay position randomly.

overlays_before
Before, the overlay position was always bottom right.

With the fix, it actually changes.
overlays_after

Other info
As in #152, introduce jest to test the fix and the whole implementation of the changed method. Types check support is provided by ts-jest. As maxGraph uses a lot of browser objects, also setup jest-jsdom-environment.

This is a starting point. I created a discussion about a test strategy and choosing the test framework: #153.
In the short term, I would like to see this PR merged as is to move forward (see discussion for details).

The `align` and `verticalAlign` values passed to the constructor weren't set, so the overlay position was always set to
the default one.

The `align` and `verticalAlign` properties are now using the AlignValue and VAlignValue types respectively instead of
defining inline types. This improves the consistent in the whole code.

To demonstrate the fix, the Overlays story now set 'align' and 'verticalAlign' randomly.
@tbouffard tbouffard added the bug Something isn't working label Dec 14, 2022
@tbouffard
tbouffard marked this pull request as ready for review December 14, 2022 18:05
@tbouffard
tbouffard requested a review from csouchet December 14, 2022 18:06
@tbouffard
tbouffard merged commit b7a322b into development Dec 16, 2022
@tbouffard
tbouffard deleted the fix/overlay_constructor_use_all_parameters branch December 16, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants