-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps] clean-up unsaved state check #61535
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
💚 Build SucceededTo update your PR or re-run it, just comment with: |
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.
lgtm! Thanks for this fix, works well!
- tested locally in chrome
- code review
Reverted as it seems this started causing an alert dialog to be open on master, breaking the functional tests that follow it. It's unclear, but it seems the that there might be an unexpected relationship between this change and #61386 Reverted the 7.x backport as well, @nreese is working on resubmitting this. |
* [Maps] clean-up unsaved state check (#61535) * close layer panel in functional test * skip vector styling test * skip saved object management test * skip all of group 7 tests * turn back on group 7, skip full screen * turn on all tests except full screen * unskip all tests and resolve root problem Co-authored-by: Elastic Machine <[email protected]>
* [Maps] clean-up unsaved state check (elastic#61535) * close layer panel in functional test * skip vector styling test * skip saved object management test * skip all of group 7 tests * turn back on group 7, skip full screen * turn on all tests except full screen * unskip all tests and resolve root problem Co-authored-by: Elastic Machine <[email protected]>
* [Maps] clean-up unsaved state check (elastic#61535) * close layer panel in functional test * skip vector styling test * skip saved object management test * skip all of group 7 tests * turn back on group 7, skip full screen * turn on all tests except full screen * unskip all tests and resolve root problem Co-authored-by: Elastic Machine <[email protected]>
* [Maps] clean-up unsaved state check (#61535) * close layer panel in functional test * skip vector styling test * skip saved object management test * skip all of group 7 tests * turn back on group 7, skip full screen * turn on all tests except full screen * unskip all tests and resolve root problem Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
* [Maps] clean-up unsaved state check (#61535) * close layer panel in functional test * skip vector styling test * skip saved object management test * skip all of group 7 tests * turn back on group 7, skip full screen * turn on all tests except full screen * unskip all tests and resolve root problem Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
There is a bug in unsaved state check in the Map application. Follow the steps below to view the bug.
fill color
to use by value styling for any field.Maps
in the top nav to go to the maps list.The problem is cause by changes of behavior from categorical styling refactors. Those changes exposed an existing bug in unsaved state check.
Categorical styling changed
DynamicColorForm
onChange handler to set bothcustomColorRamp
andcolor
properties. Yet, eithercustomColorRamp
orcolor
is provided when the handler is called so the state contained one of them set to undefined.This behavior change exposed an existing bug in the unsaved state check. The unsaved state check compared the current state to state that had been stringified and re-parsed. The problem is that JSON.stringify removes object keys with undefined values so when the stringified and re-parsed version were compared to the current state, they looked different even though they were the same.
This PR resolves both problems. It avoids setting undefined when
customColorRamp
orcolor
is not provided . The PR also sends the current state through the JSON.stringify and JSON.parse ringer so the comparison is comparing the same things.