-
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
removes :filters from label #12962
removes :filters from label #12962
Conversation
@@ -75,7 +75,10 @@ export function TabbedAggResponseWriterProvider(Private) { | |||
if (group) { | |||
table.aggConfig = agg; | |||
table.key = key; | |||
table.title = (table.fieldFormatter()(key)) + ': ' + agg.makeLabel(); | |||
table.title = (table.fieldFormatter()(key)); | |||
if (agg.makeLabel() !== 'filters') { |
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 problem really affects any aggregation that does not implement makeLabel
function and relies on the default implementation (which just returns the aggregation name). How about instead of hard coding to check against filters
you check that agg.makeLabel() !== agg.name? A comment about why this check is needed would also be helpful.
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
jenkins, test this |
6f1c22a
to
ca5e892
Compare
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, but I'd recommend moving this more clear by moving the implementation of the evaluation to aggConfig. It will make code more readable and navigable.
table.title = (table.fieldFormatter()(key)) + ': ' + agg.makeLabel(); | ||
table.title = (table.fieldFormatter()(key)); | ||
// aggs that don't implement makeLabel should not add to title | ||
if (agg.makeLabel() !== agg.name) { |
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.
Can we make this a method on the aggConfig
. Something like isAggConfigOverridden
, along those lines.
closes #12827