[Maps] Fix custom color ramp on save#59953
Merged
nreese merged 3 commits intoelastic:masterfrom Mar 12, 2020
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-gis (Team:Geo) |
thomasneirynck
approved these changes
Mar 11, 2020
Contributor
thomasneirynck
left a comment
There was a problem hiding this comment.
thanks for fixing.
fwiw I wouldn't do this method rename in a spot-fix for a patch like this.
| return ['match', ['to-string', ['get', this._options.field.name]], ...mbStops]; | ||
| } | ||
|
|
||
| _getMbOrdinalColorStops() { |
Contributor
There was a problem hiding this comment.
thanks for removing and improving symmetry between cat and ordinal
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
nreese
added a commit
to nreese/kibana
that referenced
this pull request
Mar 12, 2020
* [Maps] Fix custom color ramp on save * clean up Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This was referenced Mar 12, 2020
nreese
added a commit
that referenced
this pull request
Mar 12, 2020
* [Maps] Fix custom color ramp on save * clean up Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
nreese
added a commit
that referenced
this pull request
Mar 12, 2020
This was referenced Mar 13, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactoring for categorical color palettes introduced a bug with ordinal custom color ramps. To view the bug, follow the following steps
bytes. Add at least 2 color stopssavein the top nav. Notice that the map fill color is not longer styled after saving.Before saving

After saving

The problem is this guard against incomplete color configuration, https://github.com/elastic/kibana/blob/7.6/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js#L108
During the refactoring for categorical color palettes, styleOptions.color is getting removed from the options during save. This causes this guard to return false even though the color configuration is complete for custom color ramp.
This PR cleans up the logic of
_getMbColorto better check for config completeness when using custom color ramps and palettes. The PR also adds some unit tests to ensure the various configurations work as expected.