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

[Maps] Support styles on agg fields with _of_ in name #54965

Merged
merged 3 commits into from
Jan 16, 2020

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Jan 15, 2020

This is basically the same fix as #51687

To reproduce:

  • create a grid source
  • add a metric aggregation on hour_of_day field
  • set fill color to use the above aggregation field. Notice that all grids have empty color.

Introduces VectorSource#getFieldByName to return a field-instance. In the case of agg-fields, it just returns an existing one (since they are passed in in the constructor).

The only difference is that ESAggSource#createField continues to support returning a new object. I think this helps for consistency with all the source #createField implementations. (e.g. no other VectorSource enforces that createField can only create fields that are "known". imho AggSource shouldn't either.

It removes the unused createField-method from the agg-source.

@thomasneirynck thomasneirynck requested a review from a team as a code owner January 15, 2020 21:05
@thomasneirynck thomasneirynck added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.6.0 v7.7.0 v8.0.0 labels Jan 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

This PR does not fix the root cause of the issue, that AbstractESAggSource.createField is broken if the field name contains _of_. The line below from https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/maps/public/layers/sources/es_agg_source.js#L74 needs to be modified to work if there are multiple _of_ in the fieldName. Maybe break the string apart with substring and first index of _of_ instead of using split?

    const [aggType, docField] = fieldName.split(AGG_DELIMITER);

@thomasneirynck
Copy link
Contributor Author

thanks. maybe we should just remove that method altogether? it's not used now anymore, since the vector_style uses getFieldByName.

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

lgtm
code review, tested in chrome

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@thomasneirynck thomasneirynck merged commit 2b873a7 into elastic:master Jan 16, 2020
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Jan 16, 2020
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Jan 16, 2020
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 17, 2020
…t-of-legacy

* 'master' of github.com:elastic/kibana: (142 commits)
  [Vis] Move Timelion Vis to vis_type_timelion (elastic#52069)
  Deprecate `chrome.navlinks.update` and add documentation (elastic#54893)
  [ML] Single Metric Viewer: Fix time bounds with custom strings. (elastic#55045)
  [Vis: Default editor] EUIficate and Reactify the sidebar (elastic#49864)
  [Mappings editor] Fix cannot set boolean value for "null_value" param (elastic#55015)
  [SIEM] Adds support for apm-* to the network map (elastic#54876)
  [Reporting] Define shims of legacy dependencies (elastic#54082)
  Resolver is overflow: hidden to prevent obscured elements from showing up (elastic#55076)
  Upgraded EUI to 18.2.1 (elastic#55090)
  [Maps] Support styles on agg fields with _of_ in name (elastic#54965)
  Remove xpack_main requirement, it's no longer in use (elastic#55060)
  Fix Snapshots Policies Alignment Issue in IE11 (elastic#54866)
  first rule cuts (elastic#54990)
  [DOCS] Adds geocentroid note to coordinate map (elastic#54389)
  [Canvas] Fixes the Copy Post Url link (elastic#54831)
  Fixes bugs with full screen filters (elastic#54792)
  [ML] Fix decoding in the URL state  (elastic#54915)
  Remove redundant `x-pack/typings`. (elastic#55042)
  [SIEM][Detection Engine] Adds critical missing status route to prepackaged rules
  Generate legacy vars when rendering all applications (elastic#54768)
  ...

# Conflicts:
#	x-pack/plugins/translations/translations/ja-JP.json
#	x-pack/plugins/translations/translations/zh-CN.json
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation discuss release_note:skip Skip the PR/issue when compiling release notes v7.6.0 v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants