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] fix IVectorLayer.getStyle typing #75829

Merged
merged 4 commits into from
Aug 25, 2020
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Aug 24, 2020

fixes #75681

@nreese nreese added chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Aug 24, 2020
@nreese nreese requested a review from thomasneirynck August 24, 2020 22:38
@nreese nreese requested a review from a team as a code owner August 24, 2020 22:38
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

thanks for the fix.

It seems the main issue is that HeatmapLayer inherits from VectorLayer so it can re-use some implementation, but it isn't really necessary wrt. how style-types and layer-types relate. In hindsight, the union-type seems like a band-aid to that decision.

As discussed offline, another approach to consider is to avoid the need for a union-type and the required type-checking in the dynamic_style_property altogether by removing the IVectorStyle.getStyle-override. The implementation VectorLayer.getStyle():IVectorStyle remains, and HeatmapLayer.getStyle():HeatmapStyle is implied (since that is still .js).

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@nreese nreese merged commit 947a939 into elastic:master Aug 25, 2020
nreese added a commit to nreese/kibana that referenced this pull request Aug 25, 2020
* [Maps] fix IVectorLayer.getStyle typing

* update typing in VectorLayer type definition

* fix unit tests

* review feedback
nreese added a commit that referenced this pull request Aug 26, 2020
* [Maps] fix IVectorLayer.getStyle typing

* update typing in VectorLayer type definition

* fix unit tests

* review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] update IVectorLayer.getStyle to return IVectorStyle | HeatmapStyle
4 participants