-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SecuritySolution] Render histograms with Lens (#147261)
## Summary Relevant issue: #136409 These are all behind feature flag `chartEmbeddablesEnabled` --- ### Changes: 1. Legends are all moved to the left side of the chart to avoid overlapping with chart actions. 2. The second `group by` of Alerts Trend Chart is removed (as it is always disabled). --- ### Events: <img width="2545" alt="Screenshot 2023-01-25 at 15 33 27" src="https://user-images.githubusercontent.com/6295984/214605761-2e08d848-feb3-42e3-9850-08cd7f8b9c99.png"> --- ### Top N <img width="2552" alt="Screenshot 2023-01-25 at 15 34 21" src="https://user-images.githubusercontent.com/6295984/214605889-91f74c33-e8c4-43ac-b137-6098f4764a6d.png"> --- ### No indices: <img width="1671" alt="Screenshot 2022-12-21 at 17 03 05" src="https://user-images.githubusercontent.com/6295984/208963467-ccbb6bf4-11b3-4bc8-b568-208dd0791828.png"> --- ### Alerts - Trend <img width="2548" alt="Screenshot 2023-01-25 at 15 34 52" src="https://user-images.githubusercontent.com/6295984/214605993-ea1a2fe5-6f44-4c70-9152-79f76ed9e48f.png"> --- ### ~Alerts - Treemap~ (Not included in this PR - #149592) **Big Difference after converting to Lens. Likely to have a redesign:** Known issues: 1. Alerts tree map: Is not rendered exactly the same due to the limits of dimension of Lens. 3. No value display in each legend item for alerts tree map 4. Background color cannot be decided by risk score Before: <img width="1661" alt="Screenshot 2023-01-10 at 12 00 51" src="https://user-images.githubusercontent.com/6295984/211546444-f98b0f4a-0666-493c-b57e-934b3d154211.png"> After: <img width="2550" alt="Screenshot 2023-01-25 at 15 35 16" src="https://user-images.githubusercontent.com/6295984/214606117-7a1e78a4-8947-4d95-9994-2acb106ca3af.png"> --- ### ~Alerts - Charts~ (Not included in this PR - #149592) **Lens does not support the [design](elastic/security-team#5599). Likely to have a redesign:** <img width="2536" alt="Screenshot 2023-01-25 at 15 35 55" src="https://user-images.githubusercontent.com/6295984/214606298-bcc97920-bb52-4367-901f-102a778799b6.png"> --- ### Alerts - Table <img width="1666" alt="Screenshot 2022-12-21 at 17 12 25" src="https://user-images.githubusercontent.com/6295984/208964514-b39e40ae-ecb4-4e06-8cc5-32d63e28823a.png"> Known issues: 1. #149828 2. Unable to restore a column after hiding it. 3. #150048 4. #150158 --- ### Alerts - Preview Known issue: There's no legend in alerts preview as its legend action, filter in, filter out are not useful on rule creation page. - #149220 <img width="2543" alt="Screenshot 2023-01-26 at 13 32 00" src="https://user-images.githubusercontent.com/6295984/214848163-437ca866-46ee-47ee-a550-aa3b9c97eef6.png"> ### Checklist - [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 --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
3c14f00
commit 9cfec58
Showing
55 changed files
with
2,782 additions
and
270 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/security_solution/public/common/components/matrix_histogram/chart_content.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import type { BarChartComponentProps } from '../charts/barchart'; | ||
import { BarChart } from '../charts/barchart'; | ||
import { MatrixLoader } from './matrix_loader'; | ||
|
||
const MatrixHistogramChartContentComponent = ({ | ||
isInitialLoading, | ||
barChart, | ||
configs, | ||
stackByField, | ||
scopeId, | ||
}: BarChartComponentProps & { isInitialLoading: boolean }) => { | ||
return isInitialLoading ? ( | ||
<MatrixLoader /> | ||
) : ( | ||
<BarChart barChart={barChart} configs={configs} stackByField={stackByField} scopeId={scopeId} /> | ||
); | ||
}; | ||
|
||
export const MatrixHistogramChartContent = React.memo(MatrixHistogramChartContentComponent); | ||
|
||
MatrixHistogramChartContentComponent.displayName = 'MatrixHistogramChartContentComponent'; |
This file contains 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
This file contains 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
18 changes: 18 additions & 0 deletions
18
...gins/security_solution/public/common/components/page/__mocks__/use_refetch_by_session.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export const useRefetchByRestartingSession = jest.fn().mockReturnValue({ | ||
session: { | ||
current: { | ||
start: jest | ||
.fn() | ||
.mockReturnValueOnce('mockSearchSessionId') | ||
.mockReturnValue('mockSearchSessionIdDefault'), | ||
}, | ||
}, | ||
refetchByRestartingSession: jest.fn(), | ||
}); |
Oops, something went wrong.