From 9976a3841fd9266e4b1aa458b2284f243f969132 Mon Sep 17 00:00:00 2001 From: Candace Park Date: Tue, 7 Jul 2020 16:02:29 -0400 Subject: [PATCH] mgmt to administration, more hosts changes --- .../security_solution/common/constants.ts | 2 +- .../public/app/home/home_navigations.tsx | 2 +- .../public/app/home/translations.ts | 4 +-- .../components/management_empty_state.tsx | 28 +++++++++---------- .../management/pages/endpoint_hosts/index.tsx | 6 ++-- .../view/details/host_details.tsx | 4 +-- .../pages/endpoint_hosts/view/index.test.tsx | 10 +++---- .../pages/endpoint_hosts/view/index.tsx | 6 ++-- .../public/management/pages/index.tsx | 4 +-- .../pages/policy/view/policy_list.tsx | 2 +- .../security_solution/public/plugin.tsx | 18 ++++++++---- .../apps/endpoint/endpoint_list.ts | 10 +++---- .../test/security_solution_endpoint/config.ts | 2 +- .../page_objects/endpoint_page.ts | 6 ++-- 14 files changed, 56 insertions(+), 48 deletions(-) diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts index a34a76361f799..bf9cf7486810d 100644 --- a/x-pack/plugins/security_solution/common/constants.ts +++ b/x-pack/plugins/security_solution/common/constants.ts @@ -51,7 +51,7 @@ export const APP_HOSTS_PATH = `${APP_PATH}/hosts`; export const APP_NETWORK_PATH = `${APP_PATH}/network`; export const APP_TIMELINES_PATH = `${APP_PATH}/timelines`; export const APP_CASES_PATH = `${APP_PATH}/cases`; -export const APP_MANAGEMENT_PATH = `${APP_PATH}/management`; +export const APP_MANAGEMENT_PATH = `${APP_PATH}/administration`; /** The comma-delimited list of Elasticsearch indices from which the SIEM app collects events */ export const DEFAULT_INDEX_PATTERN = [ diff --git a/x-pack/plugins/security_solution/public/app/home/home_navigations.tsx b/x-pack/plugins/security_solution/public/app/home/home_navigations.tsx index 88e9d4179a971..e133435a61899 100644 --- a/x-pack/plugins/security_solution/public/app/home/home_navigations.tsx +++ b/x-pack/plugins/security_solution/public/app/home/home_navigations.tsx @@ -63,7 +63,7 @@ export const navTabs: SiemNavTab = { }, [SecurityPageName.management]: { id: SecurityPageName.management, - name: i18n.MANAGEMENT, + name: i18n.ADMINISTRATION, href: APP_MANAGEMENT_PATH, disabled: false, urlKey: SecurityPageName.management, diff --git a/x-pack/plugins/security_solution/public/app/home/translations.ts b/x-pack/plugins/security_solution/public/app/home/translations.ts index f5a08e6395f1f..476ed87338b78 100644 --- a/x-pack/plugins/security_solution/public/app/home/translations.ts +++ b/x-pack/plugins/security_solution/public/app/home/translations.ts @@ -37,6 +37,6 @@ export const CASE = i18n.translate('xpack.securitySolution.navigation.case', { defaultMessage: 'Cases', }); -export const MANAGEMENT = i18n.translate('xpack.securitySolution.navigation.management', { - defaultMessage: 'Management', +export const ADMINISTRATION = i18n.translate('xpack.securitySolution.navigation.administration', { + defaultMessage: 'Administration', }); diff --git a/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx b/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx index 5dd47d4e88028..2eb4ef3d10bf1 100644 --- a/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx +++ b/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx @@ -103,7 +103,7 @@ const PolicyEmptyState = React.memo<{ ); }); -const EndpointsEmptyState = React.memo<{ +const HostsEmptyState = React.memo<{ loading: boolean; onActionClick: (event: MouseEvent) => void; actionDisabled: boolean; @@ -113,14 +113,14 @@ const EndpointsEmptyState = React.memo<{ const policySteps = useMemo( () => [ { - title: i18n.translate('xpack.securitySolution.endpoint.endpointList.stepOneTitle', { + title: i18n.translate('xpack.securitySolution.endpoint.hostList.stepOneTitle', { defaultMessage: 'Select a policy you created from the list below.', }), children: ( <> @@ -138,7 +138,7 @@ const EndpointsEmptyState = React.memo<{ return loading ? ( @@ -146,7 +146,7 @@ const EndpointsEmptyState = React.memo<{ list ) : ( ); @@ -156,14 +156,14 @@ const EndpointsEmptyState = React.memo<{ ), }, { - title: i18n.translate('xpack.securitySolution.endpoint.endpointList.stepTwoTitle', { + title: i18n.translate('xpack.securitySolution.endpoint.hostList.stepTwoTitle', { defaultMessage: 'Head over to Ingest to deploy your Agent with Endpoint Security enabled.', }), children: ( @@ -178,18 +178,18 @@ const EndpointsEmptyState = React.memo<{ loading={loading} onActionClick={onActionClick} actionDisabled={actionDisabled} - dataTestSubj="emptyEndpointsTable" + dataTestSubj="emptyHostsTable" steps={policySteps} headerComponent={ } bodyComponent={ } /> @@ -271,7 +271,7 @@ const ManagementEmptyState = React.memo<{ ); PolicyEmptyState.displayName = 'PolicyEmptyState'; -EndpointsEmptyState.displayName = 'EndpointsEmptyState'; +HostsEmptyState.displayName = 'HostsEmptyState'; ManagementEmptyState.displayName = 'ManagementEmptyState'; -export { PolicyEmptyState, EndpointsEmptyState, ManagementEmptyState }; +export { PolicyEmptyState, HostsEmptyState, ManagementEmptyState }; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx index 8cfffb1ae3d35..a970edd4d30f4 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx @@ -11,9 +11,9 @@ import { MANAGEMENT_ROUTING_HOSTS_PATH } from '../../common/constants'; import { NotFoundPage } from '../../../app/404'; /** - * Provides the routing container for the endpoints related views + * Provides the routing container for the hosts related views */ -export const EndpointsContainer = memo(() => { +export const HostsContainer = memo(() => { return ( @@ -22,4 +22,4 @@ export const EndpointsContainer = memo(() => { ); }); -EndpointsContainer.displayName = 'EndpointsContainer'; +HostsContainer.displayName = 'HostsContainer'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx index 21ec128737c04..10ea271139e49 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/host_details.tsx @@ -200,8 +200,8 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { description: details.host.hostname, }, { - title: i18n.translate('xpack.securitySolution.endpoint.host.details.sensorVersion', { - defaultMessage: 'Sensor Version', + title: i18n.translate('xpack.securitySolution.endpoint.host.details.endpointVersion', { + defaultMessage: 'Endpoint Version', }), description: details.agent.version, }, diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx index 9766cd6abd2b1..996b987ea2be3 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx @@ -44,7 +44,7 @@ describe('when on the hosts page', () => { it('should show the empty state when there are no hosts or polices', async () => { const renderResult = render(); - // Initially, there are no endpoints or policies, so we prompt to add policies first. + // Initially, there are no hosts or policies, so we prompt to add policies first. const table = await renderResult.findByTestId('emptyPolicyTable'); expect(table).not.toBeNull(); }); @@ -79,8 +79,8 @@ describe('when on the hosts page', () => { it('should show the no hosts empty state', async () => { const renderResult = render(); - const emptyEndpointsTable = await renderResult.findByTestId('emptyEndpointsTable'); - expect(emptyEndpointsTable).not.toBeNull(); + const emptyHostsTable = await renderResult.findByTestId('emptyHostsTable'); + expect(emptyHostsTable).not.toBeNull(); }); it('should display the onboarding steps', async () => { @@ -335,7 +335,7 @@ describe('when on the hosts page', () => { const policyStatusLink = await renderResult.findByTestId('policyStatusValue'); expect(policyStatusLink).not.toBeNull(); expect(policyStatusLink.getAttribute('href')).toEqual( - '/endpoints?page_index=0&page_size=10&selected_host=1&show=policy_response' + '/hosts?page_index=0&page_size=10&selected_host=1&show=policy_response' ); }); @@ -549,7 +549,7 @@ describe('when on the hosts page', () => { const subHeaderBackLink = await renderResult.findByTestId('flyoutSubHeaderBackButton'); expect(subHeaderBackLink.textContent).toBe('Endpoint Details'); expect(subHeaderBackLink.getAttribute('href')).toBe( - '/endpoints?page_index=0&page_size=10&selected_host=1' + '/hosts?page_index=0&page_size=10&selected_host=1' ); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx index cfb9b2c4cce4b..b9933ad7e5e50 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx @@ -35,7 +35,7 @@ import { CreateStructuredSelector } from '../../../../common/store'; import { Immutable, HostInfo } from '../../../../../common/endpoint/types'; import { SpyRoute } from '../../../../common/utils/route/spy_routes'; import { ManagementPageView } from '../../../components/management_page_view'; -import { PolicyEmptyState, EndpointsEmptyState } from '../../../components/management_empty_state'; +import { PolicyEmptyState, HostsEmptyState } from '../../../components/management_empty_state'; import { FormattedDate } from '../../../../common/components/formatted_date'; import { useNavigateToAppEventHandler } from '../../../../common/hooks/endpoint/use_navigate_to_app_event_handler'; import { @@ -339,7 +339,7 @@ export const HostList = () => { ); } else if (!policyItemsLoading && policyItems && policyItems.length > 0) { return ( - { headerLeft={ <> -

+

{ const history = useHistory(); return ( - + { headerLeft={ <> -

+

{ @@ -166,7 +168,7 @@ export class Plugin implements IPlugin { const esArchiver = getService('esArchiver'); const testSubjects = getService('testSubjects'); - describe('endpoint list', function () { + describe('host list', function () { this.tags('ciGroup7'); const sleep = (ms = 100) => new Promise((resolve) => setTimeout(resolve, ms)); describe('when there is data,', () => { before(async () => { await esArchiver.load('endpoint/metadata/api_feature', { useCreate: true }); - await pageObjects.endpoint.navigateToEndpointList(); + await pageObjects.endpoint.navigateToHostList(); }); after(async () => { await deleteMetadataStream(getService); @@ -28,7 +28,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('finds page title', async () => { const title = await testSubjects.getVisibleText('pageViewHeaderLeftTitle'); - expect(title).to.equal('Endpoints'); + expect(title).to.equal('Hosts'); }); it('displays table data', async () => { @@ -129,7 +129,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { // This set of tests fails the flyout does not open in the before() and will be fixed in soon describe.skip('has a url with a host id', () => { before(async () => { - await pageObjects.endpoint.navigateToEndpointList( + await pageObjects.endpoint.navigateToHostList( 'selected_host=fc0ff548-feba-41b6-8367-65e8790d0eaf' ); }); @@ -178,7 +178,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { before(async () => { // clear out the data and reload the page await deleteMetadataStream(getService); - await pageObjects.endpoint.navigateToEndpointList(); + await pageObjects.endpoint.navigateToHostList(); }); it('displays empty Policy Table page.', async () => { await testSubjects.existOrFail('emptyPolicyTable'); diff --git a/x-pack/test/security_solution_endpoint/config.ts b/x-pack/test/security_solution_endpoint/config.ts index f02a6bdcd51ed..2d94163fa1018 100644 --- a/x-pack/test/security_solution_endpoint/config.ts +++ b/x-pack/test/security_solution_endpoint/config.ts @@ -23,7 +23,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { apps: { ...xpackFunctionalConfig.get('apps'), ['securitySolutionManagement']: { - pathname: '/app/security/management', + pathname: '/app/security/administration', }, }, kbnTestServer: { diff --git a/x-pack/test/security_solution_endpoint/page_objects/endpoint_page.ts b/x-pack/test/security_solution_endpoint/page_objects/endpoint_page.ts index 7339903d74a0b..ae4320fc5395f 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/endpoint_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/endpoint_page.ts @@ -14,12 +14,12 @@ export function EndpointPageProvider({ getService, getPageObjects }: FtrProvider return { /** - * Navigate to the Endpoints list page + * Navigate to the Hosts list page */ - async navigateToEndpointList(searchParams?: string) { + async navigateToHostList(searchParams?: string) { await pageObjects.common.navigateToUrlWithBrowserHistory( 'securitySolutionManagement', - `/endpoints${searchParams ? `?${searchParams}` : ''}` + `/hosts${searchParams ? `?${searchParams}` : ''}` ); await pageObjects.header.waitUntilLoadingHasFinished(); },