Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] AIOps: Field stats fix (elastic#204403)
## 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)
- Loading branch information