-
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
[ML] AIOps: Field stats fix #204403
[ML] AIOps: Field stats fix #204403
Conversation
Pinging @elastic/ml-ui (:ml) |
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.
Thanks for the fix!
💚 Build Succeeded
Metrics [docs]Async chunks
cc @walterra |
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.
Tested (Borealis and Amsterdam themes) and LGTM.
## Summary Fixes a regression introduced in elastic#203579. `EuiText` accepts EUI colors like `primary` as well as hex colors. The PR above introduced `getPercentageColor()` which assumed all colors passed in are hex colors. In case it was an EUI color token the code threw an error and the fields stats popover wouldn't fully render. This fix adds an additional check to apply `makeHighContrastColor` only if the color provided is a hex color. Before: ![CleanShot 2024-12-16 at 14 50 15@2x](https://github.com/user-attachments/assets/53a5df17-da4a-4188-a80c-5dc52cae9f39) After: ![CleanShot 2024-12-16 at 14 49 20@2x](https://github.com/user-attachments/assets/75fc093a-6cf6-4a21-bc10-05dd7d253c70) ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
## Summary Fixes a regression introduced in elastic#203579. `EuiText` accepts EUI colors like `primary` as well as hex colors. The PR above introduced `getPercentageColor()` which assumed all colors passed in are hex colors. In case it was an EUI color token the code threw an error and the fields stats popover wouldn't fully render. This fix adds an additional check to apply `makeHighContrastColor` only if the color provided is a hex color. Before: ![CleanShot 2024-12-16 at 14 50 15@2x](https://github.com/user-attachments/assets/53a5df17-da4a-4188-a80c-5dc52cae9f39) After: ![CleanShot 2024-12-16 at 14 49 20@2x](https://github.com/user-attachments/assets/75fc093a-6cf6-4a21-bc10-05dd7d253c70) ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Summary
Fixes a regression introduced in #203579.
EuiText
accepts EUI colors likeprimary
as well as hex colors. The PR above introducedgetPercentageColor()
which assumed all colors passed in are hex colors. In case it was an EUI color token the code threw an error and the fields stats popover wouldn't fully render. This fix adds an additional check to applymakeHighContrastColor
only if the color provided is a hex color.Before:
After:
Checklist
release_note:*
label is applied per the guidelines