-
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] Enable ability to provide custom renderer for tooltip #46150
Conversation
Pinging @elastic/kibana-gis |
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
Would it be possible to get access to Line 284 in abc239d
|
Would you just want a method to get layer name? Not sure we want to expose the entire layer API outside of maps application? |
💚 Build Succeeded |
💔 Build Failed |
💚 Build Succeeded |
getLayerName: this._getLayerName, | ||
}; | ||
|
||
if (this.props.renderTooltipContent) { |
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.
Small thing, but I wonder if we should consider setting default props to false
on renderTooltipContent
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.
I do not understand what you mean. Could you elaborate?
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.
Actually null
would be more appropriate here. I think it just feels strange to rely on a prop that's undefined
embedded several components down without having a default value. My first thought was, "we're relying on this value, what's the default if not overridden?" But yeah, undefined
evaluates to false
so it doesn't really make a difference.
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. pulled down the code and mostly just reviewed programatically since it's designed to be leveraged by other apps. It'd be nice to see some functional tests but I think that onus falls on the leveraging apps (like SIEM) if they think it'd be beneficial.
- code review
💚 Build Succeeded |
…#46150) * [Maps] Enable ability to provide custom renderer for tooltip * add unit test for on click handler * unit tests for mouseout behavior * add unit tests for on map move * clean up test * pass getLayerName to custom tooltip renderer * fix jest test
…#46843) * [Maps] Enable ability to provide custom renderer for tooltip * add unit test for on click handler * unit tests for mouseout behavior * add unit tests for on map move * clean up test * pass getLayerName to custom tooltip renderer * fix jest test
Fixes #43641
This PR enhances
factory.createFromState
method with arenderTooltipContent
parameter. When set,renderTooltipContent
is used to render the tooltip content.PR also adds unit tests for TooltipControl component
cc @spong