-
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
[Security Solution] Fix topN grouping when field type is boolean #131958
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
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!
I tested it locally and couldn't find any issue.
Thank you Angela!
@elasticmachine merge upstream |
@@ -18,7 +18,8 @@ export const getGenericData = <T>( | |||
): MatrixHistogramData[] => { | |||
let result: MatrixHistogramData[] = []; | |||
data.forEach((bucketData: unknown) => { | |||
const group = get('key', bucketData); | |||
// if key is not a string, use key_as_string instead. |
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.
Isn't this if key_as_string
is present use it, else default to the existing key?
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.
Yes, that's what I mean. Updated the wording as well, thank you!
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.
Just one comment about the wording of a comment in the helpers file . Tested locally and looks good. Thanks!
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
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…1958) (#132273) * fix grouping * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * fix grouping * unit tests * fix types * update comment Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 3f5197a) Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
Summary
#131216
Before:
The legend displays 0, 1 when field type is boolean.
field.value.mp4
After:
The legend displays true, false when field type is boolean.
topN.mp4
Steps to verify:
fields
, clickCreate field
and create a runtime field for testing.process_interactive
, typeBoolean
,Set value
:emit(true)
process.interactive
cell, expand the hover actions and clickShow top values
Checklist
Delete any items that are not applicable to this PR.