mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[EDR Workflows] Add technical preview badge to S1 flyout (#176581)
This commit is contained in:
parent
b3354bcd11
commit
81529e2870
2 changed files with 37 additions and 15 deletions
|
@ -13,6 +13,9 @@ import { PanelHeader } from './header';
|
|||
import { FLYOUT_HEADER_TITLE_TEST_ID } from './test_ids';
|
||||
|
||||
jest.mock('./context');
|
||||
jest.mock('../../../common/hooks/use_experimental_features', () => ({
|
||||
useIsExperimentalFeatureEnabled: jest.fn().mockReturnValue(true),
|
||||
}));
|
||||
|
||||
const renderPanelHeader = () =>
|
||||
render(
|
||||
|
|
|
@ -5,32 +5,51 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { EuiTitle } from '@elastic/eui';
|
||||
import type { FC } from 'react';
|
||||
import React from 'react';
|
||||
import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features';
|
||||
import {
|
||||
TECHNICAL_PREVIEW,
|
||||
TECHNICAL_PREVIEW_DESCRIPTION,
|
||||
} from '../../../timelines/components/side_panel/event_details/translations';
|
||||
import { useIsolateHostPanelContext } from './context';
|
||||
import { FLYOUT_HEADER_TITLE_TEST_ID } from './test_ids';
|
||||
import { FlyoutHeader } from '../../shared/components/flyout_header';
|
||||
import { isAlertFromSentinelOneEvent } from '../../../common/utils/sentinelone_alert_check';
|
||||
|
||||
/**
|
||||
* Document details expandable right section header for the isolate host panel
|
||||
*/
|
||||
export const PanelHeader: FC = () => {
|
||||
const { isolateAction } = useIsolateHostPanelContext();
|
||||
|
||||
const title =
|
||||
isolateAction === 'isolateHost' ? (
|
||||
<FormattedMessage
|
||||
id="xpack.securitySolution.flyout.isolateHost.isolateTitle"
|
||||
defaultMessage="Isolate host"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.securitySolution.flyout.isolateHost.releaseTitle"
|
||||
defaultMessage="Release host"
|
||||
/>
|
||||
);
|
||||
const { isolateAction, dataFormattedForFieldBrowser: data } = useIsolateHostPanelContext();
|
||||
const isSentinelOneAlert = isAlertFromSentinelOneEvent({ data });
|
||||
const sentinelOneManualHostActionsEnabled = useIsExperimentalFeatureEnabled(
|
||||
'sentinelOneManualHostActionsEnabled'
|
||||
);
|
||||
const title = (
|
||||
<EuiFlexGroup responsive gutterSize="s">
|
||||
<EuiFlexItem grow={false}>
|
||||
{isolateAction === 'isolateHost' ? (
|
||||
<FormattedMessage
|
||||
id="xpack.securitySolution.flyout.isolateHost.isolateTitle"
|
||||
defaultMessage="Isolate host"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.securitySolution.flyout.isolateHost.releaseTitle"
|
||||
defaultMessage="Release host"
|
||||
/>
|
||||
)}
|
||||
</EuiFlexItem>
|
||||
{sentinelOneManualHostActionsEnabled && isSentinelOneAlert && (
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiBetaBadge label={TECHNICAL_PREVIEW} tooltipContent={TECHNICAL_PREVIEW_DESCRIPTION} />
|
||||
</EuiFlexItem>
|
||||
)}
|
||||
</EuiFlexGroup>
|
||||
);
|
||||
|
||||
return (
|
||||
<FlyoutHeader>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue