Skip to content

Commit 465d813

Browse files
committed
Reorganize Management apps into Ingest, Data, Insights and Alerting, Security, Kibana, and Stack groups.
- Define these groups in src/plugins/management/public/legacy/sections_register to act as a single source of truth in both OSS and X-Pack.
1 parent 034f259 commit 465d813

File tree

39 files changed

+117
-213
lines changed

39 files changed

+117
-213
lines changed

src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ uiModules
163163
};
164164
});
165165

166-
management.getSection('kibana').register('index_patterns', {
166+
management.getSection('data').register('index_patterns', {
167167
display: i18n.translate('kbn.management.indexPattern.sectionsHeader', {
168168
defaultMessage: 'Index Patterns',
169169
}),
170-
order: 0,
170+
order: 1,
171171
url: '#/management/kibana/index_patterns/',
172172
});

src/plugins/management/public/legacy/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
* under the License.
1818
*/
1919

20-
export { LegacyManagementAdapter } from './sections_register';
20+
export { LegacyManagementAdapter, sections } from './sections_register';
2121
export { LegacyManagementSection } from './section';

src/plugins/management/public/legacy/sections_register.js

+33-23
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,33 @@
2020
import { LegacyManagementSection } from './section';
2121
import { i18n } from '@kbn/i18n';
2222

23+
export const sections = [
24+
{
25+
id: 'ingest',
26+
title: 'Ingest',
27+
},
28+
{
29+
id: 'data',
30+
title: 'Data',
31+
},
32+
{
33+
id: 'insightsAndAlerting',
34+
title: 'Insights and Alerting',
35+
},
36+
{
37+
id: 'security',
38+
title: 'Security',
39+
},
40+
{
41+
id: 'kibana',
42+
title: 'Kibana',
43+
},
44+
{
45+
id: 'stack',
46+
title: 'Stack',
47+
},
48+
];
49+
2350
export class LegacyManagementAdapter {
2451
main = undefined;
2552
init = capabilities => {
@@ -33,29 +60,12 @@ export class LegacyManagementAdapter {
3360
capabilities
3461
);
3562

36-
this.main.register('data', {
37-
display: i18n.translate('management.connectDataDisplayName', {
38-
defaultMessage: 'Connect Data',
39-
}),
40-
order: 0,
41-
});
42-
43-
this.main.register('elasticsearch', {
44-
display: 'Elasticsearch',
45-
order: 20,
46-
icon: 'logoElasticsearch',
47-
});
48-
49-
this.main.register('kibana', {
50-
display: 'Kibana',
51-
order: 30,
52-
icon: 'logoKibana',
53-
});
54-
55-
this.main.register('logstash', {
56-
display: 'Logstash',
57-
order: 30,
58-
icon: 'logoLogstash',
63+
sections.forEach(({ id, title, icon }, idx) => {
64+
this.main.register(id, {
65+
display: title,
66+
order: idx,
67+
icon,
68+
});
5969
});
6070

6171
return this.main;

src/plugins/management/public/management_service.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import { ManagementSection } from './management_section';
2121
import { KibanaLegacySetup } from '../../kibana_legacy/public';
2222
// @ts-ignore
23-
import { LegacyManagementSection } from './legacy';
23+
import { LegacyManagementSection, sections } from './legacy';
2424
import { CreateSection } from './types';
2525
import { StartServicesAccessor, CoreStart } from '../../../core/public';
2626

@@ -79,13 +79,11 @@ export class ManagementService {
7979
getStartServices
8080
);
8181

82-
register({ id: 'kibana', title: 'Kibana', order: 30, euiIconType: 'logoKibana' });
83-
register({
84-
id: 'elasticsearch',
85-
title: 'Elasticsearch',
86-
order: 20,
87-
euiIconType: 'logoElasticsearch',
88-
});
82+
sections.forEach(
83+
({ id, title, icon }: { id: string; title: string; icon?: string }, idx: number) => {
84+
register({ id, title, euiIconType: icon, order: idx });
85+
}
86+
);
8987

9088
return {
9189
register,

x-pack/legacy/plugins/beats_management/common/constants/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ export { INDEX_NAMES } from './index_names';
99
export { PLUGIN } from './plugin';
1010
export { LICENSES, REQUIRED_LICENSES, REQUIRED_ROLES } from './security';
1111
export { TABLE_CONFIG } from './table';
12-
export const BASE_PATH = '/management/beats_management';
12+
export const BASE_PATH = '/management/ingest/beats_management';

x-pack/legacy/plugins/beats_management/public/index.tsx

+2-16
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function startApp(libs: FrontendLibs) {
2626
BASE_PATH,
2727
<ThemeProvider theme={{ eui: euiVars }}>
2828
<I18nContext>
29-
<HashRouter basename="/management/beats_management">
29+
<HashRouter basename={BASE_PATH}>
3030
<UnstatedProvider inject={[new BeatsContainer(libs), new TagsContainer(libs)]}>
3131
<BreadcrumbProvider useGlobalBreadcrumbs={libs.framework.versionGreaterThen('6.7.0')}>
3232
<Subscribe to={[BeatsContainer, TagsContainer]}>
@@ -52,21 +52,7 @@ async function startApp(libs: FrontendLibs) {
5252
await libs.framework.waitUntilFrameworkReady();
5353

5454
if (libs.framework.licenseIsAtLeast('standard')) {
55-
libs.framework.registerManagementSection({
56-
id: 'beats',
57-
name: i18n.translate('xpack.beatsManagement.centralManagementSectionLabel', {
58-
defaultMessage: 'Beats',
59-
}),
60-
iconName: 'logoBeats',
61-
});
62-
63-
libs.framework.registerManagementUI({
64-
sectionId: 'beats',
65-
name: i18n.translate('xpack.beatsManagement.centralManagementLinkLabel', {
66-
defaultMessage: 'Central Management',
67-
}),
68-
basePath: BASE_PATH,
69-
});
55+
libs.framework.registerManagementSection();
7056
}
7157
}
7258

x-pack/legacy/plugins/beats_management/public/lib/adapters/framework/adapter_types.ts

+1-13
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,7 @@ export interface FrameworkAdapter {
2121
component: React.ReactElement<any>,
2222
toController: 'management' | 'self'
2323
): void;
24-
registerManagementSection(settings: {
25-
id?: string;
26-
name: string;
27-
iconName: string;
28-
order?: number;
29-
}): void;
30-
registerManagementUI(settings: {
31-
sectionId?: string;
32-
name: string;
33-
basePath: string;
34-
visable?: boolean;
35-
order?: number;
36-
}): void;
24+
registerManagementSection(): void;
3725
}
3826

3927
export const RuntimeFrameworkInfo = t.type({

x-pack/legacy/plugins/beats_management/public/lib/adapters/framework/kibana_framework_adapter.ts

+9-39
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import { IScope } from 'angular';
99
import { PathReporter } from 'io-ts/lib/PathReporter';
1010
import * as React from 'react';
1111
import * as ReactDOM from 'react-dom';
12+
import { i18n } from '@kbn/i18n';
1213
import { UIRoutes } from 'ui/routes';
1314
import { isLeft } from 'fp-ts/lib/Either';
1415
import { npSetup } from 'ui/new_platform';
1516
import { SecurityPluginSetup } from '../../../../../../../plugins/security/public';
1617
import { BufferedKibanaServiceCall, KibanaAdapterServiceRefs, KibanaUIConfig } from '../../types';
18+
import { BASE_PATH } from '../../../../common/constants';
1719
import {
1820
FrameworkAdapter,
1921
FrameworkInfo,
@@ -148,45 +150,13 @@ export class KibanaFrameworkAdapter implements FrameworkAdapter {
148150
);
149151
}
150152

151-
public registerManagementSection(settings: {
152-
id?: string;
153-
name: string;
154-
iconName: string;
155-
order?: number;
156-
}) {
157-
const sectionId = settings.id || this.PLUGIN_ID;
158-
159-
if (!this.management.hasItem(sectionId)) {
160-
this.management.register(sectionId, {
161-
display: settings.name,
162-
icon: settings.iconName,
163-
order: settings.order || 30,
164-
});
165-
}
166-
}
167-
168-
public registerManagementUI(settings: {
169-
sectionId?: string;
170-
name: string;
171-
basePath: string;
172-
visable?: boolean;
173-
order?: number;
174-
}) {
175-
const sectionId = settings.sectionId || this.PLUGIN_ID;
176-
177-
if (!this.management.hasItem(sectionId)) {
178-
throw new Error(
179-
`registerManagementUI was called with a sectionId of ${sectionId}, and that is is not yet regestered as a section`
180-
);
181-
}
182-
183-
const section = this.management.getSection(sectionId);
184-
185-
section.register(sectionId, {
186-
visible: settings.visable || true,
187-
display: settings.name,
188-
order: settings.order || 30,
189-
url: `#${settings.basePath}`,
153+
public registerManagementSection() {
154+
this.management.getSection('ingest')!.register('beats_central_management', {
155+
display: i18n.translate('xpack.beatsManagement.centralManagementSectionLabel', {
156+
defaultMessage: 'Beats Central Management',
157+
}),
158+
order: 2,
159+
url: `#${BASE_PATH}/`,
190160
});
191161
}
192162

x-pack/legacy/plugins/beats_management/public/lib/adapters/framework/testing_framework_adapter.ts

+1-16
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,7 @@ export class TestingFrameworkAdapter implements FrameworkAdapter {
4848
throw new Error('not yet implamented');
4949
}
5050

51-
public registerManagementSection(settings: {
52-
id?: string;
53-
name: string;
54-
iconName: string;
55-
order?: number;
56-
}) {
57-
throw new Error('not yet implamented');
58-
}
59-
60-
public registerManagementUI(settings: {
61-
sectionId?: string;
62-
name: string;
63-
basePath: string;
64-
visable?: boolean;
65-
order?: number;
66-
}) {
51+
public registerManagementSection() {
6752
throw new Error('not yet implamented');
6853
}
6954
}

x-pack/legacy/plugins/beats_management/public/lib/framework.ts

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export class FrameworkLib {
1212
public waitUntilFrameworkReady = this.adapter.waitUntilFrameworkReady.bind(this.adapter);
1313
public renderUIAtPath = this.adapter.renderUIAtPath.bind(this.adapter);
1414
public registerManagementSection = this.adapter.registerManagementSection.bind(this.adapter);
15-
public registerManagementUI = this.adapter.registerManagementUI.bind(this.adapter);
1615

1716
constructor(private readonly adapter: FrameworkAdapter) {}
1817

x-pack/plugins/cross_cluster_replication/common/constants/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const APPS = {
2424
};
2525

2626
export const MANAGEMENT_ID = 'cross_cluster_replication';
27-
export const BASE_PATH = `/management/elasticsearch/${MANAGEMENT_ID}`;
28-
export const BASE_PATH_REMOTE_CLUSTERS = '/management/elasticsearch/remote_clusters';
27+
export const BASE_PATH = `/management/data/${MANAGEMENT_ID}`;
28+
export const BASE_PATH_REMOTE_CLUSTERS = '/management/data/remote_clusters';
2929
export const API_BASE_PATH = '/api/cross_cluster_replication';
3030
export const API_REMOTE_CLUSTERS_BASE_PATH = '/api/remote_clusters';
3131
export const API_INDEX_MANAGEMENT_BASE_PATH = '/api/index_management';

x-pack/plugins/cross_cluster_replication/public/plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class CrossClusterReplicationPlugin implements Plugin {
2222

2323
public setup(coreSetup: CoreSetup, plugins: PluginDependencies) {
2424
const { licensing, remoteClusters, usageCollection, management, indexManagement } = plugins;
25-
const esSection = management.sections.getSection('elasticsearch');
25+
const esSection = management.sections.getSection('data');
2626

2727
const {
2828
http,

x-pack/plugins/index_lifecycle_management/common/constants/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ export const PLUGIN = {
1717
}),
1818
};
1919

20-
export const BASE_PATH = '/management/elasticsearch/index_lifecycle_management/';
20+
export const BASE_PATH = '/management/data/index_lifecycle_management/';
2121

2222
export const API_BASE_PATH = '/api/index_lifecycle_management';

x-pack/plugins/index_lifecycle_management/public/plugin.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export class IndexLifecycleManagementPlugin {
3737
initUiMetric(usageCollection);
3838
initNotification(toasts, fatalErrors);
3939

40-
management.sections.getSection('elasticsearch')!.registerApp({
40+
management.sections.getSection('data')!.registerApp({
4141
id: PLUGIN.ID,
4242
title: PLUGIN.TITLE,
43-
order: 3,
43+
order: 2,
4444
mount: async ({ element }) => {
4545
const [coreStart] = await getStartServices();
4646
const {

x-pack/plugins/index_management/common/constants/base_path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
export const BASE_PATH = '/management/elasticsearch/index_management/';
7+
export const BASE_PATH = '/management/data/index_management/';

x-pack/plugins/index_management/public/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export class IndexMgmtUIPlugin {
4848
notificationService.setup(notifications);
4949
this.uiMetricService.setup(usageCollection);
5050

51-
management.sections.getSection('elasticsearch')!.registerApp({
51+
management.sections.getSection('data')!.registerApp({
5252
id: PLUGIN.id,
5353
title: i18n.translate('xpack.idxMgmt.appTitle', { defaultMessage: 'Index Management' }),
54-
order: 2,
54+
order: 0,
5555
mount: async params => {
5656
const { mountManagementSection } = await import('./application/mount_management_section');
5757
const services = {

x-pack/plugins/ingest_pipelines/public/plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class IngestPipelinesPlugin implements Plugin {
2020
uiMetricService.setup(usageCollection);
2121
apiService.setup(http, uiMetricService);
2222

23-
management.sections.getSection('elasticsearch')!.registerApp({
23+
management.sections.getSection('ingest')!.registerApp({
2424
id: PLUGIN_ID,
2525
order: 1,
2626
title: i18n.translate('xpack.ingestPipelines.appTitle', {

x-pack/plugins/license_management/common/constants/base_path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
export const BASE_PATH = '/management/elasticsearch/license_management/';
7+
export const BASE_PATH = '/management/stack/license_management/';
88

99
export const API_BASE_PATH = '/api/license';

x-pack/plugins/license_management/public/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ export class LicenseManagementUIPlugin
4444
const { getStartServices } = coreSetup;
4545
const { management, telemetry, licensing } = plugins;
4646

47-
management.sections.getSection('elasticsearch')!.registerApp({
47+
management.sections.getSection('stack')!.registerApp({
4848
id: PLUGIN.id,
4949
title: PLUGIN.title,
50-
order: 99,
50+
order: 0,
5151
mount: async ({ element, setBreadcrumbs }) => {
5252
const [core] = await getStartServices();
5353
const initialLicense = await plugins.licensing.license$.pipe(first()).toPromise();

x-pack/plugins/logstash/public/plugin.ts

+4-9
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,13 @@ export class LogstashPlugin implements Plugin<void, void, SetupDeps> {
3434
const logstashLicense$ = plugins.licensing.license$.pipe(
3535
map(license => new LogstashLicenseService(license))
3636
);
37-
const section = plugins.management.sections.register({
38-
id: 'logstash',
39-
title: 'Logstash',
40-
order: 30,
41-
euiIconType: 'logoLogstash',
42-
});
43-
const managementApp = section.registerApp({
37+
38+
const managementApp = plugins.management.sections.getSection('ingest')!.registerApp({
4439
id: 'pipelines',
4540
title: i18n.translate('xpack.logstash.managementSection.pipelinesTitle', {
46-
defaultMessage: 'Pipelines',
41+
defaultMessage: 'Logstash Pipelines',
4742
}),
48-
order: 10,
43+
order: 1,
4944
mount: async params => {
5045
const [coreStart] = await core.getStartServices();
5146
const { renderApp } = await import('./application');

0 commit comments

Comments
 (0)