-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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][Lens] Check filter action type to hide default filter actions in visualizations #171284
[Security Solution][Lens] Check filter action type to hide default filter actions in visualizations #171284
Conversation
…zations_filter_actions
…zations_filter_actions
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.
Thanks so much for fixing this, tested locally and LGTM 👍
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: cc @semd |
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 looks good. We can revisit in #169983.
Thank you for also cleaning up the previous shouldShowLegendAction
fix!
Summary
Bug: #171167
The previous implementation solved a different bug using a new
shouldShowLegendAction
property. This approach had a limitation on the Security Dashboards page since the Security app has no control over the properties passed to the visualization components when they are rendered through portable Dashboards.This PR fixes the problem by checking if any of the registered actions is a "filter" action
type
in the visualizations. If customized filter actions are found, the default filter actions hardcoded in the visualizations code are not added, preventing duplication of filter actions.The specific action
type
used for the check is theFILTER_CELL_ACTION_TYPE = 'cellAction-filter'
constant exported by the@kbn/cell-actions
package.This new approach uses a property stored in the registered actions themselves, so we don't need to pass any extra property to the visualization components, it works transparently. So the
shouldShowLegendAction
property has also been cleaned.Demos
Timeline using
showTopN
visualization:viz_filter_actions_timeline_demo.mov
Alerts page using
Counts
table visualization andshowTopN
visualizationviz_filter_actions_alerts_demo.mov
Portable Dashboard visualizations:
viz_filter_actions_dashboards_demo.mov
Security actions are "compatible" only inside the Security app, in the Lens app the default filter actions are displayed: