Skip to content
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] Alert page charts new layout and chart collapse #150242

Merged
merged 8 commits into from Feb 7, 2023

Conversation

christineweng
Copy link
Contributor

@christineweng christineweng commented Feb 3, 2023

Summary

This PR is part 3 of #149173 and #146938 that add additional KPI visualizations to the Alerts page.

Capabilities added

Charts menu: changed from a drop down selection to tabs format, with wording that better describe the usage of each charts
Chart collapse: when the toggle is collapsed, instead of showing the same menu options, a summary of the KPIs are shown.

Feature flag: alertsPageChartsEnabled is set to true by default

Changes from previous PR

Before this PR, each chart (trend, tree map etc.) keeps its own state of toggle status. This is no longer suitable because the new layout does not show options when collapsed. This PR also moves the toggle status to be at the chart panel's level, and be passed down to each chart component.

One exception is the histogram (trend analysis), it is currently being used in alerts detail page and overview dashboard, hence it needs to keep track of toggle state on its own.

When charts are expanded

image

When collapsed and has data

image

When collapsed with no data

image

Checklist

Delete any items that are not applicable to this PR.

@christineweng christineweng added backport:skip This commit does not require backporting Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. release_note:feature Makes this part of the condensed release notes Team:Threat Hunting:Investigations Security Solution Investigations Team v8.7.0 labels Feb 3, 2023
@christineweng christineweng changed the title [Security Solution][Alert Charts] [Security Solution] Alert page charts new layout and chart collapse Feb 3, 2023
@christineweng christineweng marked this pull request as ready for review February 3, 2023 21:31
@christineweng christineweng requested review from a team as code owners February 3, 2023 21:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@logeekal
Copy link
Contributor

logeekal commented Feb 6, 2023

Testing this PR by cloning and it is working very well. However, I have some comments regarding UI.

  1. In below video, if you see, there are no progress/loading indicators in third panel.
Screen.Recording.2023-02-06.at.11.33.53.mov
  1. There is not loading indicator in Aggregations

Screenshot 2023-02-06 at 11 37 50

Screenshot 2023-02-06 at 11 38 09

  1. The width below graph seems a little too much.
    Screenshot 2023-02-06 at 11 39 11

  2. Do we need Other if it is 0%
    image

@christineweng
Copy link
Contributor Author

christineweng commented Feb 6, 2023

  1. Do we need Other if it is 0%
    image

Thanks Jatin for reviewing! I will look into the first 3, #4 I'll defer to design @codearos

@christineweng
Copy link
Contributor Author

@logeekal ui fixes

  1. In below video, if you see, there are no progress/loading indicators in third panel. ✅
  2. There is not loading indicator in Aggregations
Screen.Recording.2023-02-06.at.4.18.22.PM.mov
  1. The width below graph seems a little too much. ✅

image

@christineweng christineweng enabled auto-merge (squash) February 6, 2023 22:59
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3586 3588 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 12.9MB 12.9MB +7.6KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@logeekal logeekal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 🚀

@christineweng christineweng merged commit e05797b into elastic:main Feb 7, 2023
benakansara pushed a commit to benakansara/kibana that referenced this pull request Feb 7, 2023
…lastic#150242)

## Summary

This PR is part 3 of elastic#149173 and
elastic#146938 that add additional KPI
visualizations to the Alerts page.

#### Capabilities added

Charts menu: changed from a drop down selection to tabs format, with
wording that better describe the usage of each charts
Chart collapse: when the toggle is collapsed, instead of showing the
same menu options, a summary of the KPIs are shown.

Feature flag: `alertsPageChartsEnabled` is set to true by default

#### Changes from previous PR
Before this PR, each chart (trend, tree map etc.) keeps its own state of
toggle status. This is no longer suitable because the new layout does
not show options when collapsed. This PR also moves the toggle status to
be at the chart panel's level, and be passed down to each chart
component.

One exception is the histogram (trend analysis), it is currently being
used in alerts detail page and overview dashboard, hence it needs to
keep track of toggle state on its own.

#### When charts are expanded

![image](https://user-images.githubusercontent.com/18648970/216714087-a872cdeb-5d69-40fd-a392-4130ad6c925c.png)

#### When collapsed and has data

![image](https://user-images.githubusercontent.com/18648970/216714168-e4d72ca2-b214-48d8-9182-932927c0b473.png)

#### When collapsed with no data

![image](https://user-images.githubusercontent.com/18648970/216714250-628b96d2-6380-4999-a2a6-ed22eb0d8791.png)


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
christineweng added a commit that referenced this pull request Feb 8, 2023
…150504)

This PR addresses the following:

#### Bug fix
#150278 described a discrepancy
between total alert count in alert by type chart and everywhere else on
alerts page. This is due to `event.type` being a multi-select, if an
alert has 3 event types (i.e. creation, info, denied), it is counted 3
times on alert by type graph. This logic is now updated to categorize an
alert once
- if `denied` event type exists, such event count  => `Prevention`
- total alert count - prevention count => `Detection`.

#### UI improvements
- Top alerts chart no longer shows `Other` when number of grouping is
less than 10 per
#150242 (comment)

![image](https://user-images.githubusercontent.com/18648970/217382166-073d2da9-f49d-4bf7-9a08-3795d5948e33.png)
- Changed `EmptyDonutChart`'s background based on dark/light mode 
Before -> After

![image](https://user-images.githubusercontent.com/18648970/217382463-1ef44127-1cdf-4a70-85f2-8c78a612c485.png)
- Loading spinner for donut chart was not showing, it is now fixed

![image](https://user-images.githubusercontent.com/18648970/217382665-93e093e3-119a-4be4-a313-072ef118eec7.png)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 8, 2023
…lastic#150504)

This PR addresses the following:

#### Bug fix
elastic#150278 described a discrepancy
between total alert count in alert by type chart and everywhere else on
alerts page. This is due to `event.type` being a multi-select, if an
alert has 3 event types (i.e. creation, info, denied), it is counted 3
times on alert by type graph. This logic is now updated to categorize an
alert once
- if `denied` event type exists, such event count  => `Prevention`
- total alert count - prevention count => `Detection`.

#### UI improvements
- Top alerts chart no longer shows `Other` when number of grouping is
less than 10 per
elastic#150242 (comment)

![image](https://user-images.githubusercontent.com/18648970/217382166-073d2da9-f49d-4bf7-9a08-3795d5948e33.png)
- Changed `EmptyDonutChart`'s background based on dark/light mode
Before -> After

![image](https://user-images.githubusercontent.com/18648970/217382463-1ef44127-1cdf-4a70-85f2-8c78a612c485.png)
- Loading spinner for donut chart was not showing, it is now fixed

![image](https://user-images.githubusercontent.com/18648970/217382665-93e093e3-119a-4be4-a313-072ef118eec7.png)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 2846b8c)
kibanamachine added a commit that referenced this pull request Feb 9, 2023
…ments (#150504) (#150649)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Security Solution][Bug] Alerts type discrepancy and ui improvements
(#150504)](#150504)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"christineweng","email":"18648970+christineweng@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-02-08T22:40:49Z","message":"[Security
Solution][Bug] Alerts type discrepancy and ui improvements
(#150504)\n\nThis PR addresses the following:\r\n\r\n#### Bug
fix\r\nhttps://github.com//issues/150278 described a
discrepancy\r\nbetween total alert count in alert by type chart and
everywhere else on\r\nalerts page. This is due to `event.type` being a
multi-select, if an\r\nalert has 3 event types (i.e. creation, info,
denied), it is counted 3\r\ntimes on alert by type graph. This logic is
now updated to categorize an\r\nalert once\r\n- if `denied` event type
exists, such event count => `Prevention`\r\n- total alert count -
prevention count => `Detection`.\r\n\r\n#### UI improvements\r\n- Top
alerts chart no longer shows `Other` when number of grouping is\r\nless
than 10
per\r\nhttps://github.com//pull/150242#issuecomment-1419628829\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382166-073d2da9-f49d-4bf7-9a08-3795d5948e33.png)\r\n-
Changed `EmptyDonutChart`'s background based on dark/light mode
\r\nBefore ->
After\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382463-1ef44127-1cdf-4a70-85f2-8c78a612c485.png)\r\n-
Loading spinner for donut chart was not showing, it is now
fixed\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382665-93e093e3-119a-4be4-a313-072ef118eec7.png)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2846b8c27cf7da5a9e5c8152177376fdb8d2cffe","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting","Team: SecuritySolution","Team:Threat
Hunting:Investigations","v8.7.0","v8.8.0"],"number":150504,"url":"#150504
Solution][Bug] Alerts type discrepancy and ui improvements
(#150504)\n\nThis PR addresses the following:\r\n\r\n#### Bug
fix\r\nhttps://github.com//issues/150278 described a
discrepancy\r\nbetween total alert count in alert by type chart and
everywhere else on\r\nalerts page. This is due to `event.type` being a
multi-select, if an\r\nalert has 3 event types (i.e. creation, info,
denied), it is counted 3\r\ntimes on alert by type graph. This logic is
now updated to categorize an\r\nalert once\r\n- if `denied` event type
exists, such event count => `Prevention`\r\n- total alert count -
prevention count => `Detection`.\r\n\r\n#### UI improvements\r\n- Top
alerts chart no longer shows `Other` when number of grouping is\r\nless
than 10
per\r\nhttps://github.com//pull/150242#issuecomment-1419628829\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382166-073d2da9-f49d-4bf7-9a08-3795d5948e33.png)\r\n-
Changed `EmptyDonutChart`'s background based on dark/light mode
\r\nBefore ->
After\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382463-1ef44127-1cdf-4a70-85f2-8c78a612c485.png)\r\n-
Loading spinner for donut chart was not showing, it is now
fixed\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382665-93e093e3-119a-4be4-a313-072ef118eec7.png)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2846b8c27cf7da5a9e5c8152177376fdb8d2cffe"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"#150504
Solution][Bug] Alerts type discrepancy and ui improvements
(#150504)\n\nThis PR addresses the following:\r\n\r\n#### Bug
fix\r\nhttps://github.com//issues/150278 described a
discrepancy\r\nbetween total alert count in alert by type chart and
everywhere else on\r\nalerts page. This is due to `event.type` being a
multi-select, if an\r\nalert has 3 event types (i.e. creation, info,
denied), it is counted 3\r\ntimes on alert by type graph. This logic is
now updated to categorize an\r\nalert once\r\n- if `denied` event type
exists, such event count => `Prevention`\r\n- total alert count -
prevention count => `Detection`.\r\n\r\n#### UI improvements\r\n- Top
alerts chart no longer shows `Other` when number of grouping is\r\nless
than 10
per\r\nhttps://github.com//pull/150242#issuecomment-1419628829\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382166-073d2da9-f49d-4bf7-9a08-3795d5948e33.png)\r\n-
Changed `EmptyDonutChart`'s background based on dark/light mode
\r\nBefore ->
After\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382463-1ef44127-1cdf-4a70-85f2-8c78a612c485.png)\r\n-
Loading spinner for donut chart was not showing, it is now
fixed\r\n\r\n![image](https://user-images.githubusercontent.com/18648970/217382665-93e093e3-119a-4be4-a313-072ef118eec7.png)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2846b8c27cf7da5a9e5c8152177376fdb8d2cffe"}}]}]
BACKPORT-->

Co-authored-by: christineweng <18648970+christineweng@users.noreply.github.com>
@christineweng christineweng self-assigned this Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.7 candidate backport:skip This commit does not require backporting release_note:enhancement release_note:feature Makes this part of the condensed release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Investigations Security Solution Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants