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] Add visualization actions #126507

Merged
merged 70 commits into from
Mar 15, 2022
Merged

Conversation

angorayc
Copy link
Contributor

@angorayc angorayc commented Feb 28, 2022

Summary

Add vizualisation action component to bar chart, area chart, and matrix histogram.

Known issue:
In Security Solution we can filter index patterns under selected Data View in the Sourcerer, but when open the chart in Lens, it only takes all the index patterns under selected Data view id, to fix this, I append _index filter when open the chart in Lens as a temporary solution: #126911 (comment)
This inconsistency has also be written down in this issue and assigned to the relevant team: #126911

before:

previous_inspect.mp4

after:
Screenshot 2022-03-14 at 18 29 33

openInLens.mp4
custom_chart_actions.mp4

@angorayc angorayc added Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team Team:Threat Hunting:Explore v8.2.0 labels Feb 28, 2022
@angorayc angorayc changed the title [Security Solution] Viz actions [Security Solution] Add visualization actions Mar 2, 2022
@angorayc angorayc self-assigned this Mar 2, 2022
))}
<CasesContext owner={[APP_ID]} userCanCrud={userCanCrud ?? false}>
{statItemsProps.map((mappedStatItemProps) => (
<StatItemsComponent {...mappedStatItemProps} showInspectButton={false} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Warning: Each child in a list should have a unique "key" prop... is this not showing here? do we need a key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The key prop is included in statItemsProps

Copy link
Contributor

@stephmilovic stephmilovic left a comment

Choose a reason for hiding this comment

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

LGTM! I just had the question about the keys, not blocking. Great work!

@@ -18,6 +18,7 @@
"eventLog",
"features",
"inspector",
"lens",
Copy link
Contributor

@YulNaumenko YulNaumenko Mar 14, 2022

Choose a reason for hiding this comment

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

We have lens as an optionalPlugins also, can we add the dependency for a single place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've removed the optionalPlugins and keep it in requiredPlugins

@@ -30,4 +31,5 @@ export const histogramConfigs: MatrixHistogramConfigs = {
stackByOptions: alertsStackByOptions,
subtitle: undefined,
title: i18n.ALERTS_GRAPH_TITLE,
getLensAttributes: getExternalAlertConfigs,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can we have a more consistent naming approach? Why the getExternalAlertConfigs is assigned to the property which seems to be a lens attributes - are we using a sub configuration? Maybe then we should assign here only the part of the config which is used for lens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sorry for the confusion, getExternalAlertConfigs should be renamed to getExternalAlertLensAttributes as it is for getting Lens Attributes only. I've renamed all the Lens attributes and their folder.

@@ -97,7 +100,7 @@ const HeaderSectionComponent: React.FC<HeaderSectionProps> = ({
)}
</EuiFlexItem>

{id && (
{id && showInspectButton && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we test this with the unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@angorayc
Copy link
Contributor Author

/oblt-deploy

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link

@monina-n monina-n left a comment

Choose a reason for hiding this comment

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

all good from design thanks

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

Changes LGTM!
Please add the dev docs about how to create the lens visualization support to the new security visualization (we will need this later for the new stuff). It could be a follow up PR.

@angorayc angorayc enabled auto-merge (squash) March 15, 2022 17:23
@angorayc
Copy link
Contributor Author

Changes LGTM! Please add the dev docs about how to create the lens visualization support to the new security visualization (we will need this later for the new stuff). It could be a follow up PR.

Yup, thank you, added the readme here:
#126507 (review)

@angorayc
Copy link
Contributor Author

@elasticmachine merge upstream

@angorayc angorayc merged commit 692ca00 into elastic:main Mar 15, 2022
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Test Failures

  • [job] [logs] Security Solution Tests / risk tab "before all" hook for "renders risk tab"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 2902 2931 +29

Async chunks

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

id before after diff
securitySolution 4.7MB 4.7MB +49.8KB

History

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

cc @angorayc

@angorayc angorayc added the backport:skip This commit does not require backporting label Mar 16, 2022
maksimkovalev pushed a commit to maksimkovalev/kibana that referenced this pull request Mar 18, 2022
* add chart configs

* init hosts chart actions

* init network chart actions

* add to new case

* clean up

* clean up

* clean up configs

* rename configs

* rename histogram actions to viz actions component

* fix up

* add vizType

* cypress hosts inspect

* add viz actions cypress tests

* fix type

* stat_items unit test

* fix unit tests for alerts by category

* fix unit tests

* unit tests

* unit tests

* rename vizType from store to inspectedVizType

* move out i18n

* unit test

* add index filter

* clean up configs

* unit tests

* fix typo

* rm unused props

* apply cases flyout and modal

* rm unused definition

* fix typo

* rm vizType in reducer

* onCloseInspect callback

* move viz action component out of header section

* rm hard coded dataViewId in configs

* update icon and wording

* fix unit tests

* useRouteSpy

* showInspectButton

* add aria label

* rm type casting

* unit test

* rm id from filters

* use mockCasesContract

* add unit tests

* styling

* update mock

* rm visualization actions cypress tests

* clean up data-test-subj

* disabled inspect button in matrix histogram by default

* styling

* viz actions only available on hosts / network page

* rm kpi

* unit tests

* unit tests

* unit tests

* unit tests

* kibana dependency

* rename

* add readme

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting 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:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.