diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.test.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.test.tsx index 4ceacc40942e2..373b4d78a84cc 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.test.tsx @@ -43,7 +43,8 @@ describe('when using the EndpointHostIsolationStatus component', () => { expect(getByTestId('test').textContent).toBe('Isolated'); }); - it.each([ + // FIXME: un-skip when we bring back the pending isolation statuses + it.skip.each([ ['Isolating', { pendingIsolate: 2 }], ['Releasing', { pendingUnIsolate: 2 }], ['4 actions pending', { isIsolated: true, pendingUnIsolate: 2, pendingIsolate: 2 }], diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx index 7ae7cae89f19e..425172a5cd460 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx @@ -6,9 +6,9 @@ */ import React, { memo, useMemo } from 'react'; -import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiTextColor, EuiToolTip } from '@elastic/eui'; +import { EuiBadge } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { useTestIdGenerator } from '../../../../management/components/hooks/use_test_id_generator'; +// import { useTestIdGenerator } from '../../../../management/components/hooks/use_test_id_generator'; export interface EndpointHostIsolationStatusProps { isIsolated: boolean; @@ -25,94 +25,114 @@ export interface EndpointHostIsolationStatusProps { * (`null` is returned) */ export const EndpointHostIsolationStatus = memo( - ({ isIsolated, pendingIsolate = 0, pendingUnIsolate = 0, 'data-test-subj': dataTestSubj }) => { - const getTestId = useTestIdGenerator(dataTestSubj); + ({ + isIsolated, + /* pendingIsolate = 0, pendingUnIsolate = 0,*/ 'data-test-subj': dataTestSubj, + }) => { + // const getTestId = useTestIdGenerator(dataTestSubj); return useMemo(() => { // If nothing is pending and host is not currently isolated, then render nothing - if (!isIsolated && !pendingIsolate && !pendingUnIsolate) { + if (!isIsolated) { return null; } + // if (!isIsolated && !pendingIsolate && !pendingUnIsolate) { + // return null; + // } - // If nothing is pending, but host is isolated, then show isolation badge - if (!pendingIsolate && !pendingUnIsolate) { - return ( - - - - ); - } - - // If there are multiple types of pending isolation actions, then show count of actions with tooltip that displays breakdown - if (pendingIsolate && pendingUnIsolate) { - return ( - - -
- -
- - - - - {pendingIsolate} - - - - - - {pendingUnIsolate} - - - } - > - - - -
-
- ); - } - - // Show 'pending [un]isolate' depending on what's pending return ( - - {pendingIsolate ? ( - - ) : ( - - )} - + ); - }, [dataTestSubj, getTestId, isIsolated, pendingIsolate, pendingUnIsolate]); + + // If nothing is pending and host is not currently isolated, then render nothing + // if (!isIsolated && !pendingIsolate && !pendingUnIsolate) { + // return null; + // } + // + // // If nothing is pending, but host is isolated, then show isolation badge + // if (!pendingIsolate && !pendingUnIsolate) { + // return ( + // + // + // + // ); + // } + // + // // If there are multiple types of pending isolation actions, then show count of actions with tooltip that displays breakdown + // if (pendingIsolate && pendingUnIsolate) { + // return ( + // + // + //
+ // + //
+ // + // + // + // + // {pendingIsolate} + // + // + // + // + // + // {pendingUnIsolate} + // + // + // } + // > + // + // + // + //
+ //
+ // ); + // } + // + // // Show 'pending [un]isolate' depending on what's pending + // return ( + // + // + // {pendingIsolate ? ( + // + // ) : ( + // + // )} + // + // + // ); + }, [dataTestSubj, isIsolated /* , getTestId , pendingIsolate, pendingUnIsolate*/]); } ); diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx index 98006524844c4..ac650edca43e4 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx @@ -11,10 +11,10 @@ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, - EuiSpacer, + EuiForm, + EuiFormRow, EuiText, EuiTextArea, - EuiTitle, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { CANCEL, COMMENT, COMMENT_PLACEHOLDER, CONFIRM, UNISOLATE, ISOLATED } from './translations'; @@ -30,50 +30,49 @@ export const EndpointUnisolateForm = memo( ); return ( - <> - -

- {hostName}, - isolated: {ISOLATED}, - unisolate: {UNISOLATE}, - }} - />{' '} - {messageAppend} -

-
+ + + +

+ {hostName}, + isolated: {ISOLATED}, + unisolate: {UNISOLATE}, + }} + />{' '} + {messageAppend} +

+
+
- + + + - -

{COMMENT}

-
- - - - - - - - {CANCEL} - - - - - {CONFIRM} - - - - + + + + + {CANCEL} + + + + + {CONFIRM} + + + + +
); } ); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/context_menu_item_nav_by_rotuer.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/context_menu_item_nav_by_rotuer.tsx index ac1b83bdc493b..f4f9a7542415d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/context_menu_item_nav_by_rotuer.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/context_menu_item_nav_by_rotuer.tsx @@ -34,3 +34,5 @@ export const ContextMenuItemNavByRouter = memo( ); } ); + +ContextMenuItemNavByRouter.displayName = 'EuiContextMenuItemNavByRouter'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx index 0b5ff7cc4da0f..be7fef156815b 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx @@ -57,7 +57,8 @@ describe('When using the EndpointAgentStatus component', () => { expect(renderResult.getByTestId('rowHostStatus').textContent).toEqual(expectedLabel); }); - describe('and host is isolated or pending isolation', () => { + // FIXME: un-skip test once Islation pending statuses are supported + describe.skip('and host is isolated or pending isolation', () => { beforeEach(async () => { // Ensure pending action api sets pending action for the test endpoint metadata const pendingActionsResponseProvider = httpMocks.responseProvider.pendingActions.getMockImplementation(); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx index 94303c43cd4da..5a2ad6cf4c60b 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx @@ -62,5 +62,3 @@ export const TableRowActions = memo(({ endpointMetadata }) ); }); TableRowActions.displayName = 'EndpointTableRowActions'; - -ContextMenuItemNavByRouter.displayName = 'EuiContextMenuItemNavByRouter'; diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx index 6a0e7c381664c..7f447670fd1e1 100644 --- a/x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx @@ -71,7 +71,8 @@ describe('EndpointOverview Component', () => { expect(findData.at(3).text()).toEqual('HealthyIsolated'); }); - test.each([ + // FIXME: un-skip once pending isolation status are supported again + test.skip.each([ ['isolate', 'Isolating'], ['unisolate', 'Releasing'], ])('it shows pending %s status', (action, expectedLabel) => {