Skip to content

Commit

Permalink
Reorganize Management apps in side nav.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Mar 21, 2020
1 parent b0a6b30 commit 5bf796d
Show file tree
Hide file tree
Showing 21 changed files with 118 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ uiModules
};
});

management.getSection('kibana').register('index_patterns', {
management.getSection('data').register('index_patterns', {
display: i18n.translate('kbn.management.indexPattern.sectionsHeader', {
defaultMessage: 'Index Patterns',
defaultMessage: '^ Index Patterns',
}),
order: 0,
order: 15,
url: '#/management/kibana/index_patterns/',
});
22 changes: 9 additions & 13 deletions src/plugins/management/public/legacy/sections_register.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,27 @@ export class LegacyManagementAdapter {
capabilities
);

this.main.register('data', {
this.main.register('ingest', {
display: i18n.translate('management.connectDataDisplayName', {
defaultMessage: 'Connect Data',
defaultMessage: 'Ingest',
}),
order: 0,
order: 10,
icon: 'none',
});

this.main.register('elasticsearch', {
display: 'Elasticsearch',
this.main.register('data', {
display: i18n.translate('management.connectDataDisplayName', {
defaultMessage: 'Data',
}),
order: 20,
icon: 'logoElasticsearch',
});

this.main.register('kibana', {
display: 'Kibana',
order: 30,
order: 40,
icon: 'logoKibana',
});

this.main.register('logstash', {
display: 'Logstash',
order: 30,
icon: 'logoLogstash',
});

return this.main;
};
getManagement = () => this.main;
Expand Down
36 changes: 31 additions & 5 deletions src/plugins/management/public/management_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,39 @@ export class ManagementService {
getStartServices
);

register({ id: 'kibana', title: 'Kibana', order: 30, euiIconType: 'logoKibana' });
register({ id: 'logstash', title: 'Logstash', order: 30, euiIconType: 'logoLogstash' });
register({
id: 'elasticsearch',
title: 'Elasticsearch',
id: 'ingest',
title: 'Ingest',
order: 10,
euiIconType: 'none',
});

register({
id: 'data',
title: 'Data',
order: 20,
euiIconType: 'logoElasticsearch',
euiIconType: 'none',
});

register({
id: 'actions',
title: 'Detection',
order: 30,
euiIconType: 'none',
});

register({
id: 'kibana',
title: 'Kibana',
order: 60,
euiIconType: 'logoKibana',
});

register({
id: 'cluster',
title: 'Stack',
order: 70,
euiIconType: 'none',
});

return {
Expand Down
13 changes: 3 additions & 10 deletions x-pack/legacy/plugins/beats_management/public/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,12 @@ async function startApp(libs: FrontendLibs) {
await libs.framework.waitUntilFrameworkReady();

if (libs.framework.licenseIsAtLeast('standard')) {
libs.framework.registerManagementSection({
id: 'beats',
name: i18n.translate('xpack.beatsManagement.centralManagementSectionLabel', {
defaultMessage: 'Beats',
}),
iconName: 'logoBeats',
});

libs.framework.registerManagementUI({
sectionId: 'beats',
sectionId: 'ingest',
name: i18n.translate('xpack.beatsManagement.centralManagementLinkLabel', {
defaultMessage: 'Central Management',
defaultMessage: 'Beats',
}),
order: 30,
basePath: BASE_PATH,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ const isLicenseOK = isAvailable && isActive;
const isCcrUiEnabled = chrome.getInjected('ccrUiEnabled');

if (isLicenseOK && isCcrUiEnabled) {
const esSection = management.getSection('elasticsearch');
const esSection = management.getSection('data');

esSection.register('ccr', {
visible: true,
display: i18n.translate('xpack.crossClusterReplication.appTitle', {
defaultMessage: 'Cross-Cluster Replication',
defaultMessage: 'Cross-Cluster',
}),
order: 4,
order: 90,
url: `#${BASE_PATH}`,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ if (chrome.getInjected('ilmUiEnabled')) {

// Once this app no longer depends upon Angular's routing (e.g. for the "redirect" service), we can
// use the Management plugin's API to register this app within the Elasticsearch section.
const esSection = management.getSection('elasticsearch');
const esSection = management.getSection('data');
esSection.register('index_lifecycle_policies', {
visible: true,
display: PLUGIN.TITLE,
order: 2,
display: 'Schedules',
order: 20,
url: `#${BASE_PATH}policies`,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ routes.defaults(/\/management/, {
resolve: {
logstashManagementSection: $injector => {
const licenseService = $injector.get('logstashLicenseService');
const logstashSection = management.getSection('logstash/pipelines');
const logstashSection = management.getSection('ingest');

if (licenseService.enableLinks) {
logstashSection.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@
import { management } from 'ui/management';
import { i18n } from '@kbn/i18n';

management.getSection('logstash').register('pipelines', {
management.getSection('ingest').register('pipelines', {
display: i18n.translate('xpack.logstash.managementSection.pipelinesTitle', {
defaultMessage: 'Pipelines',
defaultMessage: 'Logstash Pipelines',
}),
order: 10,
order: 40,
url: '#/management/logstash/pipelines/',
});

management.getSection('logstash/pipelines').register('pipeline', {
visible: false,
});
// management.getSection('ingest/pipelines').register('pipeline', {
// visible: false,
// });

management.getSection('logstash/pipelines/pipeline').register('edit', {
display: i18n.translate('xpack.logstash.managementSection.editPipelineTitle', {
defaultMessage: 'Edit pipeline',
}),
order: 1,
visible: false,
});
// management.getSection('ingest/pipelines/pipeline').register('edit', {
// display: i18n.translate('xpack.logstash.managementSection.editPipelineTitle', {
// defaultMessage: 'Edit pipeline',
// }),
// order: 1,
// visible: false,
// });

management.getSection('logstash/pipelines/pipeline').register('new', {
display: i18n.translate('xpack.logstash.managementSection.createPipelineTitle', {
defaultMessage: 'Create pipeline',
}),
order: 1,
visible: false,
});
// management.getSection('ingest/pipelines/pipeline').register('new', {
// display: i18n.translate('xpack.logstash.managementSection.createPipelineTitle', {
// defaultMessage: 'Create pipeline',
// }),
// order: 1,
// visible: false,
// });
6 changes: 3 additions & 3 deletions x-pack/legacy/plugins/rollup/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ export class RollupPlugin implements Plugin {
});
}

const esSection = management.sections.getSection('elasticsearch');
const esSection = management.sections.getSection('data');
if (esSection) {
esSection.registerApp({
id: 'rollup_jobs',
title: i18n.translate('xpack.rollupJobs.appTitle', { defaultMessage: 'Rollup Jobs' }),
order: 3,
title: '^ Rollups',
order: 30,
mount(params) {
params.setBreadcrumbs([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export const BASE_PATH = '/management/elasticsearch/index_management/';
export const BASE_PATH = '/management/data/index_management/';
21 changes: 17 additions & 4 deletions x-pack/plugins/index_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export class IndexMgmtUIPlugin {
notificationService.setup(notifications);
this.uiMetricService.setup(usageCollection);

management.sections.getSection('elasticsearch')!.registerApp({
management.sections.getSection('data')!.registerApp({
id: PLUGIN.id,
title: i18n.translate('xpack.idxMgmt.appTitle', { defaultMessage: 'Index Management' }),
order: 1,
title: i18n.translate('xpack.idxMgmt.appTitle', { defaultMessage: 'Sources' }),
order: 10,
mount: async ({ element, setBreadcrumbs }) => {
const [core] = await getStartServices();
const { docLinks, fatalErrors } = core;
Expand All @@ -76,12 +76,25 @@ export class IndexMgmtUIPlugin {
notificationService,
},
};

const { renderApp } = await import('./application');
return renderApp(element, { core, dependencies: appDependencies });
},
});

management.sections.getSection('ingest')!.registerApp({
id: 'ingest_node',
title: 'Ingest Node',
order: 50,
mount: async ({ element, setBreadcrumbs }) => {},
});

management.sections.getSection('ingest')!.registerApp({
id: 'index_templates',
title: 'Index Templates',
order: 60,
mount: async ({ element, setBreadcrumbs }) => {},
});

return {
extensionsService: this.extensionsService.setup(),
};
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/license_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class LicenseManagementUIPlugin implements Plugin<void, void, any, any> {
const { getStartServices } = coreSetup;
const { management, telemetry, licensing } = plugins;

management.sections.getSection('elasticsearch')!.registerApp({
management.sections.getSection('cluster')!.registerApp({
id: PLUGIN.id,
title: PLUGIN.title,
order: 99,
Expand Down
13 changes: 3 additions & 10 deletions x-pack/plugins/ml/public/application/management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,14 @@ export function initManagementSection(
licensing.subscribe(license => {
if (license.check(PLUGIN_ID, MINIMUM_FULL_LICENSE).state === LICENSE_CHECK_STATE.Valid) {
const management = pluginsSetup.management;
const mlSection = management.sections.register({
id: PLUGIN_ID,
title: i18n.translate('xpack.ml.management.mlTitle', {
defaultMessage: 'Machine Learning',
}),
order: 100,
icon: PLUGIN_ICON,
});
const mlSection = management.sections.getSection('actions');

mlSection.registerApp({
id: 'jobsListLink',
title: i18n.translate('xpack.ml.management.jobsListTitle', {
defaultMessage: 'Jobs list',
defaultMessage: 'Machine Learning',
}),
order: 10,
order: 60,
async mount({ element, setBreadcrumbs }) {
const [coreStart] = await core.getStartServices();
setBreadcrumbs(getJobsListBreadcrumbs());
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/remote_clusters/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ export class RemoteClustersUIPlugin implements Plugin<void, void, Dependencies,
} = this.initializerContext.config.get<ClientConfigType>();

if (isRemoteClustersUiEnabled) {
const esSection = management.sections.getSection('elasticsearch');
const esSection = management.sections.getSection('data');

esSection!.registerApp({
id: 'remote_clusters',
title: i18n.translate('xpack.remoteClusters.appTitle', {
defaultMessage: 'Remote Clusters',
defaultMessage: '^ Remote Clusters',
}),
order: '100',
mount: async ({ element, setBreadcrumbs }) => {
const [core] = await getStartServices();
const {
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/reporting/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ export class ReportingPublicPlugin implements Plugin<any, any> {
private readonly stop$ = new Rx.ReplaySubject(1);

private readonly title = i18n.translate('xpack.reporting.management.reportingTitle', {
defaultMessage: 'Reporting',
defaultMessage: 'Reports',
});

private readonly breadcrumbText = i18n.translate('xpack.reporting.breadcrumb', {
defaultMessage: 'Reporting',
defaultMessage: 'Reports',
});

constructor(initializerContext: PluginInitializerContext) {}
Expand Down Expand Up @@ -107,7 +107,7 @@ export class ReportingPublicPlugin implements Plugin<any, any> {
home.featureCatalogue.register({
id: 'reporting',
title: i18n.translate('xpack.reporting.registerFeature.reportingTitle', {
defaultMessage: 'Reporting',
defaultMessage: 'Reports',
}),
description: i18n.translate('xpack.reporting.registerFeature.reportingDescription', {
defaultMessage: 'Manage your reports generated from Discover, Visualize, and Dashboard.',
Expand All @@ -118,7 +118,7 @@ export class ReportingPublicPlugin implements Plugin<any, any> {
category: FeatureCatalogueCategory.ADMIN,
});

management.sections.getSection('kibana')!.registerApp({
management.sections.getSection('actions')!.registerApp({
id: 'reporting',
title: this.title,
order: 15,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export class ManagementService {
this.license = license;

const securitySection = management.sections.register({
id: 'security',
id: 'auth',
title: i18n.translate('xpack.security.management.securityTitle', {
defaultMessage: 'Security',
defaultMessage: 'Access',
}),
order: 100,
order: 50,
euiIconType: 'securityApp',
});

Expand All @@ -58,7 +58,7 @@ export class ManagementService {

start({ management }: StartParams) {
this.licenseFeaturesSubscription = this.license.features$.subscribe(async features => {
const securitySection = management.sections.getSection('security')!;
const securitySection = management.sections.getSection('auth')!;

const securityManagementAppsStatuses: Array<[ManagementApp, boolean]> = [
[securitySection.getApp(usersManagementApp.id)!, features.showLinks],
Expand Down
Loading

0 comments on commit 5bf796d

Please sign in to comment.