Skip to content

Commit

Permalink
mgmt to administration, more hosts changes
Browse files Browse the repository at this point in the history
  • Loading branch information
parkiino committed Jul 7, 2020
1 parent 8f8f95e commit 9976a38
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 48 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const PolicyEmptyState = React.memo<{
);
});

const EndpointsEmptyState = React.memo<{
const HostsEmptyState = React.memo<{
loading: boolean;
onActionClick: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
actionDisabled: boolean;
Expand All @@ -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: (
<>
<EuiText color="subdued" size="xs">
<FormattedMessage
id="xpack.securitySolution.endpoint.endpointList.stepOne"
id="xpack.securitySolution.endpoint.hostList.stepOne"
defaultMessage="These are existing policies."
/>
</EuiText>
Expand All @@ -138,15 +138,15 @@ const EndpointsEmptyState = React.memo<{
return loading ? (
<EuiSelectableMessage>
<FormattedMessage
id="xpack.securitySolution.endpoint.endpointList.loadingPolicies"
id="xpack.securitySolution.endpoint.hostList.loadingPolicies"
defaultMessage="Loading policy configs"
/>
</EuiSelectableMessage>
) : selectionOptions.length ? (
list
) : (
<FormattedMessage
id="xpack.securitySolution.endpoint.endpointList.noPolicies"
id="xpack.securitySolution.endpoint.hostList.noPolicies"
defaultMessage="There are no policies."
/>
);
Expand All @@ -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: (
<EuiText color="subdued" size="xs">
<FormattedMessage
id="xpack.securitySolution.endpoint.endpointList.stepTwo"
id="xpack.securitySolution.endpoint.hostList.stepTwo"
defaultMessage="You'll be given a command in Ingest to get you started."
/>
</EuiText>
Expand All @@ -178,18 +178,18 @@ const EndpointsEmptyState = React.memo<{
loading={loading}
onActionClick={onActionClick}
actionDisabled={actionDisabled}
dataTestSubj="emptyEndpointsTable"
dataTestSubj="emptyHostsTable"
steps={policySteps}
headerComponent={
<FormattedMessage
id="xpack.securitySolution.endpoint.endpointList.noEndpointsPrompt"
defaultMessage="You have a policy, but no Endpoints are deployed!"
id="xpack.securitySolution.endpoint.hostList.noHostsPrompt"
defaultMessage="You have a policy, but no Hosts are deployed!"
/>
}
bodyComponent={
<FormattedMessage
id="xpack.securitySolution.endpoint.endpointList.noEndpointsInstructions"
defaultMessage="Elastic Endpoint Security gives you the power to keep your endpoints safe from attack, as well as unparalleled visibility into any threat in your environment."
id="xpack.securitySolution.endpoint.hostList.noHostsInstructions"
defaultMessage="Elastic Endpoint Security gives you the power to keep your hosts safe from attack, as well as unparalleled visibility into any threat in your environment."
/>
}
/>
Expand Down Expand Up @@ -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 };
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Switch>
<Route path={MANAGEMENT_ROUTING_HOSTS_PATH} exact component={HostList} />
Expand All @@ -22,4 +22,4 @@ export const EndpointsContainer = memo(() => {
);
});

EndpointsContainer.displayName = 'EndpointsContainer';
HostsContainer.displayName = 'HostsContainer';
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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'
);
});

Expand Down Expand Up @@ -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'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -339,7 +339,7 @@ export const HostList = () => {
);
} else if (!policyItemsLoading && policyItems && policyItems.length > 0) {
return (
<EndpointsEmptyState
<HostsEmptyState
loading={loading}
onActionClick={handleDeployEndpointsClick}
actionDisabled={selectedPolicyId === undefined}
Expand Down Expand Up @@ -377,7 +377,7 @@ export const HostList = () => {
headerLeft={
<>
<EuiTitle size="l">
<h1>
<h1 data-test-subj="pageViewHeaderLeftTitle">
<FormattedMessage
id="xpack.securitySolution.hostList.pageTitle"
defaultMessage="Hosts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import {
MANAGEMENT_ROUTING_ROOT_PATH,
} from '../common/constants';
import { NotFoundPage } from '../../app/404';
import { EndpointsContainer } from './endpoint_hosts';
import { HostsContainer } from './endpoint_hosts';
import { getHostListPath } from '../common/routing';

export const ManagementContainer = memo(() => {
const history = useHistory();
return (
<Switch>
<Route path={MANAGEMENT_ROUTING_HOSTS_PATH} component={EndpointsContainer} />
<Route path={MANAGEMENT_ROUTING_HOSTS_PATH} component={HostsContainer} />
<Route path={MANAGEMENT_ROUTING_POLICIES_PATH} component={PolicyContainer} />
<Route
path={MANAGEMENT_ROUTING_ROOT_PATH}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const PolicyList = React.memo(() => {
headerLeft={
<>
<EuiTitle size="l">
<h1>
<h1 data-test-subj="pageViewHeaderLeftTitle">
<FormattedMessage
id="xpack.securitySolution.policyList.pageTitle"
defaultMessage="Policies"
Expand Down
18 changes: 13 additions & 5 deletions x-pack/plugins/security_solution/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
core.application.register({
exactRoute: true,
id: APP_ID,
title: 'Security',
title: i18n.translate('xpack.securitySolution.security.title', {
defaultMessage: 'Security',
}),
appRoute: APP_PATH,
navLinkStatus: AppNavLinkStatus.hidden,
mount: async (params: AppMountParameters) => {
Expand Down Expand Up @@ -166,7 +168,7 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S

core.application.register({
id: `${APP_ID}:${SecurityPageName.hosts}`,
title: 'Hosts',
title: i18n.translate('xpack.securitySolution.hostsPage.title', { defaultMessage: 'Hosts' }),
order: 9002,
euiIconType: APP_ICON,
category: DEFAULT_APP_CATEGORIES.security,
Expand All @@ -193,7 +195,9 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S

core.application.register({
id: `${APP_ID}:${SecurityPageName.network}`,
title: 'Network',
title: i18n.translate('xpack.securitySolution.networkPage.title', {
defaultMessage: 'Network',
}),
order: 9002,
euiIconType: APP_ICON,
category: DEFAULT_APP_CATEGORIES.security,
Expand All @@ -220,7 +224,9 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S

core.application.register({
id: `${APP_ID}:${SecurityPageName.timelines}`,
title: 'Timelines',
title: i18n.translate('xpack.securitySolution.timelinesPage.title', {
defaultMessage: 'Timelines',
}),
order: 9002,
euiIconType: APP_ICON,
category: DEFAULT_APP_CATEGORIES.security,
Expand Down Expand Up @@ -274,7 +280,9 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S

core.application.register({
id: `${APP_ID}:${SecurityPageName.management}`,
title: 'Management',
title: i18n.translate('xpack.securitySolution.administrationPage.title', {
defaultMessage: 'Administration',
}),
order: 9002,
euiIconType: APP_ICON,
category: DEFAULT_APP_CATEGORIES.security,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
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);
});

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 () => {
Expand Down Expand Up @@ -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'
);
});
Expand Down Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/security_solution_endpoint/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
apps: {
...xpackFunctionalConfig.get('apps'),
['securitySolutionManagement']: {
pathname: '/app/security/management',
pathname: '/app/security/administration',
},
},
kbnTestServer: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down

0 comments on commit 9976a38

Please sign in to comment.