Skip to content

[Security Solution] expanded flyout - right section skeleton#152047

Merged
PhilippeOberti merged 2 commits intomainfrom
expanded-flyout-6065
Mar 7, 2023
Merged

[Security Solution] expanded flyout - right section skeleton#152047
PhilippeOberti merged 2 commits intomainfrom
expanded-flyout-6065

Conversation

@PhilippeOberti
Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti commented Feb 23, 2023

Summary

This PR leverages the expandable flyout work done in a previous PR and adds the alert details right section skeleton:

  • static header
  • 3 tabs with placeholder components: Overview, Table and Json

How to test

  • add xpack.securitySolution.enableExperimental: ['securityFlyoutEnabled'] to the kibana.json file
  • go to the Alerts page, and click on the expand detail button on any row of the table

Notes:

  • the expandable flyout work needs to be merged first.
  • integration/e2e tests have been written but are now skipped because the feature is protected behind a feature flag, disabled by default. To check them, add 'securityFlyoutEnabled' here

Screenshot 2023-02-23 at 4 26 30 PM

https://github.com/elastic/security-team/issues/6065

Checklist

@PhilippeOberti PhilippeOberti requested review from a team as code owners February 23, 2023 22:32
@PhilippeOberti PhilippeOberti added Team:Threat Hunting Security Solution Threat Hunting Team release_note:feature Makes this part of the condensed release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team labels Feb 23, 2023
@elasticmachine
Copy link
Copy Markdown
Contributor

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

/**
* Open the Overview tab in the alert details expandable flyout right section
*/
export const openOverviewTab = () => cy.get(ALERT_DETAILS_FLYOUT_OVERVIEW_TAB).click();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we add any should('be.visible') to account for potential delays in the flyout opening in the CI environment? May not be necessary, but a flakiness issue I've seen with some of the popovers and flyouts

if (isSecurityFlyoutEnabled) {
openFlyout({});
openFlyout({
right: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Woohoo, a real panel! 😄

/**
* Alert details flyout right section header
*/
export const HeaderTitle: FC = memo(() => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One thing to note is that this flyout should probably be thought of as configurable as possible for both alerts and just simple events. Whether that means having separate components based on one vs the other, or a generalized unified component (i.e. a unified header) that works for both.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you're totally correct, I actually have a separate ticket for the header itself, as I feel there be a need of some more discussion with Product and UI to handle different scenarios

return (
<EuiFlyoutBody
css={css`
height: calc(100vh - 262px);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I did the same thing with the explicit 262, but I think we should see if we can get the topbar heights from some shared constant if possible in case that changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you're right again, I stole this from you without really thinking about why we're using it. I feel like this shouldn't be part of the PR, and I'll add it back in a cleaner way once I implement the content of the tabs!

const contextValue = useContext(RightPanelContext);

if (!contextValue) {
throw new Error('RightPanelContext can only be used within RightPanelContext provider');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍🏾 for the developer experience 😄

* 2.0.
*/

export const OVERVIEW_TAB_CONTENT_TEST_ID = 'securitySolutionAlertDetailsFlyoutOverviewTabContent';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like this pattern and ultra separation of concerns. I know people tend to keep items like this in constants.ts files. I'm not sure which is better, but just wanted to point it out

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah I've seen many translations.ts files but not as many test_ids.ts files. What I like about having them separated, is when we declare variable in Cypress (within the screens folder) we can import those from the test_ids files. It avoids making typo mistakes

- header with simple static title
- 3 empty tabs (overview, table and json)
@PhilippeOberti
Copy link
Copy Markdown
Contributor Author

PhilippeOberti commented Feb 28, 2023

@michaelolo24 I've decided to change slightly the folder structure under the flyout folder, and added a README to explain a bit the current structure and how we would do in the future if other panels were to be created. I've assumed that for now, we'd have a single expanded flyout within the Security Solution plugin, that would handle all types of documents (signals, events, indicators, assets and findings)
Let me know if you think that isn't appropriate and I can easily revert.

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #2 / Detection rules, bulk edit of rule actions Restricted action privileges User with no privileges can't add rule actions

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3723 3737 +14

Async chunks

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

id before after diff
securitySolution 15.7MB 15.7MB +14.4KB
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 428 430 +2

Total ESLint disabled count

id before after diff
securitySolution 506 508 +2

History

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

*/

import { EuiFlyoutBody } from '@elastic/eui';
import type { VFC } from 'react';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We'll have to update this whenever we move to React 18 since it's deprecated in the most recent version

Copy link
Copy Markdown
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

Nice work! LGTM!

@PhilippeOberti PhilippeOberti merged commit ffc8080 into main Mar 7, 2023
@PhilippeOberti PhilippeOberti deleted the expanded-flyout-6065 branch March 7, 2023 14:45
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Mar 7, 2023
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
…#152047)

- header with simple static title
- 3 empty tabs (overview, table and json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:feature Makes this part of the condensed release notes Team:Threat Hunting:Investigations Security Solution Threat Hunting Investigations Team Team:Threat Hunting Security Solution Threat Hunting Team v8.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants