Skip to content

Commit

Permalink
[8.13] [EDR Workflows] [Osquery] Fix Osquery flyout z-index issue whe…
Browse files Browse the repository at this point in the history
…n used externally (elastic#177694) (elastic#177776)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[EDR Workflows] [Osquery] Fix Osquery flyout z-index issue when used
externally (elastic#177694)](elastic#177694)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Tomasz
Ciecierski","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-02-25T22:19:13Z","message":"[EDR
Workflows] [Osquery] Fix Osquery flyout z-index issue when used
externally
(elastic#177694)","sha":"3cf9f562b28b01ae848cb3dd9bfa3323df8132d5","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Defend
Workflows","Osquery","v8.13.0","v8.14.0"],"title":"[EDR Workflows]
[Osquery] Fix Osquery flyout z-index issue when used
externally","number":177694,"url":"https://github.com/elastic/kibana/pull/177694","mergeCommit":{"message":"[EDR
Workflows] [Osquery] Fix Osquery flyout z-index issue when used
externally
(elastic#177694)","sha":"3cf9f562b28b01ae848cb3dd9bfa3323df8132d5"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177694","number":177694,"mergeCommit":{"message":"[EDR
Workflows] [Osquery] Fix Osquery flyout z-index issue when used
externally
(elastic#177694)","sha":"3cf9f562b28b01ae848cb3dd9bfa3323df8132d5"}}]}]
BACKPORT-->

Co-authored-by: Tomasz Ciecierski <[email protected]>
  • Loading branch information
kibanamachine and tomsonpl authored Feb 25, 2024
1 parent 7b304b8 commit e1dbf35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
9 changes: 2 additions & 7 deletions x-pack/plugins/osquery/public/live_queries/form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
containsDynamicQuery,
replaceParamsQuery,
} from '../../../common/utils/replace_params_query';
import { PLUGIN_NAME as OSQUERY_PLUGIN_NAME } from '../../../common';
import { QueryPackSelectable } from './query_pack_selectable';
import type { SavedQuerySOFormData } from '../../saved_queries/form/use_saved_query_form';
import { useKibana } from '../../common/lib/kibana';
Expand Down Expand Up @@ -76,7 +75,7 @@ const LiveQueryFormComponent: React.FC<LiveQueryFormProps> = ({
}) => {
const alertAttachmentContext = useContext(AlertAttachmentContext);

const { application, appName } = useKibana().services;
const { application } = useKibana().services;
const permissions = application.capabilities.osquery;
const canRunPacks = useMemo(
() =>
Expand Down Expand Up @@ -331,11 +330,7 @@ const LiveQueryFormComponent: React.FC<LiveQueryFormProps> = ({
</FormProvider>

{showSavedQueryFlyout ? (
<SavedQueryFlyout
isExternal={appName !== OSQUERY_PLUGIN_NAME}
onClose={handleCloseSaveQueryFlyout}
defaultValue={serializedData}
/>
<SavedQueryFlyout onClose={handleCloseSaveQueryFlyout} defaultValue={serializedData} />
) : null}
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,10 @@ interface QueryDetailsFlyoutProps {
};
onClose: () => void;
}
const additionalZIndexStyle = { style: 'z-index: 6000' };

const QueryDetailsFlyoutComponent: React.FC<QueryDetailsFlyoutProps> = ({ action, onClose }) => (
<EuiPortal>
<EuiFlyout
size="m"
ownFocus
onClose={onClose}
aria-labelledby="flyoutTitle"
maskProps={additionalZIndexStyle} // For an edge case to display above the alerts flyout
>
<EuiFlyout size="m" ownFocus onClose={onClose} aria-labelledby="flyoutTitle">
<EuiFlyoutHeader hasBorder>
<EuiTitle size="s">
<h2 id="flyoutTitle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,9 @@ import { useCreateSavedQuery } from './use_create_saved_query';
interface AddQueryFlyoutProps {
defaultValue: SavedQuerySOFormData;
onClose: () => void;
isExternal?: boolean;
}

const additionalZIndexStyle = { style: 'z-index: 6000' };

const SavedQueryFlyoutComponent: React.FC<AddQueryFlyoutProps> = ({
defaultValue,
onClose,
isExternal,
}) => {
const SavedQueryFlyoutComponent: React.FC<AddQueryFlyoutProps> = ({ defaultValue, onClose }) => {
const createSavedQueryMutation = useCreateSavedQuery({ withRedirect: false });

const hooksForm = useSavedQueryForm({
Expand Down Expand Up @@ -67,7 +60,6 @@ const SavedQueryFlyoutComponent: React.FC<AddQueryFlyoutProps> = ({
ownFocus
onClose={onClose}
aria-labelledby="flyoutTitle"
maskProps={isExternal ? additionalZIndexStyle : undefined} // For an edge case to display above the alerts flyout
>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="s">
Expand Down

0 comments on commit e1dbf35

Please sign in to comment.