From 68b8ac3fefa99d5444bdbdd9b20d4935ef8fc7d9 Mon Sep 17 00:00:00 2001 From: Philippe Oberti Date: Tue, 18 Jul 2023 09:23:13 +0200 Subject: [PATCH 01/14] [Security Solution] expandable flyout - add status to flyout header (#161942) --- .../alert_details_right_panel.cy.ts | 3 + .../alert_details_right_panel.ts | 4 + .../__snapshots__/index.test.tsx.snap | 1 + .../right/components/header_title.test.tsx | 17 +++-- .../flyout/right/components/header_title.tsx | 16 +++- .../right/components/status.stories.tsx | 59 +++++++++++++++ .../flyout/right/components/status.test.tsx | 75 +++++++++++++++++++ .../public/flyout/right/components/status.tsx | 65 ++++++++++++++++ .../flyout/right/components/test_ids.ts | 1 + .../flyout/right/components/translations.ts | 7 ++ .../public/flyout/right/context.tsx | 2 + .../timeline/body/renderers/rule_status.tsx | 1 + 12 files changed, 241 insertions(+), 10 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/flyout/right/components/status.stories.tsx create mode 100644 x-pack/plugins/security_solution/public/flyout/right/components/status.test.tsx create mode 100644 x-pack/plugins/security_solution/public/flyout/right/components/status.tsx diff --git a/x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts b/x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts index fb21d9d5a445d..44a2326aebc8e 100644 --- a/x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts +++ b/x-pack/plugins/security_solution/cypress/e2e/investigations/alerts/expandable_flyout/alert_details_right_panel.cy.ts @@ -43,6 +43,7 @@ import { DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE_VALUE, DOCUMENT_DETAILS_FLYOUT_HEADER_SEVERITY, DOCUMENT_DETAILS_FLYOUT_HEADER_SEVERITY_VALUE, + DOCUMENT_DETAILS_FLYOUT_HEADER_STATUS, DOCUMENT_DETAILS_FLYOUT_HEADER_TITLE, DOCUMENT_DETAILS_FLYOUT_JSON_TAB, DOCUMENT_DETAILS_FLYOUT_OVERVIEW_TAB, @@ -85,6 +86,8 @@ describe( cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_CHAT_BUTTON).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_STATUS).should('be.visible'); + cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE).should('be.visible'); cy.get(DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE_VALUE) .should('be.visible') diff --git a/x-pack/plugins/security_solution/cypress/screens/expandable_flyout/alert_details_right_panel.ts b/x-pack/plugins/security_solution/cypress/screens/expandable_flyout/alert_details_right_panel.ts index 50de0eb348264..60ebbe7fdd071 100644 --- a/x-pack/plugins/security_solution/cypress/screens/expandable_flyout/alert_details_right_panel.ts +++ b/x-pack/plugins/security_solution/cypress/screens/expandable_flyout/alert_details_right_panel.ts @@ -20,6 +20,7 @@ import { FLYOUT_HEADER_RISK_SCORE_VALUE_TEST_ID, FLYOUT_HEADER_SEVERITY_TITLE_TEST_ID, FLYOUT_HEADER_SEVERITY_VALUE_TEST_ID, + FLYOUT_HEADER_STATUS_BUTTON_TEST_ID, FLYOUT_HEADER_TITLE_TEST_ID, } from '../../../public/flyout/right/components/test_ids'; @@ -42,6 +43,9 @@ export const DOCUMENT_DETAILS_FLYOUT_OVERVIEW_TAB = getDataTestSubjectSelector(OVERVIEW_TAB_TEST_ID); export const DOCUMENT_DETAILS_FLYOUT_TABLE_TAB = getDataTestSubjectSelector(TABLE_TAB_TEST_ID); export const DOCUMENT_DETAILS_FLYOUT_JSON_TAB = getDataTestSubjectSelector(JSON_TAB_TEST_ID); +export const DOCUMENT_DETAILS_FLYOUT_HEADER_STATUS = getDataTestSubjectSelector( + FLYOUT_HEADER_STATUS_BUTTON_TEST_ID +); export const DOCUMENT_DETAILS_FLYOUT_HEADER_RISK_SCORE = getDataTestSubjectSelector( FLYOUT_HEADER_RISK_SCORE_TITLE_TEST_ID ); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap index 6ee4557d2ee22..c676809c3c2a5 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap @@ -91,6 +91,7 @@ exports[`Event Details Overview Cards renders rows and spacers correctly 1`] = `