Fix small mistake made in PR 6511#7034
Merged
Merged
Conversation
Contributor
Author
| makeLabel: function () { | ||
| let details = this.keyedDetails(this.params.customLabel)[this.key]; | ||
| return details.title + ' of ' + this.fieldDisplayName(); | ||
| return this.keyedDetails(this.params.customLabel, this.fieldDisplayName())[this.key].title; |
Contributor
There was a problem hiding this comment.
I think this should be broken into a few lines and use lodash's get function like:
const fieldDisplay = this.fieldDisplayName();
const details = this.keyedDetails(this.param.customLabel, fieldDisplay);
return get(details, [this.key, 'title']);Since the keyedDetails() function is defined so close by it probably won't matter, but it would make me feel better.
Contributor
Author
There was a problem hiding this comment.
Yeah, I thought about breaking it up too, for better readability. Thanks for nudging me over the fence :)
I'll use lodash's get function but could you educate me as to why that's preferable?
Contributor
|
LGTM |
patrykkopycinski
pushed a commit
to patrykkopycinski/kibana
that referenced
this pull request
May 6, 2026
Fix small mistake made in PR 6511
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In PR #6511, I attempted to fix the issue where custom labels were not being honored by the standard deviation metric aggregation. However, I did not implement the fix exactly as specified in bullet point 1 in #6511 (comment). This PR fixes the implementation.