Skip to content

Commit

Permalink
[Security Solution][Alert details] - fix timeline osquery flyout show…
Browse files Browse the repository at this point in the history
…m behind (#184951)
  • Loading branch information
PhilippeOberti authored Jun 6, 2024
1 parent 667a9d3 commit 9a4ceaf
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
* 2.0.
*/

import React, { useCallback } from 'react';
import React, { useCallback, useMemo } from 'react';
import styled from 'styled-components';
import {
EuiFlyout,
EuiFlyoutFooter,
EuiFlyoutBody,
EuiFlyoutHeader,
EuiTitle,
useEuiTheme,
useGeneratedHtmlId,
} from '@elastic/eui';
import { useQueryClient } from '@tanstack/react-query';
Expand Down Expand Up @@ -46,6 +47,14 @@ const OsqueryFlyoutComponent: React.FC<OsqueryFlyoutProps> = ({
onClose,
ecsData,
}) => {
const { euiTheme } = useEuiTheme();

// we need this flyout to be above the timeline flyout (which has a z-index of 1002)
const maskProps = useMemo(
() => ({ style: `z-index: ${(euiTheme.levels.flyout as number) + 3}` }),
[euiTheme.levels.flyout]
);

const {
services: { osquery },
} = useKibana();
Expand All @@ -63,7 +72,13 @@ const OsqueryFlyoutComponent: React.FC<OsqueryFlyoutProps> = ({

if (osquery?.OsqueryAction) {
return (
<EuiFlyout size="m" onClose={onClose} aria-labelledby={osqueryFlyoutTitleId}>
<EuiFlyout
size="m"
onClose={onClose}
aria-labelledby={osqueryFlyoutTitleId}
// EUI TODO: This z-index override of EuiOverlayMask is a workaround, and ideally should be resolved with a cleaner UI/UX flow long-term
maskProps={maskProps}
>
<EuiFlyoutHeader hasBorder data-test-subj="flyout-header-osquery">
<EuiTitle>
<h2 id={osqueryFlyoutTitleId}>{ACTION_OSQUERY}</h2>
Expand Down

0 comments on commit 9a4ceaf

Please sign in to comment.