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

[ML] Migrate ml-info-icon to EUI/React #19003

Merged
merged 5 commits into from
May 17, 2018

Conversation

walterra
Copy link
Contributor

@walterra walterra commented May 11, 2018

This replaces the angular based tooltip used in the ml-info-icon directive with one based on React/EuiTooltip. It supports transclusion and rendering of angular template snippets inside the tooltip. Because the DOM structure of the EuiTooltips and the angular/bootstrap tooltips is quite different there is a bit more code involved to achieve this, but the result is that for this we don't have to change the markup in the original angular templates where ml-info-icon is used.

This doesn't use ngReact to have more detailed control on how to work with the transclusion of angular template snippets as well as skip any two-way-binding which isn't necessary for these type of tooltips.

Follow-up PRs will use this as a basis to replace other angular based tooltips.

Part of #18374.

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM. Several steps later it will be nice if we can just replace this with a wrapper around EuiIconTip to use the text in the tooltips.json file.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM
Just one comment about end of file new lines

* you may not use this file except in compliance with the Elastic License.
*/

import './tooltip_directive';
Copy link
Member

Choose a reason for hiding this comment

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

new line missing here.
not sure if this is a bad thing as there is no lint rule for it. but github flags it up.
"files.insertFinalNewline": true in vscode will do this automatically.
The same for x-pack/plugins/ml/public/components/tooltip/tooltip_directive.js

@elasticmachine
Copy link
Contributor

💔 Build Failed

@walterra
Copy link
Contributor Author

jenkins test this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@walterra walterra merged commit 13b97ac into elastic:master May 17, 2018
@walterra walterra deleted the ml-eui-tooltips branch May 17, 2018 07:21
walterra added a commit to walterra/kibana that referenced this pull request May 17, 2018
This replaces the angular based tooltip used in the ml-info-icon directive with one based on React/EuiTooltip. It supports transclusion and rendering of angular template snippets inside the tooltip. Because the DOM structure of the EuiTooltips and the angular/bootstrap tooltips is quite different there is a bit more code involved to achieve this, but the result is that for this we don't have to change the markup in the original angular templates where ml-info-icon is used.
walterra added a commit that referenced this pull request May 17, 2018
This replaces the angular based tooltip used in the ml-info-icon directive with one based on React/EuiTooltip. It supports transclusion and rendering of angular template snippets inside the tooltip. Because the DOM structure of the EuiTooltips and the angular/bootstrap tooltips is quite different there is a bit more code involved to achieve this, but the result is that for this we don't have to change the markup in the original angular templates where ml-info-icon is used.
@walterra walterra changed the title [ML] Migrate ml-info-icon to React/EUI [ML] Migrate ml-info-icon to EUI/React May 17, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants