-
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
Fix Visual Builder wrong color rules on multiple metric #31455
Conversation
💚 Build Succeeded |
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 👍 Tested and works
Pinging @elastic/kibana-app |
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.
Code LGTM.
@@ -34,7 +34,8 @@ function getColors(props) { | |||
if (model.background_color_rules) { | |||
model.background_color_rules.forEach((rule) => { | |||
if (rule.operator && rule.value != null) { | |||
const value = series[0] && getLastValue(series[0].data) || 0; | |||
const value = (series[0] && getLastValue(series[0].data)) || |
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.
What about to simplify it
const value = getLastValue((series[0] || series[1] || {}).data || 0);
But it's optional
Fix #16431 .
The same problem has been already fixed for
gauge
tab in PR: #27810 - find out the full description of a problem there.