From 7f942e59308df78767f6057fb159f56fcd0696be Mon Sep 17 00:00:00 2001 From: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com> Date: Mon, 10 Feb 2020 11:54:56 +0300 Subject: [PATCH] Remove the feature catalogue registry (#56755) * Remove FeatureCatalogueRegistryProvider from x-pack: *infra *maps *reporting * Remove FeatureCatalogueRegistryProvider from x-pack: *canvas *grokdebugger *logstash * Remove feature_catalogue registry * Fix featureCatalogue register * Fix getting all of the registered features * Remove unused timelion feature register * Move feature registering into np * Rename translations Co-authored-by: Elastic Machine --- .../core_plugins/kibana/public/home/index.ts | 15 --- .../kibana/public/home/kibana_services.ts | 4 +- .../public/home/np_ready/application.tsx | 3 +- .../core_plugins/kibana/public/home/plugin.ts | 6 +- .../kibana/public/management/index.js | 21 ---- .../sections/index_patterns/index.js | 20 ---- .../management/sections/objects/index.js | 21 ---- .../management/sections/settings/index.js | 20 ---- .../core_plugins/management/public/legacy.ts | 2 +- .../management/public/np_ready/mocks.ts | 15 ++- .../management/public/np_ready/plugin.ts | 12 ++- .../index_pattern_management_service.ts | 23 +++- .../saved_objects_management_service.ts | 27 ++++- .../timelion/public/register_feature.ts | 36 ------- .../ui/public/registry/feature_catalogue.d.ts | 42 -------- .../ui/public/registry/feature_catalogue.js | 33 ------ .../public/registry/feature_catalogue.test.js | 101 ------------------ src/plugins/advanced_settings/kibana.json | 2 +- .../advanced_settings/public/plugin.ts | 18 +++- src/plugins/management/kibana.json | 2 +- src/plugins/management/public/plugin.ts | 21 +++- x-pack/legacy/plugins/canvas/i18n/index.ts | 7 -- x-pack/legacy/plugins/canvas/index.js | 2 +- .../canvas/public/feature_catalogue_entry.ts | 20 ++++ x-pack/legacy/plugins/canvas/public/legacy.ts | 4 +- .../public/legacy_register_feature.ts} | 9 +- .../legacy/plugins/canvas/public/plugin.tsx | 9 +- .../plugins/canvas/public/register_feature.js | 24 ----- .../grokdebugger/public/register_feature.js | 35 ------ .../grokdebugger/public/register_feature.ts | 34 ++++++ x-pack/legacy/plugins/infra/index.ts | 2 +- x-pack/legacy/plugins/infra/public/app.ts | 6 +- .../infra/public/feature_catalogue_entry.ts | 41 +++++++ .../infra/public/legacy_register_feature.ts | 15 +++ .../infra/public/new_platform_plugin.ts | 13 ++- .../plugins/infra/public/register_feature.ts | 43 -------- ...me_feature.js => register_home_feature.ts} | 28 ++--- .../common/{constants.js => constants.ts} | 2 +- .../{i18n_getters.js => i18n_getters.ts} | 4 +- x-pack/legacy/plugins/maps/index.js | 2 +- .../maps/public/feature_catalogue_entry.ts | 21 ++++ .../maps/public/legacy_register_feature.ts | 14 +++ x-pack/legacy/plugins/maps/public/plugin.ts | 25 +++-- .../plugins/maps/public/register_feature.js | 27 ----- .../monitoring/public/register_feature.js | 30 ------ .../monitoring/public/register_feature.ts | 30 ++++++ .../reporting/public/register_feature.js | 28 ----- .../reporting/public/register_feature.ts | 27 +++++ .../plugins/uptime/public/register_feature.ts | 14 +-- .../translations/translations/ja-JP.json | 13 ++- .../translations/translations/zh-CN.json | 13 ++- 51 files changed, 412 insertions(+), 574 deletions(-) delete mode 100644 src/legacy/core_plugins/timelion/public/register_feature.ts delete mode 100644 src/legacy/ui/public/registry/feature_catalogue.d.ts delete mode 100644 src/legacy/ui/public/registry/feature_catalogue.js delete mode 100644 src/legacy/ui/public/registry/feature_catalogue.test.js create mode 100644 x-pack/legacy/plugins/canvas/public/feature_catalogue_entry.ts rename x-pack/legacy/plugins/{logstash/public/lib/register_home_feature/index.js => canvas/public/legacy_register_feature.ts} (53%) mode change 100755 => 100644 delete mode 100644 x-pack/legacy/plugins/canvas/public/register_feature.js delete mode 100644 x-pack/legacy/plugins/grokdebugger/public/register_feature.js create mode 100644 x-pack/legacy/plugins/grokdebugger/public/register_feature.ts create mode 100644 x-pack/legacy/plugins/infra/public/feature_catalogue_entry.ts create mode 100644 x-pack/legacy/plugins/infra/public/legacy_register_feature.ts delete mode 100644 x-pack/legacy/plugins/infra/public/register_feature.ts rename x-pack/legacy/plugins/logstash/public/lib/{register_home_feature/register_home_feature.js => register_home_feature.ts} (63%) mode change 100755 => 100644 rename x-pack/legacy/plugins/maps/common/{constants.js => constants.ts} (98%) rename x-pack/legacy/plugins/maps/common/{i18n_getters.js => i18n_getters.ts} (90%) create mode 100644 x-pack/legacy/plugins/maps/public/feature_catalogue_entry.ts create mode 100644 x-pack/legacy/plugins/maps/public/legacy_register_feature.ts delete mode 100644 x-pack/legacy/plugins/maps/public/register_feature.js delete mode 100644 x-pack/legacy/plugins/monitoring/public/register_feature.js create mode 100644 x-pack/legacy/plugins/monitoring/public/register_feature.ts delete mode 100644 x-pack/legacy/plugins/reporting/public/register_feature.js create mode 100644 x-pack/legacy/plugins/reporting/public/register_feature.ts diff --git a/src/legacy/core_plugins/kibana/public/home/index.ts b/src/legacy/core_plugins/kibana/public/home/index.ts index f02ec234e0a8..c4e58e1a5e1a 100644 --- a/src/legacy/core_plugins/kibana/public/home/index.ts +++ b/src/legacy/core_plugins/kibana/public/home/index.ts @@ -17,7 +17,6 @@ * under the License. */ -import { FeatureCatalogueRegistryProvider } from 'ui/registry/feature_catalogue'; import { npSetup, npStart } from 'ui/new_platform'; import chrome from 'ui/chrome'; import { HomePlugin, LegacyAngularInjectedDependencies } from './plugin'; @@ -44,26 +43,12 @@ async function getAngularDependencies(): Promise { const instance = new HomePlugin(); instance.setup(npSetup.core, { ...npSetup.plugins, __LEGACY: { metadata: npStart.core.injectedMetadata.getLegacyMetadata(), - getFeatureCatalogueEntries: async () => { - if (!copiedLegacyCatalogue) { - const injector = await chrome.dangerouslyGetActiveInjector(); - const Private = injector.get('Private'); - // Merge legacy registry with new registry - (Private(FeatureCatalogueRegistryProvider as any) as any).inTitleOrder.map( - npSetup.plugins.home.featureCatalogue.register - ); - copiedLegacyCatalogue = true; - } - return npStart.plugins.home.featureCatalogue.get(); - }, getAngularDependencies, }, }); diff --git a/src/legacy/core_plugins/kibana/public/home/kibana_services.ts b/src/legacy/core_plugins/kibana/public/home/kibana_services.ts index 90fb32a88d43..66c4d995e256 100644 --- a/src/legacy/core_plugins/kibana/public/home/kibana_services.ts +++ b/src/legacy/core_plugins/kibana/public/home/kibana_services.ts @@ -31,14 +31,13 @@ import { import { UiStatsMetricType } from '@kbn/analytics'; import { Environment, - FeatureCatalogueEntry, HomePublicPluginSetup, + FeatureCatalogueEntry, } from '../../../../../plugins/home/public'; import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public'; export interface HomeKibanaServices { indexPatternService: any; - getFeatureCatalogueEntries: () => Promise; metadata: { app: unknown; bundleId: string; @@ -58,6 +57,7 @@ export interface HomeKibanaServices { uiSettings: IUiSettingsClient; config: KibanaLegacySetup['config']; homeConfig: HomePublicPluginSetup['config']; + directories: readonly FeatureCatalogueEntry[]; http: HttpStart; savedObjectsClient: SavedObjectsClientContract; toastNotifications: NotificationsSetup['toasts']; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx b/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx index 8345491d9997..2149885f3ee1 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx +++ b/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx @@ -26,8 +26,7 @@ import { getServices } from '../kibana_services'; export const renderApp = async (element: HTMLElement) => { const homeTitle = i18n.translate('kbn.home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); - const { getFeatureCatalogueEntries, chrome } = getServices(); - const directories = await getFeatureCatalogueEntries(); + const { directories, chrome } = getServices(); chrome.setBreadcrumbs([{ text: homeTitle }]); render(, element); diff --git a/src/legacy/core_plugins/kibana/public/home/plugin.ts b/src/legacy/core_plugins/kibana/public/home/plugin.ts index 5802f33627fb..e530906d5698 100644 --- a/src/legacy/core_plugins/kibana/public/home/plugin.ts +++ b/src/legacy/core_plugins/kibana/public/home/plugin.ts @@ -25,9 +25,9 @@ import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public'; import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/public'; import { Environment, - FeatureCatalogueEntry, HomePublicPluginStart, HomePublicPluginSetup, + FeatureCatalogueEntry, } from '../../../../../plugins/home/public'; export interface LegacyAngularInjectedDependencies { @@ -55,7 +55,6 @@ export interface HomePluginSetupDependencies { devMode: boolean; uiSettings: { defaults: UiSettingsState; user?: UiSettingsState | undefined }; }; - getFeatureCatalogueEntries: () => Promise; getAngularDependencies: () => Promise; }; usageCollection: UsageCollectionSetup; @@ -67,6 +66,7 @@ export class HomePlugin implements Plugin { private dataStart: DataPublicPluginStart | null = null; private savedObjectsClient: any = null; private environment: Environment | null = null; + private directories: readonly FeatureCatalogueEntry[] | null = null; setup( core: CoreSetup, @@ -100,6 +100,7 @@ export class HomePlugin implements Plugin { environment: this.environment!, config: kibanaLegacy.config, homeConfig: home.config, + directories: this.directories!, ...angularDependencies, }); const { renderApp } = await import('./np_ready/application'); @@ -110,6 +111,7 @@ export class HomePlugin implements Plugin { start(core: CoreStart, { data, home }: HomePluginStartDependencies) { this.environment = home.environment.get(); + this.directories = home.featureCatalogue.get(); this.dataStart = data; this.savedObjectsClient = core.savedObjects.client; } diff --git a/src/legacy/core_plugins/kibana/public/management/index.js b/src/legacy/core_plugins/kibana/public/management/index.js index 1305310b6f61..6e5269e11652 100644 --- a/src/legacy/core_plugins/kibana/public/management/index.js +++ b/src/legacy/core_plugins/kibana/public/management/index.js @@ -18,7 +18,6 @@ */ import React from 'react'; -import { i18n } from '@kbn/i18n'; import { render, unmountComponentAtNode } from 'react-dom'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -30,10 +29,6 @@ import appTemplate from './app.html'; import landingTemplate from './landing.html'; import { management, MANAGEMENT_BREADCRUMB } from 'ui/management'; import { ManagementSidebarNav } from '../../../../../plugins/management/public'; -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; import { timefilter } from 'ui/timefilter'; import { EuiPageContent, @@ -170,19 +165,3 @@ uiModules.get('apps/management').directive('kbnManagementLanding', function(kbnV }, }; }); - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'stack-management', - title: i18n.translate('kbn.stackManagement.managementLabel', { - defaultMessage: 'Stack Management', - }), - description: i18n.translate('kbn.stackManagement.managementDescription', { - defaultMessage: 'Your center console for managing the Elastic Stack.', - }), - icon: 'managementApp', - path: '/app/kibana#/management', - showOnHomePage: false, - category: FeatureCatalogueCategory.ADMIN, - }; -}); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index.js index 8ab26f8c0d1c..310797a7f3a0 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index.js @@ -27,10 +27,6 @@ import indexTemplate from './index.html'; import indexPatternListTemplate from './list.html'; import { IndexPatternTable } from './index_pattern_table'; import { npStart } from 'ui/new_platform'; -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; import { i18n } from '@kbn/i18n'; import { I18nContext } from 'ui/i18n'; import { UICapabilitiesProvider } from 'ui/capabilities/react'; @@ -175,19 +171,3 @@ management.getSection('kibana').register('index_patterns', { order: 0, url: '#/management/kibana/index_patterns/', }); - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'index_patterns', - title: i18n.translate('kbn.management.indexPatternHeader', { - defaultMessage: 'Index Patterns', - }), - description: i18n.translate('kbn.management.indexPatternLabel', { - defaultMessage: 'Manage the index patterns that help retrieve your data from Elasticsearch.', - }), - icon: 'indexPatternApp', - path: '/app/kibana#/management/kibana/index_patterns', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }; -}); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/objects/index.js b/src/legacy/core_plugins/kibana/public/management/sections/objects/index.js index 7bd57e87bc5c..3965c42ac088 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/objects/index.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/objects/index.js @@ -23,10 +23,6 @@ import './_view'; import './_objects'; import 'ace'; import { uiModules } from 'ui/modules'; -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; // add the module deps to this module uiModules.get('apps/management'); @@ -38,20 +34,3 @@ management.getSection('kibana').register('objects', { order: 10, url: '#/management/kibana/objects', }); - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'saved_objects', - title: i18n.translate('kbn.management.objects.savedObjectsTitle', { - defaultMessage: 'Saved Objects', - }), - description: i18n.translate('kbn.management.objects.savedObjectsDescription', { - defaultMessage: - 'Import, export, and manage your saved searches, visualizations, and dashboards.', - }), - icon: 'savedObjectsApp', - path: '/app/kibana#/management/kibana/objects', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }; -}); diff --git a/src/legacy/core_plugins/kibana/public/management/sections/settings/index.js b/src/legacy/core_plugins/kibana/public/management/sections/settings/index.js index 6d8987b1a928..16d70a9f4ed5 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/settings/index.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/settings/index.js @@ -23,10 +23,6 @@ import { uiModules } from 'ui/modules'; import { capabilities } from 'ui/capabilities'; import { I18nContext } from 'ui/i18n'; import indexTemplate from './index.html'; -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; import React from 'react'; import { AdvancedSettings } from './advanced_settings'; @@ -83,19 +79,3 @@ management.getSection('kibana').register('settings', { order: 20, url: '#/management/kibana/settings', }); - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'advanced_settings', - title: i18n.translate('kbn.management.settings.advancedSettingsLabel', { - defaultMessage: 'Advanced Settings', - }), - description: i18n.translate('kbn.management.settings.advancedSettingsDescription', { - defaultMessage: 'Directly edit settings that control behavior in Kibana.', - }), - icon: 'advancedSettingsApp', - path: '/app/kibana#/management/kibana/settings', - showOnHomePage: false, - category: FeatureCatalogueCategory.ADMIN, - }; -}); diff --git a/src/legacy/core_plugins/management/public/legacy.ts b/src/legacy/core_plugins/management/public/legacy.ts index 7c17f0c6bddc..4481bad79c47 100644 --- a/src/legacy/core_plugins/management/public/legacy.ts +++ b/src/legacy/core_plugins/management/public/legacy.ts @@ -41,5 +41,5 @@ import { plugin } from '.'; const pluginInstance = plugin({} as PluginInitializerContext); -export const setup = pluginInstance.setup(npSetup.core, {}); +export const setup = pluginInstance.setup(npSetup.core, { home: npSetup.plugins.home }); export const start = pluginInstance.start(npStart.core, {}); diff --git a/src/legacy/core_plugins/management/public/np_ready/mocks.ts b/src/legacy/core_plugins/management/public/np_ready/mocks.ts index 13a0cf4c891a..5ed7c045d1f6 100644 --- a/src/legacy/core_plugins/management/public/np_ready/mocks.ts +++ b/src/legacy/core_plugins/management/public/np_ready/mocks.ts @@ -19,7 +19,12 @@ import { PluginInitializerContext } from 'src/core/public'; import { coreMock } from '../../../../../core/public/mocks'; -import { ManagementSetup, ManagementStart, ManagementPlugin } from './plugin'; +import { + ManagementSetup, + ManagementStart, + ManagementPlugin, + ManagementPluginSetupDependencies, +} from './plugin'; const createSetupContract = (): ManagementSetup => ({ indexPattern: { @@ -49,7 +54,13 @@ const createStartContract = (): ManagementStart => ({}); const createInstance = async () => { const plugin = new ManagementPlugin({} as PluginInitializerContext); - const setup = plugin.setup(coreMock.createSetup(), {}); + const setup = plugin.setup(coreMock.createSetup(), ({ + home: { + featureCatalogue: { + register: jest.fn(), + }, + }, + } as unknown) as ManagementPluginSetupDependencies); const doStart = () => plugin.start(coreMock.createStart(), {}); return { diff --git a/src/legacy/core_plugins/management/public/np_ready/plugin.ts b/src/legacy/core_plugins/management/public/np_ready/plugin.ts index 032a46439ba5..7dd2b23d4061 100644 --- a/src/legacy/core_plugins/management/public/np_ready/plugin.ts +++ b/src/legacy/core_plugins/management/public/np_ready/plugin.ts @@ -17,14 +17,16 @@ * under the License. */ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public'; +import { HomePublicPluginSetup } from 'src/plugins/home/public'; import { IndexPatternManagementService, IndexPatternManagementSetup } from './services'; import { SavedObjectsManagementService, SavedObjectsManagementServiceSetup, } from './services/saved_objects_management'; -// eslint-disable-next-line @typescript-eslint/no-empty-interface -interface ManagementPluginSetupDependencies {} +export interface ManagementPluginSetupDependencies { + home: HomePublicPluginSetup; +} // eslint-disable-next-line @typescript-eslint/no-empty-interface interface ManagementPluginStartDependencies {} @@ -50,10 +52,10 @@ export class ManagementPlugin constructor(initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup, deps: ManagementPluginSetupDependencies) { + public setup(core: CoreSetup, { home }: ManagementPluginSetupDependencies) { return { - indexPattern: this.indexPattern.setup({ httpClient: core.http }), - savedObjects: this.savedObjects.setup(), + indexPattern: this.indexPattern.setup({ httpClient: core.http, home }), + savedObjects: this.savedObjects.setup({ home }), }; } diff --git a/src/legacy/core_plugins/management/public/np_ready/services/index_pattern_management/index_pattern_management_service.ts b/src/legacy/core_plugins/management/public/np_ready/services/index_pattern_management/index_pattern_management_service.ts index b421024b60f4..2b6f008dd928 100644 --- a/src/legacy/core_plugins/management/public/np_ready/services/index_pattern_management/index_pattern_management_service.ts +++ b/src/legacy/core_plugins/management/public/np_ready/services/index_pattern_management/index_pattern_management_service.ts @@ -17,12 +17,18 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; +import { + FeatureCatalogueCategory, + HomePublicPluginSetup, +} from '../../../../../../../plugins/home/public'; import { HttpSetup } from '../../../../../../../core/public'; import { IndexPatternCreationManager, IndexPatternCreationConfig } from './creation'; import { IndexPatternListManager, IndexPatternListConfig } from './list'; interface SetupDependencies { httpClient: HttpSetup; + home: HomePublicPluginSetup; } /** @@ -31,13 +37,28 @@ interface SetupDependencies { * @internal */ export class IndexPatternManagementService { - public setup({ httpClient }: SetupDependencies) { + public setup({ httpClient, home }: SetupDependencies) { const creation = new IndexPatternCreationManager(httpClient); const list = new IndexPatternListManager(); creation.add(IndexPatternCreationConfig); list.add(IndexPatternListConfig); + home.featureCatalogue.register({ + id: 'index_patterns', + title: i18n.translate('management.indexPatternHeader', { + defaultMessage: 'Index Patterns', + }), + description: i18n.translate('management.indexPatternLabel', { + defaultMessage: + 'Manage the index patterns that help retrieve your data from Elasticsearch.', + }), + icon: 'indexPatternApp', + path: '/app/kibana#/management/kibana/index_patterns', + showOnHomePage: true, + category: FeatureCatalogueCategory.ADMIN, + }); + return { creation, list, diff --git a/src/legacy/core_plugins/management/public/np_ready/services/saved_objects_management/saved_objects_management_service.ts b/src/legacy/core_plugins/management/public/np_ready/services/saved_objects_management/saved_objects_management_service.ts index d5e90d12cccc..be102b2a4dce 100644 --- a/src/legacy/core_plugins/management/public/np_ready/services/saved_objects_management/saved_objects_management_service.ts +++ b/src/legacy/core_plugins/management/public/np_ready/services/saved_objects_management/saved_objects_management_service.ts @@ -16,10 +16,35 @@ * specific language governing permissions and limitations * under the License. */ + +import { i18n } from '@kbn/i18n'; +import { + FeatureCatalogueCategory, + HomePublicPluginSetup, +} from '../../../../../../../plugins/home/public'; import { SavedObjectsManagementActionRegistry } from './saved_objects_management_action_registry'; +interface SetupDependencies { + home: HomePublicPluginSetup; +} + export class SavedObjectsManagementService { - public setup() { + public setup({ home }: SetupDependencies) { + home.featureCatalogue.register({ + id: 'saved_objects', + title: i18n.translate('management.objects.savedObjectsTitle', { + defaultMessage: 'Saved Objects', + }), + description: i18n.translate('management.objects.savedObjectsDescription', { + defaultMessage: + 'Import, export, and manage your saved searches, visualizations, and dashboards.', + }), + icon: 'savedObjectsApp', + path: '/app/kibana#/management/kibana/objects', + showOnHomePage: true, + category: FeatureCatalogueCategory.ADMIN, + }); + return { registry: SavedObjectsManagementActionRegistry, }; diff --git a/src/legacy/core_plugins/timelion/public/register_feature.ts b/src/legacy/core_plugins/timelion/public/register_feature.ts deleted file mode 100644 index 7dd44b58bd1d..000000000000 --- a/src/legacy/core_plugins/timelion/public/register_feature.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { FeatureCatalogueCategory } from 'ui/registry/feature_catalogue'; -import { i18n } from '@kbn/i18n'; - -export const registerFeature = () => { - return { - id: 'timelion', - title: 'Timelion', - description: i18n.translate('timelion.registerFeatureDescription', { - defaultMessage: - 'Use an expression language to analyze time series data and visualize the results.', - }), - icon: 'timelionApp', - path: '/app/timelion', - showOnHomePage: false, - category: FeatureCatalogueCategory.DATA, - }; -}; diff --git a/src/legacy/ui/public/registry/feature_catalogue.d.ts b/src/legacy/ui/public/registry/feature_catalogue.d.ts deleted file mode 100644 index 031c3efa6c5a..000000000000 --- a/src/legacy/ui/public/registry/feature_catalogue.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { I18nServiceType } from '@kbn/i18n/angular'; - -export enum FeatureCatalogueCategory { - ADMIN = 'admin', - DATA = 'data', - OTHER = 'other', -} - -interface FeatureCatalogueObject { - id: string; - title: string; - description: string; - icon: string; - path: string; - showOnHomePage: boolean; - category: FeatureCatalogueCategory; -} - -type FeatureCatalogueRegistryFunction = (i18n: I18nServiceType) => FeatureCatalogueObject; - -export const FeatureCatalogueRegistryProvider: { - register: (fn: FeatureCatalogueRegistryFunction) => void; -}; diff --git a/src/legacy/ui/public/registry/feature_catalogue.js b/src/legacy/ui/public/registry/feature_catalogue.js deleted file mode 100644 index 23aaf2fb0a1d..000000000000 --- a/src/legacy/ui/public/registry/feature_catalogue.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { uiRegistry } from './_registry'; -import { capabilities } from '../capabilities'; -export { FeatureCatalogueCategory } from '../../../../plugins/home/public'; - -export const FeatureCatalogueRegistryProvider = uiRegistry({ - name: 'featureCatalogue', - index: ['id'], - group: ['category'], - order: ['title'], - filter: featureCatalogItem => { - const isDisabledViaCapabilities = capabilities.get().catalogue[featureCatalogItem.id] === false; - return !isDisabledViaCapabilities && Object.keys(featureCatalogItem).length > 0; - }, -}); diff --git a/src/legacy/ui/public/registry/feature_catalogue.test.js b/src/legacy/ui/public/registry/feature_catalogue.test.js deleted file mode 100644 index 15aed7814388..000000000000 --- a/src/legacy/ui/public/registry/feature_catalogue.test.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -jest.mock('ui/capabilities', () => ({ - capabilities: { - get: () => ({ - navLinks: {}, - management: {}, - catalogue: { - item1: true, - item2: false, - item3: true, - }, - }), - }, -})); -import { FeatureCatalogueCategory, FeatureCatalogueRegistryProvider } from './feature_catalogue'; - -describe('FeatureCatalogueRegistryProvider', () => { - beforeAll(() => { - FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'item1', - title: 'foo', - description: 'this is foo', - icon: 'savedObjectsApp', - path: '/app/kibana#/management/kibana/objects', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }; - }); - - FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'item2', - title: 'bar', - description: 'this is bar', - icon: 'savedObjectsApp', - path: '/app/kibana#/management/kibana/objects', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }; - }); - - // intentionally not listed in uiCapabilities.catalogue above - FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'item4', - title: 'secret', - description: 'this is a secret', - icon: 'savedObjectsApp', - path: '/app/kibana#/management/kibana/objects', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }; - }); - }); - - it('should not return items hidden by uiCapabilities', () => { - const mockPrivate = entityFn => entityFn(); - const mockInjector = () => null; - - // eslint-disable-next-line new-cap - const foo = FeatureCatalogueRegistryProvider(mockPrivate, mockInjector).inTitleOrder; - expect(foo).toEqual([ - { - id: 'item1', - title: 'foo', - description: 'this is foo', - icon: 'savedObjectsApp', - path: '/app/kibana#/management/kibana/objects', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }, - { - id: 'item4', - title: 'secret', - description: 'this is a secret', - icon: 'savedObjectsApp', - path: '/app/kibana#/management/kibana/objects', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }, - ]); - }); -}); diff --git a/src/plugins/advanced_settings/kibana.json b/src/plugins/advanced_settings/kibana.json index 5fc1e916ae45..bafb2caba32b 100644 --- a/src/plugins/advanced_settings/kibana.json +++ b/src/plugins/advanced_settings/kibana.json @@ -3,5 +3,5 @@ "version": "kibana", "server": false, "ui": true, - "requiredPlugins": [] + "requiredPlugins": ["home"] } diff --git a/src/plugins/advanced_settings/public/plugin.ts b/src/plugins/advanced_settings/public/plugin.ts index 692e515ca4e5..bffd5a515761 100644 --- a/src/plugins/advanced_settings/public/plugin.ts +++ b/src/plugins/advanced_settings/public/plugin.ts @@ -17,15 +17,31 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; import { ComponentRegistry } from './component_registry'; import { AdvancedSettingsSetup, AdvancedSettingsStart } from './types'; +import { FeatureCatalogueCategory, HomePublicPluginSetup } from '../../home/public'; const component = new ComponentRegistry(); export class AdvancedSettingsPlugin implements Plugin { - public setup(core: CoreSetup) { + public setup(core: CoreSetup, { home }: { home: HomePublicPluginSetup }) { + home.featureCatalogue.register({ + id: 'advanced_settings', + title: i18n.translate('advancedSettings.advancedSettingsLabel', { + defaultMessage: 'Advanced Settings', + }), + description: i18n.translate('advancedSettings.advancedSettingsDescription', { + defaultMessage: 'Directly edit settings that control behavior in Kibana.', + }), + icon: 'advancedSettingsApp', + path: '/app/kibana#/management/kibana/settings', + showOnHomePage: false, + category: FeatureCatalogueCategory.ADMIN, + }); + return { component: component.setup, }; diff --git a/src/plugins/management/kibana.json b/src/plugins/management/kibana.json index 4bbf2039c8f3..1789b7cd5ddb 100644 --- a/src/plugins/management/kibana.json +++ b/src/plugins/management/kibana.json @@ -3,5 +3,5 @@ "version": "kibana", "server": false, "ui": true, - "requiredPlugins": ["kibanaLegacy"] + "requiredPlugins": ["kibanaLegacy", "home"] } diff --git a/src/plugins/management/public/plugin.ts b/src/plugins/management/public/plugin.ts index ce6959ec3134..df2398412dac 100644 --- a/src/plugins/management/public/plugin.ts +++ b/src/plugins/management/public/plugin.ts @@ -17,10 +17,12 @@ * under the License. */ +import { i18n } from '@kbn/i18n'; import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; import { ManagementSetup, ManagementStart } from './types'; import { ManagementService } from './management_service'; import { KibanaLegacySetup } from '../../kibana_legacy/public'; +import { FeatureCatalogueCategory, HomePublicPluginSetup } from '../../home/public'; // @ts-ignore import { LegacyManagementAdapter } from './legacy'; @@ -28,7 +30,24 @@ export class ManagementPlugin implements Plugin - i18n.translate('xpack.canvas.appDescription', { - defaultMessage: 'Showcase your data in a pixel-perfect way.', - }); diff --git a/x-pack/legacy/plugins/canvas/index.js b/x-pack/legacy/plugins/canvas/index.js index ebd4f35db817..b357ec9c0b61 100644 --- a/x-pack/legacy/plugins/canvas/index.js +++ b/x-pack/legacy/plugins/canvas/index.js @@ -36,7 +36,7 @@ export function canvas(kibana) { // window.onerror override 'plugins/canvas/lib/window_error_handler.js', ], - home: ['plugins/canvas/register_feature'], + home: ['plugins/canvas/legacy_register_feature'], mappings, migrations, savedObjectsManagement: { diff --git a/x-pack/legacy/plugins/canvas/public/feature_catalogue_entry.ts b/x-pack/legacy/plugins/canvas/public/feature_catalogue_entry.ts new file mode 100644 index 000000000000..f610bd029983 --- /dev/null +++ b/x-pack/legacy/plugins/canvas/public/feature_catalogue_entry.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; + +export const featureCatalogueEntry = { + id: 'canvas', + title: 'Canvas', + description: i18n.translate('xpack.canvas.appDescription', { + defaultMessage: 'Showcase your data in a pixel-perfect way.', + }), + icon: 'canvasApp', + path: '/app/canvas', + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, +}; diff --git a/x-pack/legacy/plugins/canvas/public/legacy.ts b/x-pack/legacy/plugins/canvas/public/legacy.ts index cbd2aa54627e..c16bc124747c 100644 --- a/x-pack/legacy/plugins/canvas/public/legacy.ts +++ b/x-pack/legacy/plugins/canvas/public/legacy.ts @@ -22,7 +22,9 @@ const shimCoreSetup = { const shimCoreStart = { ...npStart.core, }; -const shimSetupPlugins = {}; +const shimSetupPlugins = { + home: npSetup.plugins.home, +}; const shimStartPlugins: CanvasStartDeps = { ...npStart.plugins, diff --git a/x-pack/legacy/plugins/logstash/public/lib/register_home_feature/index.js b/x-pack/legacy/plugins/canvas/public/legacy_register_feature.ts old mode 100755 new mode 100644 similarity index 53% rename from x-pack/legacy/plugins/logstash/public/lib/register_home_feature/index.js rename to x-pack/legacy/plugins/canvas/public/legacy_register_feature.ts index 72e3f201bd4c..00f788f267d4 --- a/x-pack/legacy/plugins/logstash/public/lib/register_home_feature/index.js +++ b/x-pack/legacy/plugins/canvas/public/legacy_register_feature.ts @@ -4,4 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import './register_home_feature'; +import { npSetup } from 'ui/new_platform'; +import { featureCatalogueEntry } from './feature_catalogue_entry'; + +const { + plugins: { home }, +} = npSetup; + +home.featureCatalogue.register(featureCatalogueEntry); diff --git a/x-pack/legacy/plugins/canvas/public/plugin.tsx b/x-pack/legacy/plugins/canvas/public/plugin.tsx index 7928d4606790..a24fd758808b 100644 --- a/x-pack/legacy/plugins/canvas/public/plugin.tsx +++ b/x-pack/legacy/plugins/canvas/public/plugin.tsx @@ -10,6 +10,7 @@ import { Chrome } from 'ui/chrome'; import { i18n } from '@kbn/i18n'; import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { CoreSetup, CoreStart, Plugin } from '../../../../../src/core/public'; +import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; // @ts-ignore: Untyped Local import { CapabilitiesStrings } from '../i18n'; const { ReadOnlyBadge: strings } = CapabilitiesStrings; @@ -27,6 +28,7 @@ import { getDocumentationLinks } from './lib/documentation_links'; // @ts-ignore: untyped local import { initClipboard } from './lib/clipboard'; +import { featureCatalogueEntry } from './feature_catalogue_entry'; export { CoreStart }; /** @@ -34,7 +36,9 @@ export { CoreStart }; * @internal */ // This interface will be built out as we require other plugins for setup -export interface CanvasSetupDeps {} // eslint-disable-line @typescript-eslint/no-empty-interface +export interface CanvasSetupDeps { + home: HomePublicPluginSetup; +} export interface CanvasStartDeps { __LEGACY: { absoluteToParsedUrl: (url: string, basePath: string) => any; @@ -79,6 +83,9 @@ export class CanvasPlugin return renderApp(coreStart, depsStart, params, canvasStore); }, }); + + plugins.home.featureCatalogue.register(featureCatalogueEntry); + return {}; } diff --git a/x-pack/legacy/plugins/canvas/public/register_feature.js b/x-pack/legacy/plugins/canvas/public/register_feature.js deleted file mode 100644 index 8d78498de34b..000000000000 --- a/x-pack/legacy/plugins/canvas/public/register_feature.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; - -import { getAppDescription } from '../i18n'; - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'canvas', - title: 'Canvas', - description: getAppDescription(), - icon: 'canvasApp', - path: '/app/canvas', - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, - }; -}); diff --git a/x-pack/legacy/plugins/grokdebugger/public/register_feature.js b/x-pack/legacy/plugins/grokdebugger/public/register_feature.js deleted file mode 100644 index 18021ed0f752..000000000000 --- a/x-pack/legacy/plugins/grokdebugger/public/register_feature.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; - -import { i18n } from '@kbn/i18n'; - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'grokdebugger', - title: i18n.translate('xpack.grokDebugger.registryProviderTitle', { - defaultMessage: '{grokLogParsingTool} Debugger', - values: { - grokLogParsingTool: 'Grok', - }, - }), - description: i18n.translate('xpack.grokDebugger.registryProviderDescription', { - defaultMessage: - 'Simulate and debug {grokLogParsingTool} patterns for data transformation on ingestion.', - values: { - grokLogParsingTool: 'grok', - }, - }), - icon: 'grokApp', - path: '/app/kibana#/dev_tools/grokdebugger', - showOnHomePage: false, - category: FeatureCatalogueCategory.ADMIN, - }; -}); diff --git a/x-pack/legacy/plugins/grokdebugger/public/register_feature.ts b/x-pack/legacy/plugins/grokdebugger/public/register_feature.ts new file mode 100644 index 000000000000..97d2e53ce783 --- /dev/null +++ b/x-pack/legacy/plugins/grokdebugger/public/register_feature.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; +import { npSetup } from 'ui/new_platform'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; + +const { + plugins: { home }, +} = npSetup; + +home.featureCatalogue.register({ + id: 'grokdebugger', + title: i18n.translate('xpack.grokDebugger.registryProviderTitle', { + defaultMessage: '{grokLogParsingTool} Debugger', + values: { + grokLogParsingTool: 'Grok', + }, + }), + description: i18n.translate('xpack.grokDebugger.registryProviderDescription', { + defaultMessage: + 'Simulate and debug {grokLogParsingTool} patterns for data transformation on ingestion.', + values: { + grokLogParsingTool: 'grok', + }, + }), + icon: 'grokApp', + path: '/app/kibana#/dev_tools/grokdebugger', + showOnHomePage: false, + category: FeatureCatalogueCategory.ADMIN, +}); diff --git a/x-pack/legacy/plugins/infra/index.ts b/x-pack/legacy/plugins/infra/index.ts index d9abadcb5125..4ab2cde08249 100644 --- a/x-pack/legacy/plugins/infra/index.ts +++ b/x-pack/legacy/plugins/infra/index.ts @@ -42,7 +42,7 @@ export function infra(kibana: any) { url: `/app/${APP_ID}#/infrastructure`, }, styleSheetPaths: resolve(__dirname, 'public/index.scss'), - home: ['plugins/infra/register_feature'], + home: ['plugins/infra/legacy_register_feature'], links: [ { description: i18n.translate('xpack.infra.linkInfrastructureDescription', { diff --git a/x-pack/legacy/plugins/infra/public/app.ts b/x-pack/legacy/plugins/infra/public/app.ts index 4b14e168eb76..7a13d3a59cc0 100644 --- a/x-pack/legacy/plugins/infra/public/app.ts +++ b/x-pack/legacy/plugins/infra/public/app.ts @@ -9,7 +9,7 @@ // actually mount and run our application. Once in the NP this won't be an issue // as the NP will look for an export named "plugin" and run that from the index file. -import { npStart } from 'ui/new_platform'; +import { npStart, npSetup } from 'ui/new_platform'; import { PluginInitializerContext } from 'kibana/public'; import chrome from 'ui/chrome'; // @ts-ignore @@ -50,5 +50,7 @@ const checkForRoot = () => { }; checkForRoot().then(() => { - plugin({} as PluginInitializerContext).start(core, plugins, __LEGACY); + const pluginInstance = plugin({} as PluginInitializerContext); + pluginInstance.setup(npSetup.core, { home: npSetup.plugins.home }); + pluginInstance.start(core, plugins, __LEGACY); }); diff --git a/x-pack/legacy/plugins/infra/public/feature_catalogue_entry.ts b/x-pack/legacy/plugins/infra/public/feature_catalogue_entry.ts new file mode 100644 index 000000000000..6442083234f2 --- /dev/null +++ b/x-pack/legacy/plugins/infra/public/feature_catalogue_entry.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; + +const APP_ID = 'infra'; + +export const featureCatalogueEntries = { + metrics: { + id: 'infraops', + title: i18n.translate('xpack.infra.registerFeatures.infraOpsTitle', { + defaultMessage: 'Metrics', + }), + description: i18n.translate('xpack.infra.registerFeatures.infraOpsDescription', { + defaultMessage: + 'Explore infrastructure metrics and logs for common servers, containers, and services.', + }), + icon: 'metricsApp', + path: `/app/${APP_ID}#infrastructure`, + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, + }, + logs: { + id: 'infralogging', + title: i18n.translate('xpack.infra.registerFeatures.logsTitle', { + defaultMessage: 'Logs', + }), + description: i18n.translate('xpack.infra.registerFeatures.logsDescription', { + defaultMessage: + 'Stream logs in real time or scroll through historical views in a console-like experience.', + }), + icon: 'logsApp', + path: `/app/${APP_ID}#logs`, + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, + }, +}; diff --git a/x-pack/legacy/plugins/infra/public/legacy_register_feature.ts b/x-pack/legacy/plugins/infra/public/legacy_register_feature.ts new file mode 100644 index 000000000000..7b10a1e062f7 --- /dev/null +++ b/x-pack/legacy/plugins/infra/public/legacy_register_feature.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { npSetup } from 'ui/new_platform'; +import { featureCatalogueEntries } from './feature_catalogue_entry'; + +const { + plugins: { home }, +} = npSetup; + +home.featureCatalogue.register(featureCatalogueEntries.metrics); +home.featureCatalogue.register(featureCatalogueEntries.logs); diff --git a/x-pack/legacy/plugins/infra/public/new_platform_plugin.ts b/x-pack/legacy/plugins/infra/public/new_platform_plugin.ts index 78594afcc8ad..f438b6579465 100644 --- a/x-pack/legacy/plugins/infra/public/new_platform_plugin.ts +++ b/x-pack/legacy/plugins/infra/public/new_platform_plugin.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { CoreStart, PluginInitializerContext } from 'kibana/public'; +import { CoreStart, CoreSetup, PluginInitializerContext } from 'kibana/public'; import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'; import ApolloClient from 'apollo-client'; import { ApolloLink } from 'apollo-link'; @@ -13,12 +13,23 @@ import { startApp } from './apps/start_app'; import { InfraFrontendLibs } from './lib/lib'; import introspectionQueryResultData from './graphql/introspection.json'; import { InfraKibanaObservableApiAdapter } from './lib/adapters/observable_api/kibana_observable_api'; +import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; +import { featureCatalogueEntries } from './feature_catalogue_entry'; type ClientPlugins = any; type LegacyDeps = any; +interface InfraPluginSetupDependencies { + home: HomePublicPluginSetup; +} export class Plugin { constructor(context: PluginInitializerContext) {} + + setup(core: CoreSetup, { home }: InfraPluginSetupDependencies) { + home.featureCatalogue.register(featureCatalogueEntries.metrics); + home.featureCatalogue.register(featureCatalogueEntries.logs); + } + start(core: CoreStart, plugins: ClientPlugins, __LEGACY: LegacyDeps) { startApp(this.composeLibs(core, plugins, __LEGACY), core, plugins); } diff --git a/x-pack/legacy/plugins/infra/public/register_feature.ts b/x-pack/legacy/plugins/infra/public/register_feature.ts deleted file mode 100644 index bf56db77e360..000000000000 --- a/x-pack/legacy/plugins/infra/public/register_feature.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { I18nServiceType } from '@kbn/i18n/angular'; -import { - FeatureCatalogueCategory, - FeatureCatalogueRegistryProvider, -} from 'ui/registry/feature_catalogue'; - -const APP_ID = 'infra'; - -FeatureCatalogueRegistryProvider.register((i18n: I18nServiceType) => ({ - id: 'infraops', - title: i18n('xpack.infra.registerFeatures.infraOpsTitle', { - defaultMessage: 'Metrics', - }), - description: i18n('xpack.infra.registerFeatures.infraOpsDescription', { - defaultMessage: - 'Explore infrastructure metrics and logs for common servers, containers, and services.', - }), - icon: 'metricsApp', - path: `/app/${APP_ID}#infrastructure`, - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, -})); - -FeatureCatalogueRegistryProvider.register((i18n: I18nServiceType) => ({ - id: 'infralogging', - title: i18n('xpack.infra.registerFeatures.logsTitle', { - defaultMessage: 'Logs', - }), - description: i18n('xpack.infra.registerFeatures.logsDescription', { - defaultMessage: - 'Stream logs in real time or scroll through historical views in a console-like experience.', - }), - icon: 'logsApp', - path: `/app/${APP_ID}#logs`, - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, -})); diff --git a/x-pack/legacy/plugins/logstash/public/lib/register_home_feature/register_home_feature.js b/x-pack/legacy/plugins/logstash/public/lib/register_home_feature.ts old mode 100755 new mode 100644 similarity index 63% rename from x-pack/legacy/plugins/logstash/public/lib/register_home_feature/register_home_feature.js rename to x-pack/legacy/plugins/logstash/public/lib/register_home_feature.ts index ee26cea54f97..e943656120d5 --- a/x-pack/legacy/plugins/logstash/public/lib/register_home_feature/register_home_feature.js +++ b/x-pack/legacy/plugins/logstash/public/lib/register_home_feature.ts @@ -4,20 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; - import { i18n } from '@kbn/i18n'; +import { npSetup } from 'ui/new_platform'; +// @ts-ignore +import { xpackInfo } from 'plugins/xpack_main/services/xpack_info'; +import { FeatureCatalogueCategory } from '../../../../../../src/plugins/home/public'; +// @ts-ignore +import { PLUGIN } from '../../common/constants'; + +const { + plugins: { home }, +} = npSetup; -FeatureCatalogueRegistryProvider.register($injector => { - const licenseService = $injector.get('logstashLicenseService'); - if (!licenseService.enableLinks) { - return; - } +const enableLinks = Boolean(xpackInfo.get(`features.${PLUGIN.ID}.enableLinks`)); - return { +if (enableLinks) { + home.featureCatalogue.register({ id: 'management_logstash', title: i18n.translate('xpack.logstash.homeFeature.logstashPipelinesTitle', { defaultMessage: 'Logstash Pipelines', @@ -29,5 +31,5 @@ FeatureCatalogueRegistryProvider.register($injector => { path: '/app/kibana#/management/logstash/pipelines', showOnHomePage: true, category: FeatureCatalogueCategory.ADMIN, - }; -}); + }); +} diff --git a/x-pack/legacy/plugins/maps/common/constants.js b/x-pack/legacy/plugins/maps/common/constants.ts similarity index 98% rename from x-pack/legacy/plugins/maps/common/constants.js rename to x-pack/legacy/plugins/maps/common/constants.ts index 2570341aa575..ab9a696fa3a1 100644 --- a/x-pack/legacy/plugins/maps/common/constants.js +++ b/x-pack/legacy/plugins/maps/common/constants.ts @@ -33,7 +33,7 @@ export const INDEX_SETTINGS_API_PATH = `${GIS_API_PATH}/indexSettings`; export const MAP_BASE_URL = `/${MAP_APP_PATH}#/${MAP_SAVED_OBJECT_TYPE}`; -export function createMapPath(id) { +export function createMapPath(id: string) { return `${MAP_BASE_URL}/${id}`; } diff --git a/x-pack/legacy/plugins/maps/common/i18n_getters.js b/x-pack/legacy/plugins/maps/common/i18n_getters.ts similarity index 90% rename from x-pack/legacy/plugins/maps/common/i18n_getters.js rename to x-pack/legacy/plugins/maps/common/i18n_getters.ts index 578d0cd4780e..0008a119f1c7 100644 --- a/x-pack/legacy/plugins/maps/common/i18n_getters.js +++ b/x-pack/legacy/plugins/maps/common/i18n_getters.ts @@ -6,6 +6,7 @@ import { i18n } from '@kbn/i18n'; +import { $Values } from '@kbn/utility-types'; import { ES_SPATIAL_RELATIONS } from './constants'; export function getAppTitle() { @@ -26,7 +27,7 @@ export function getUrlLabel() { }); } -export function getEsSpatialRelationLabel(spatialRelation) { +export function getEsSpatialRelationLabel(spatialRelation: $Values) { switch (spatialRelation) { case ES_SPATIAL_RELATIONS.INTERSECTS: return i18n.translate('xpack.maps.common.esSpatialRelation.intersectsLabel', { @@ -40,6 +41,7 @@ export function getEsSpatialRelationLabel(spatialRelation) { return i18n.translate('xpack.maps.common.esSpatialRelation.withinLabel', { defaultMessage: 'within', }); + // @ts-ignore case ES_SPATIAL_RELATIONS.CONTAINS: return i18n.translate('xpack.maps.common.esSpatialRelation.containsLabel', { defaultMessage: 'contains', diff --git a/x-pack/legacy/plugins/maps/index.js b/x-pack/legacy/plugins/maps/index.js index 4f679905fc35..247dc8115c5c 100644 --- a/x-pack/legacy/plugins/maps/index.js +++ b/x-pack/legacy/plugins/maps/index.js @@ -54,7 +54,7 @@ export function maps(kibana) { }, embeddableFactories: ['plugins/maps/embeddable/map_embeddable_factory'], inspectorViews: ['plugins/maps/inspector/views/register_views'], - home: ['plugins/maps/register_feature'], + home: ['plugins/maps/legacy_register_feature'], styleSheetPaths: `${__dirname}/public/index.scss`, savedObjectSchemas: { 'maps-telemetry': { diff --git a/x-pack/legacy/plugins/maps/public/feature_catalogue_entry.ts b/x-pack/legacy/plugins/maps/public/feature_catalogue_entry.ts new file mode 100644 index 000000000000..fdda76b4e121 --- /dev/null +++ b/x-pack/legacy/plugins/maps/public/feature_catalogue_entry.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { i18n } from '@kbn/i18n'; +import { APP_ID, APP_ICON } from '../common/constants'; +import { getAppTitle } from '../common/i18n_getters'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; + +export const featureCatalogueEntry = { + id: APP_ID, + title: getAppTitle(), + description: i18n.translate('xpack.maps.feature.appDescription', { + defaultMessage: 'Explore geospatial data from Elasticsearch and the Elastic Maps Service', + }), + icon: APP_ICON, + path: '/app/maps', + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, +}; diff --git a/x-pack/legacy/plugins/maps/public/legacy_register_feature.ts b/x-pack/legacy/plugins/maps/public/legacy_register_feature.ts new file mode 100644 index 000000000000..00f788f267d4 --- /dev/null +++ b/x-pack/legacy/plugins/maps/public/legacy_register_feature.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { npSetup } from 'ui/new_platform'; +import { featureCatalogueEntry } from './feature_catalogue_entry'; + +const { + plugins: { home }, +} = npSetup; + +home.featureCatalogue.register(featureCatalogueEntry); diff --git a/x-pack/legacy/plugins/maps/public/plugin.ts b/x-pack/legacy/plugins/maps/public/plugin.ts index e5f765a11d21..e2af53d59671 100644 --- a/x-pack/legacy/plugins/maps/public/plugin.ts +++ b/x-pack/legacy/plugins/maps/public/plugin.ts @@ -11,6 +11,9 @@ import { wrapInI18nContext } from 'ui/i18n'; import { MapListing } from './components/map_listing'; // @ts-ignore import { setLicenseId, setInspector } from './kibana_services'; +import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; +import { LicensingPluginSetup } from '../../../../plugins/licensing/public'; +import { featureCatalogueEntry } from './feature_catalogue_entry'; /** * These are the interfaces with your public contracts. You should export these @@ -20,14 +23,20 @@ import { setLicenseId, setInspector } from './kibana_services'; export type MapsPluginSetup = ReturnType; export type MapsPluginStart = ReturnType; +interface MapsPluginSetupDependencies { + __LEGACY: any; + np: { + licensing?: LicensingPluginSetup; + home: HomePublicPluginSetup; + }; +} + /** @internal */ export class MapsPlugin implements Plugin { - public setup(core: any, plugins: any) { - const { - __LEGACY: { uiModules }, - np: { licensing }, - } = plugins; - + public setup( + core: any, + { __LEGACY: { uiModules }, np: { licensing, home } }: MapsPluginSetupDependencies + ) { uiModules .get('app/maps', ['ngRoute', 'react']) .directive('mapListing', function(reactDirective: any) { @@ -35,8 +44,10 @@ export class MapsPlugin implements Plugin { }); if (licensing) { - licensing.license$.subscribe(({ uid }: { uid: string }) => setLicenseId(uid)); + licensing.license$.subscribe(({ uid }) => setLicenseId(uid)); } + + home.featureCatalogue.register(featureCatalogueEntry); } public start(core: CoreStart, plugins: any) { diff --git a/x-pack/legacy/plugins/maps/public/register_feature.js b/x-pack/legacy/plugins/maps/public/register_feature.js deleted file mode 100644 index afd7fb061500..000000000000 --- a/x-pack/legacy/plugins/maps/public/register_feature.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; -import { i18n } from '@kbn/i18n'; -import { APP_ID, APP_ICON } from '../common/constants'; -import { getAppTitle } from '../common/i18n_getters'; - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: APP_ID, - title: getAppTitle(), - description: i18n.translate('xpack.maps.feature.appDescription', { - defaultMessage: 'Explore geospatial data from Elasticsearch and the Elastic Maps Service', - }), - icon: APP_ICON, - path: '/app/maps', - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, - }; -}); diff --git a/x-pack/legacy/plugins/monitoring/public/register_feature.js b/x-pack/legacy/plugins/monitoring/public/register_feature.js deleted file mode 100644 index f275662bfb07..000000000000 --- a/x-pack/legacy/plugins/monitoring/public/register_feature.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import chrome from 'ui/chrome'; -import { i18n } from '@kbn/i18n'; -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; - -if (chrome.getInjected('monitoringUiEnabled')) { - FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'monitoring', - title: i18n.translate('xpack.monitoring.monitoringTitle', { - defaultMessage: 'Monitoring', - }), - description: i18n.translate('xpack.monitoring.monitoringDescription', { - defaultMessage: 'Track the real-time health and performance of your Elastic Stack.', - }), - icon: 'monitoringApp', - path: '/app/monitoring', - showOnHomePage: true, - category: FeatureCatalogueCategory.ADMIN, - }; - }); -} diff --git a/x-pack/legacy/plugins/monitoring/public/register_feature.ts b/x-pack/legacy/plugins/monitoring/public/register_feature.ts new file mode 100644 index 000000000000..9b72e01a1939 --- /dev/null +++ b/x-pack/legacy/plugins/monitoring/public/register_feature.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; +import chrome from 'ui/chrome'; +import { npSetup } from 'ui/new_platform'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; + +const { + plugins: { home }, +} = npSetup; + +if (chrome.getInjected('monitoringUiEnabled')) { + home.featureCatalogue.register({ + id: 'monitoring', + title: i18n.translate('xpack.monitoring.monitoringTitle', { + defaultMessage: 'Monitoring', + }), + description: i18n.translate('xpack.monitoring.monitoringDescription', { + defaultMessage: 'Track the real-time health and performance of your Elastic Stack.', + }), + icon: 'monitoringApp', + path: '/app/monitoring', + showOnHomePage: true, + category: FeatureCatalogueCategory.ADMIN, + }); +} diff --git a/x-pack/legacy/plugins/reporting/public/register_feature.js b/x-pack/legacy/plugins/reporting/public/register_feature.js deleted file mode 100644 index 98de06fa16e3..000000000000 --- a/x-pack/legacy/plugins/reporting/public/register_feature.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { - FeatureCatalogueRegistryProvider, - FeatureCatalogueCategory, -} from 'ui/registry/feature_catalogue'; - -import { i18n } from '@kbn/i18n'; - -FeatureCatalogueRegistryProvider.register(() => { - return { - id: 'reporting', - title: i18n.translate('xpack.reporting.registerFeature.reportingTitle', { - defaultMessage: 'Reporting', - }), - description: i18n.translate('xpack.reporting.registerFeature.reportingDescription', { - defaultMessage: 'Manage your reports generated from Discover, Visualize, and Dashboard.', - }), - icon: 'reportingApp', - path: '/app/kibana#/management/kibana/reporting', - showOnHomePage: false, - category: FeatureCatalogueCategory.ADMIN, - }; -}); diff --git a/x-pack/legacy/plugins/reporting/public/register_feature.ts b/x-pack/legacy/plugins/reporting/public/register_feature.ts new file mode 100644 index 000000000000..4e8d32facfce --- /dev/null +++ b/x-pack/legacy/plugins/reporting/public/register_feature.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; +import { npSetup } from 'ui/new_platform'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; + +const { + plugins: { home }, +} = npSetup; + +home.featureCatalogue.register({ + id: 'reporting', + title: i18n.translate('xpack.reporting.registerFeature.reportingTitle', { + defaultMessage: 'Reporting', + }), + description: i18n.translate('xpack.reporting.registerFeature.reportingDescription', { + defaultMessage: 'Manage your reports generated from Discover, Visualize, and Dashboard.', + }), + icon: 'reportingApp', + path: '/app/kibana#/management/kibana/reporting', + showOnHomePage: false, + category: FeatureCatalogueCategory.ADMIN, +}); diff --git a/x-pack/legacy/plugins/uptime/public/register_feature.ts b/x-pack/legacy/plugins/uptime/public/register_feature.ts index 885d4f6e1310..2f83fa33ba4b 100644 --- a/x-pack/legacy/plugins/uptime/public/register_feature.ts +++ b/x-pack/legacy/plugins/uptime/public/register_feature.ts @@ -5,12 +5,14 @@ */ import { i18n } from '@kbn/i18n'; -import { - FeatureCatalogueCategory, - FeatureCatalogueRegistryProvider, -} from 'ui/registry/feature_catalogue'; +import { npSetup } from 'ui/new_platform'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; -FeatureCatalogueRegistryProvider.register(() => ({ +const { + plugins: { home }, +} = npSetup; + +home.featureCatalogue.register({ id: 'uptime', title: i18n.translate('xpack.uptime.uptimeFeatureCatalogueTitle', { defaultMessage: 'Uptime' }), description: i18n.translate('xpack.uptime.featureCatalogueDescription', { @@ -20,4 +22,4 @@ FeatureCatalogueRegistryProvider.register(() => ({ path: `uptime#/`, showOnHomePage: true, category: FeatureCatalogueCategory.DATA, -})); +}); diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 1c2a0fc3d5ac..5d45a275ede1 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1436,8 +1436,8 @@ "kbn.management.indexPattern.confirmOverwriteTitle": "{type} を上書きしますか?", "kbn.management.indexPattern.sectionsHeader": "インデックスパターン", "kbn.management.indexPattern.titleExistsLabel": "「{title}」というタイトルのインデックスパターンが既に存在します。", - "kbn.management.indexPatternHeader": "インデックスパターン", - "kbn.management.indexPatternLabel": "Elasticsearch からのデータの取得に役立つインデックスパターンを管理します。", + "management.indexPatternHeader": "インデックスパターン", + "management.indexPatternLabel": "Elasticsearch からのデータの取得に役立つインデックスパターンを管理します。", "kbn.management.indexPatternList.createButton.betaLabel": "ベータ", "kbn.management.indexPatternPrompt.exampleOne": "チャートを作成したりコンテンツを素早くクエリできるように log-west-001 という名前の単一のデータソースをインデックスします。", "kbn.management.indexPatternPrompt.exampleOneTitle": "単一のデータソース", @@ -1556,9 +1556,9 @@ "kbn.management.objects.objectsTable.table.typeFilterName": "タイプ", "kbn.management.objects.objectsTable.unableFindSavedObjectsNotificationMessage": "保存されたオブジェクトが見つかりません", "kbn.management.objects.parsingFieldErrorMessage": "{fieldName} をインデックスパターン {indexName} 用にパース中にエラーが発生しました: {errorMessage}", - "kbn.management.objects.savedObjectsDescription": "保存された検索、ビジュアライゼーション、ダッシュボードのインポート、エクスポート、管理を行います", + "management.objects.savedObjectsDescription": "保存された検索、ビジュアライゼーション、ダッシュボードのインポート、エクスポート、管理を行います", "kbn.management.objects.savedObjectsSectionLabel": "保存されたオブジェクト", - "kbn.management.objects.savedObjectsTitle": "保存されたオブジェクト", + "management.objects.savedObjectsTitle": "保存されたオブジェクト", "kbn.management.objects.view.cancelButtonAriaLabel": "キャンセル", "kbn.management.objects.view.cancelButtonLabel": "キャンセル", "kbn.management.objects.view.deleteItemButtonLabel": "{title} を削除", @@ -1576,8 +1576,8 @@ "kbn.management.objects.view.viewItemTitle": "{title} を表示", "kbn.management.savedObjects.editBreadcrumb": "{savedObjectType} を編集", "kbn.management.savedObjects.indexBreadcrumb": "保存されたオブジェクト", - "kbn.management.settings.advancedSettingsDescription": "Kibana の動作を管理する設定を直接変更します。", - "kbn.management.settings.advancedSettingsLabel": "高度な設定", + "advancedSettings.advancedSettingsDescription": "Kibana の動作を管理する設定を直接変更します。", + "advancedSettings.advancedSettingsLabel": "高度な設定", "kbn.management.settings.breadcrumb": "高度な設定", "kbn.management.settings.callOutCautionDescription": "これらの設定は非常に上級ユーザー向けなのでご注意ください。ここでの変更は Kibana の重要な部分に不具合を生じさせる可能性があります。これらの設定はドキュメントに記載されていなかったり、サポートされていなかったり、実験的であったりします。フィールドにデフォルトの値が設定されている場合、そのフィールドを未入力のままにするとデフォルトに戻り、他の構成により利用できない可能性があります。カスタム設定を削除すると、Kibana の構成から永久に削除されます。", "kbn.management.settings.callOutCautionTitle": "注意:不具合が起こる可能性があります", @@ -2792,7 +2792,6 @@ "timelion.noFunctionErrorMessage": "そのような関数はありません: {name}", "timelion.panels.noRenderFunctionErrorMessage": "パネルにはレンダリング関数が必要です", "timelion.panels.timechart.unknownIntervalErrorMessage": "不明な間隔", - "timelion.registerFeatureDescription": "時系列データを分析して結果を可視化するには、式言語を使用してください。", "timelion.requestHandlerErrorTitle": "Timelion リクエストエラー", "timelion.savedObjects.howToSaveAsNewDescription": "Kibana の以前のバージョンでは、{savedObjectName} の名前を変更すると新しい名前でコピーが作成されました。今後この操作を行うには、「新規 {savedObjectName} として保存」を使用します。", "timelion.savedObjects.saveAsNewLabel": "新規 {savedObjectName} として保存", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index c24f2952ef2a..6bbb3e59b25e 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1436,8 +1436,8 @@ "kbn.management.indexPattern.confirmOverwriteTitle": "覆盖“{type}”?", "kbn.management.indexPattern.sectionsHeader": "索引模式", "kbn.management.indexPattern.titleExistsLabel": "具有标题 “{title}” 的索引模式已存在。", - "kbn.management.indexPatternHeader": "索引模式", - "kbn.management.indexPatternLabel": "管理帮助从 Elasticsearch 检索数据的索引模式。", + "management.indexPatternHeader": "索引模式", + "management.indexPatternLabel": "管理帮助从 Elasticsearch 检索数据的索引模式。", "kbn.management.indexPatternList.createButton.betaLabel": "公测版", "kbn.management.indexPatternPrompt.exampleOne": "索引单个称作 log-west-001 的数据源,以便可以快速地构建图表或查询其内容。", "kbn.management.indexPatternPrompt.exampleOneTitle": "单数据源", @@ -1556,9 +1556,9 @@ "kbn.management.objects.objectsTable.table.typeFilterName": "类型", "kbn.management.objects.objectsTable.unableFindSavedObjectsNotificationMessage": "找不到已保存对象", "kbn.management.objects.parsingFieldErrorMessage": "为索引模式 “{indexName}” 解析 “{fieldName}” 时发生错误:{errorMessage}", - "kbn.management.objects.savedObjectsDescription": "导入、导出和管理您的已保存搜索、可视化和仪表板。", + "management.objects.savedObjectsDescription": "导入、导出和管理您的已保存搜索、可视化和仪表板。", "kbn.management.objects.savedObjectsSectionLabel": "已保存对象", - "kbn.management.objects.savedObjectsTitle": "已保存对象", + "management.objects.savedObjectsTitle": "已保存对象", "kbn.management.objects.view.cancelButtonAriaLabel": "取消", "kbn.management.objects.view.cancelButtonLabel": "取消", "kbn.management.objects.view.deleteItemButtonLabel": "删除“{title}”", @@ -1576,8 +1576,8 @@ "kbn.management.objects.view.viewItemTitle": "查看“{title}”", "kbn.management.savedObjects.editBreadcrumb": "编辑 {savedObjectType}", "kbn.management.savedObjects.indexBreadcrumb": "已保存对象", - "kbn.management.settings.advancedSettingsDescription": "直接编辑在 Kibana 中控制行为的设置。", - "kbn.management.settings.advancedSettingsLabel": "高级设置", + "advancedSettings.advancedSettingsDescription": "直接编辑在 Kibana 中控制行为的设置。", + "advancedSettings.advancedSettingsLabel": "高级设置", "kbn.management.settings.breadcrumb": "高级设置", "kbn.management.settings.callOutCautionDescription": "此处请谨慎操作,这些设置仅供高级用户使用。您在这里所做的更改可能使 Kibana 的大部分功能出现问题。这些设置有一部分可能未在文档中说明、不受支持或是实验性设置。如果字段有默认值,将字段留空会将其设置为默认值,其他配置指令可能不接受其默认值。删除定制设置会将其从 Kibana 的配置中永久删除。", "kbn.management.settings.callOutCautionTitle": "注意:在这里您可能会使问题出现", @@ -2792,7 +2792,6 @@ "timelion.noFunctionErrorMessage": "没有此类函数:{name}", "timelion.panels.noRenderFunctionErrorMessage": "面板必须具有渲染函数", "timelion.panels.timechart.unknownIntervalErrorMessage": "时间间隔未知", - "timelion.registerFeatureDescription": "使用表达式语言分析时间序列数据,并将结果可视化。", "timelion.requestHandlerErrorTitle": "Timelion 请求错误", "timelion.savedObjects.howToSaveAsNewDescription": "在 Kibana 的以前版本中,更改 {savedObjectName} 的名称将创建具有新名称的副本。使用“另存为新的 {savedObjectName}” 复选框可立即达到此目的。", "timelion.savedObjects.saveAsNewLabel": "另存为新的 {savedObjectName}",