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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
BarChart: Fix value mappings #60066
BarChart: Fix value mappings #60066
Conversation
f.config.mappings?.some((m) => { | ||
// ValueToText mappings have a different format, where all of them are grouped into an object keyed by value | ||
if (m.type === 'value') { | ||
// === MappingType.ValueToText |
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.
this was on the previous line, until Prettier "fixed" it 馃檮
this is here because we currently have an issue with schema gen which exports enums only as types, so the values cannot be used as RHS. @sdboyer is on it, but we can probably just land it like this, since that can take more time and we'll want this fix to land in the next patch release.
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.
馃槵 that sucks
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.
fyi, this is already fixed in #55769 - i'm just loathe to pull it out and inevitably create a merge conflict there when it's already so close
i'll do it if that PR doesn't land by next week though
(cherry picked from commit 8317bf5)
BarChart: Fix value mappings (grafana#60066) (cherry picked from commit 8317bf5) Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Fixes #59776
Fixes #60002
i broke this over a month ago in #58285
you can test this by adding any Value type mapping in any BarChart panel.
apparently my mental model of value mappings having the same structure was incorrect. they're all the same except the most common
ValueToText
one 馃う