x-pack/solutions/security/plugins/security_solution/public/flyout/README.md
For more info on the expandable flyout, see the @kbn/expandable-flyout package.
The Security Solution plugin aims at having a single instance of the expandable flyout. That instance can display as many panels as we need. This folder hosts all the panels that are can be displayed in the Security Solution flyout. Panels can be differentiated as to be displayed in different sections of the expandable flyout (right, left or preview), but ultimately, nothing prevents us from displaying a panel in any section we want.
Remember to add any new panels to the
index.tsxat the root of the flyout folder. These are passed to the@kbn/expandable-flyoutpackage asregisteredPanels. Failing to do so will result in the panel not being rendered.
The structure of the flyout folder is intended to work as follows:
document_details flyout type, where the right, left and preview folders correspond to the panels displayed in the right, left and preview flyout sections respectively. The shared folder contains any shared components/hooks/services/helpers that are used within the other folders.document_details
└─── right
└─── left
└─── preview
└─── shared
shared folder containing all the components/hooks/services/helpers that are used across multiple flyout types. Putting code in this folder should be very deliberate, and should follow some guidelines:
The flyout folder structure should therefore look like this:
flyout
│ index.tsx
│ jest.config.js
│ README.md
│
└─── document_details
│ └─── right
│ └─── left
│ └─── preview
│
└─── new_type
│ └─── right
│ └─── preview
│
└─── other_new_type
│ └─── right
│ └─── left
│
└─── ...
│
└─── shared
└─── components
Here's a non-exhaustive list of the reusable component in the top-level shared folder. We recommend using these components to create a unified flyout experience.
EuiFlyoutHeader, setting the recommended 16px padding using a EuiPanel.EuiTabs, setting bottom margin to align with the flyout header dividerEuiFlyoutHeader, setting the recommended 16px padding using a EuiPanel.EuiFlyoutFooter, setting the recommended 16px padding using a EuiPanel.EuiEmptyPrompt for error messages, correctly positioned and sized when used in at the panel level (not for individual components)EuiLoadingSpinner component correctly positioned and sized when used in at the panel level (not for individual components)