Skip to content
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

refactor: simplify reset of StyleDefault #505

Merged
merged 5 commits into from
Jun 13, 2023

Conversation

tbouffard added 2 commits June 9, 2023 12:39
Introduce a shared function capable of resetting StyleDefault independently of the values that have been overridden.
@tbouffard tbouffard force-pushed the refactor/theme_reset_StyleDefault branch from b268079 to 56deae6 Compare June 9, 2023 10:40
@tbouffard tbouffard marked this pull request as ready for review June 12, 2023 10:15
Comment on lines +3 to +5
for (let key of Object.keys(bpmnvisu.StyleDefault)) {
bpmnvisu.StyleDefault[key] = originalStyleDefault[key];
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: this is the only implementation I've managed to get to work.
For example, the following has no effect. For example, the following has no effect. There's probably a good reason for this, but I haven't looked into it, because I've found another solution.

bpmnvisu.StyleDefault = { ...bpmnvisu.StyleDefault };

Copy link
Member

@csouchet csouchet Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's normal to have no effect, if we set a variable with its own value 😄

Copy link
Member Author

@tbouffard tbouffard Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I put the wrong code snippet 😸 , I meant

bpmnvisu.StyleDefault = { ...originalStyleDefault };

@tbouffard tbouffard requested a review from csouchet June 12, 2023 10:21
@tbouffard tbouffard merged commit 71d2bd1 into master Jun 13, 2023
@tbouffard tbouffard deleted the refactor/theme_reset_StyleDefault branch June 13, 2023 13:33
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