forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Expandable flyout - add rule preview skeleton (el…
…astic#161999) ## Summary This PR adds a rule preview panel to the expandable flyout: - Preview panel skeleton is added, now we can open a preview on top of right section of flyout - Go to rule details button is replaced by a button that will open a rule preview panel - The rule preview contains placeholder sections (About, Definition, Schedule) and footer with a link to rule details page ![image](https://github.com/elastic/kibana/assets/18648970/5510982a-91e5-4747-ae23-a8b5b87e0041) **How to test** - add `xpack.securitySolution.enableExperimental: ['securityFlyoutEnabled']` to the `kibana.dev.json` file - go to the Alerts page, and click on the expand detail button on any row of the table - click on `Overview`, `About`, then `Rule summary` ### Checklist - [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 --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
9131e78
commit 70eb71e
Showing
31 changed files
with
886 additions
and
87 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
90 changes: 90 additions & 0 deletions
90
...2e/investigations/alerts/expandable_flyout/alert_details_preview_panel_rule_preview.cy.ts
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,90 @@ | ||
/* | ||
* 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 { expandFirstAlertExpandableFlyout } from '../../../../tasks/expandable_flyout/common'; | ||
import { | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SECTION, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_HEADER, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_BODY, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_HEADER, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_CONTENT, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_HEADER, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_CONTENT, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_HEADER, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_CONTENT, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_FOOTER, | ||
} from '../../../../screens/expandable_flyout/alert_details_preview_panel_rule_preview'; | ||
import { | ||
toggleRulePreviewAboutSection, | ||
toggleRulePreviewDefinitionSection, | ||
toggleRulePreviewScheduleSection, | ||
} from '../../../../tasks/expandable_flyout/alert_details_preview_panel_rule_preview'; | ||
import { clickRuleSummaryButton } from '../../../../tasks/expandable_flyout/alert_details_right_panel_overview_tab'; | ||
import { cleanKibana } from '../../../../tasks/common'; | ||
import { login, visit } from '../../../../tasks/login'; | ||
import { createRule } from '../../../../tasks/api_calls/rules'; | ||
import { getNewRule } from '../../../../objects/rule'; | ||
import { ALERTS_URL } from '../../../../urls/navigation'; | ||
import { waitForAlertsToPopulate } from '../../../../tasks/create_new_rule'; | ||
|
||
describe( | ||
'Alert details expandable flyout rule preview panel', | ||
{ env: { ftrConfig: { enableExperimental: ['securityFlyoutEnabled'] } } }, | ||
() => { | ||
const rule = getNewRule(); | ||
|
||
beforeEach(() => { | ||
cleanKibana(); | ||
login(); | ||
createRule(rule); | ||
visit(ALERTS_URL); | ||
waitForAlertsToPopulate(); | ||
expandFirstAlertExpandableFlyout(); | ||
clickRuleSummaryButton(); | ||
}); | ||
|
||
describe('rule preview', () => { | ||
it('should display rule preview and its sub sections', () => { | ||
cy.log('rule preview panel'); | ||
|
||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SECTION).scrollIntoView(); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SECTION).should('be.visible'); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_HEADER).should('be.visible'); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_BODY).should('be.visible'); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_FOOTER).should('be.visible'); | ||
|
||
cy.log('about'); | ||
|
||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_HEADER) | ||
.should('be.visible') | ||
.and('contain.text', 'About'); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_CONTENT).should('be.visible'); | ||
toggleRulePreviewAboutSection(); | ||
|
||
cy.log('definition'); | ||
|
||
toggleRulePreviewDefinitionSection(); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_HEADER) | ||
.should('be.visible') | ||
.and('contain.text', 'Definition'); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_CONTENT).should( | ||
'be.visible' | ||
); | ||
toggleRulePreviewDefinitionSection(); | ||
|
||
cy.log('schedule'); | ||
|
||
toggleRulePreviewScheduleSection(); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_HEADER) | ||
.should('be.visible') | ||
.and('contain.text', 'Schedule'); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_CONTENT).should('be.visible'); | ||
toggleRulePreviewScheduleSection(); | ||
}); | ||
}); | ||
} | ||
); |
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
47 changes: 47 additions & 0 deletions
47
...ty_solution/cypress/screens/expandable_flyout/alert_details_preview_panel_rule_preview.ts
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,47 @@ | ||
/* | ||
* 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 { | ||
RULE_PREVIEW_BODY_TEST_ID, | ||
RULE_PREVIEW_ABOUT_HEADER_TEST_ID, | ||
RULE_PREVIEW_ABOUT_CONTENT_TEST_ID, | ||
RULE_PREVIEW_DEFINITION_HEADER_TEST_ID, | ||
RULE_PREVIEW_DEFINITION_CONTENT_TEST_ID, | ||
RULE_PREVIEW_SCHEDULE_HEADER_TEST_ID, | ||
RULE_PREVIEW_SCHEDULE_CONTENT_TEST_ID, | ||
RULE_PREVIEW_FOOTER_TEST_ID, | ||
} from '../../../public/flyout/preview/components/test_ids'; | ||
import { getDataTestSubjectSelector } from '../../helpers/common'; | ||
|
||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SECTION = | ||
getDataTestSubjectSelector('previewSection'); | ||
|
||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_HEADER = | ||
getDataTestSubjectSelector('previewSectionHeader'); | ||
|
||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_BODY = | ||
getDataTestSubjectSelector(RULE_PREVIEW_BODY_TEST_ID); | ||
|
||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_HEADER = getDataTestSubjectSelector( | ||
RULE_PREVIEW_ABOUT_HEADER_TEST_ID | ||
); | ||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_CONTENT = | ||
getDataTestSubjectSelector(RULE_PREVIEW_ABOUT_CONTENT_TEST_ID); | ||
|
||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_HEADER = | ||
getDataTestSubjectSelector(RULE_PREVIEW_DEFINITION_HEADER_TEST_ID); | ||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_CONTENT = | ||
getDataTestSubjectSelector(RULE_PREVIEW_DEFINITION_CONTENT_TEST_ID); | ||
|
||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_HEADER = | ||
getDataTestSubjectSelector(RULE_PREVIEW_SCHEDULE_HEADER_TEST_ID); | ||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_CONTENT = | ||
getDataTestSubjectSelector(RULE_PREVIEW_SCHEDULE_CONTENT_TEST_ID); | ||
|
||
export const DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_FOOTER = getDataTestSubjectSelector( | ||
RULE_PREVIEW_FOOTER_TEST_ID | ||
); |
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
44 changes: 44 additions & 0 deletions
44
...rity_solution/cypress/tasks/expandable_flyout/alert_details_preview_panel_rule_preview.ts
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,44 @@ | ||
/* | ||
* 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 { | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_HEADER, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_HEADER, | ||
DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_HEADER, | ||
} from '../../screens/expandable_flyout/alert_details_preview_panel_rule_preview'; | ||
|
||
/* About section */ | ||
|
||
/** | ||
* Toggle the About Section in Rule Preview panel | ||
*/ | ||
export const toggleRulePreviewAboutSection = () => { | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_HEADER).scrollIntoView(); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_ABOUT_SECTION_HEADER).should('be.visible').click(); | ||
}; | ||
|
||
/* Definition section */ | ||
|
||
/** | ||
* Toggle the Definition Section in Rule Preview panel | ||
*/ | ||
export const toggleRulePreviewDefinitionSection = () => { | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_HEADER).scrollIntoView(); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_DEFINITION_SECTION_HEADER) | ||
.should('be.visible') | ||
.click(); | ||
}; | ||
|
||
/* Schedule section */ | ||
|
||
/** | ||
* Toggle the Schedule Section in Rule Preview panel | ||
*/ | ||
export const toggleRulePreviewScheduleSection = () => { | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_HEADER).scrollIntoView(); | ||
cy.get(DOCUMENT_DETAILS_FLYOUT_RULE_PREVIEW_SCHEDULE_SECTION_HEADER).should('be.visible').click(); | ||
}; |
Oops, something went wrong.