From db4a61b83bc1abb02f0d129cc4a66b001e8a2c2a Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Wed, 4 Mar 2020 11:11:02 +0100 Subject: [PATCH] Migrate home app (#58030) (#59273) --- .../core_plugins/kibana/public/.eslintrc.js | 2 +- .../kibana/public/home/_index.scss | 1 - .../np_ready/components/home.test.mocks.ts | 42 ---- .../core_plugins/kibana/public/home/plugin.ts | 105 ---------- .../core_plugins/kibana/public/index.scss | 6 +- .../core_plugins/kibana/public/kibana.js | 1 - src/legacy/core_plugins/kibana_react/index.ts | 1 - .../core_plugins/kibana_react/public/index.ts | 8 +- .../new_platform/new_platform.karma_mock.js | 15 +- .../ui/public/new_platform/new_platform.ts | 3 +- .../ui/public/url/redirect_when_missing.js | 2 +- src/plugins/home/kibana.json | 3 +- .../home/public/application/_index.scss | 1 + .../home/public/application}/application.tsx | 4 +- .../__snapshots__/add_data.test.js.snap | 80 ++++---- .../__snapshots__/home.test.js.snap | 100 ++++----- .../recently_accessed.test.js.snap | 2 +- .../sample_data_view_data_button.test.js.snap | 0 .../__snapshots__/synopsis.test.js.snap | 0 .../__snapshots__/welcome.test.tsx.snap | 40 ++-- .../application}/components/_add_data.scss | 0 .../public/application}/components/_home.scss | 0 .../application}/components/_index.scss | 0 .../components/_sample_data_set_cards.scss | 0 .../application}/components/_synopsis.scss | 0 .../application}/components/_welcome.scss | 0 .../application}/components/add_data.js | 48 ++--- .../application}/components/add_data.test.js | 4 +- .../components/feature_directory.js | 12 +- .../public/application}/components/home.js | 14 +- .../application}/components/home.test.js | 6 +- .../application}/components/home_app.js | 5 +- .../components/recently_accessed.js | 2 +- .../components/recently_accessed.test.js | 0 .../components/sample_data/index.tsx | 8 +- .../components/sample_data_set_card.js | 35 ++-- .../components/sample_data_set_cards.js | 12 +- .../sample_data_view_data_button.js | 8 +- .../sample_data_view_data_button.test.js | 2 +- .../application}/components/synopsis.js | 0 .../application}/components/synopsis.test.js | 0 .../__snapshots__/content.test.js.snap | 0 .../__snapshots__/footer.test.js.snap | 2 +- .../instruction_set.test.js.snap | 0 .../__snapshots__/introduction.test.js.snap | 2 +- .../saved_objects_installer.test.js.snap | 0 .../__snapshots__/tutorial.test.js.snap | 0 .../components/tutorial/_tutorial.scss | 0 .../components/tutorial/content.js | 2 +- .../components/tutorial/content.test.js | 2 +- .../components/tutorial/footer.js | 2 +- .../components/tutorial/footer.test.js | 0 .../components/tutorial/instruction.js | 2 +- .../components/tutorial/instruction_set.js | 16 +- .../tutorial/instruction_set.test.js | 2 +- .../components/tutorial/introduction.js | 6 +- .../components/tutorial/introduction.test.js | 2 +- .../components/tutorial/number_parameter.js | 0 .../components/tutorial/parameter_form.js | 0 .../tutorial/replace_template_strings.js | 6 +- .../tutorial/saved_objects_installer.js | 16 +- .../tutorial/saved_objects_installer.test.js | 0 .../tutorial/status_check_states.js | 0 .../components/tutorial/string_parameter.js | 0 .../components/tutorial/tutorial.js | 14 +- .../components/tutorial/tutorial.test.js | 4 +- .../components/tutorial_directory.js | 22 +- .../application}/components/welcome.test.tsx | 4 +- .../application}/components/welcome.tsx | 22 +- .../home/public/application}/index.ts | 11 +- .../public/application}/kibana_services.ts | 22 +- .../public/application}/load_tutorials.js | 6 +- .../public/application}/sample_data_client.js | 2 +- src/plugins/home/public/index.ts | 4 - src/plugins/home/public/mocks/index.ts | 7 - src/plugins/home/public/plugin.test.ts | 55 ++--- src/plugins/home/public/plugin.ts | 95 +++++---- .../services/environment/environment.mock.ts | 21 +- .../services/environment/environment.test.ts | 6 +- .../services/environment/environment.ts | 12 +- .../home/public/services/environment/index.ts | 7 +- .../feature_catalogue_registry.mock.ts | 11 +- .../feature_catalogue_registry.test.ts | 12 +- .../feature_catalogue_registry.ts | 19 +- .../services/feature_catalogue/index.ts | 1 - .../home/public/services/tutorials/index.ts | 7 +- .../tutorials/tutorial_service.mock.ts | 13 +- .../tutorials/tutorial_service.test.ts | 6 +- .../services/tutorials/tutorial_service.ts | 12 +- src/plugins/kibana_react/public/index.ts | 1 + .../__snapshots__/markdown.test.tsx.snap | 0 .../kibana_react/public/markdown/index.ts | 0 .../public/markdown/markdown.test.tsx | 0 .../kibana_react/public/markdown/markdown.tsx | 0 .../public/markdown/markdown_simple.tsx | 0 x-pack/plugins/infra/public/plugin.ts | 3 +- .../translations/translations/ja-JP.json | 192 +++++++++--------- .../translations/translations/zh-CN.json | 192 +++++++++--------- 98 files changed, 592 insertions(+), 823 deletions(-) delete mode 100644 src/legacy/core_plugins/kibana/public/home/_index.scss delete mode 100644 src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.mocks.ts delete mode 100644 src/legacy/core_plugins/kibana/public/home/plugin.ts create mode 100644 src/plugins/home/public/application/_index.scss rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/application.tsx (90%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/__snapshots__/add_data.test.js.snap (92%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/__snapshots__/home.test.js.snap (89%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/__snapshots__/recently_accessed.test.js.snap (97%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/__snapshots__/sample_data_view_data_button.test.js.snap (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/__snapshots__/synopsis.test.js.snap (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/__snapshots__/welcome.test.tsx.snap (89%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/_add_data.scss (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/_home.scss (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/_index.scss (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/_sample_data_set_cards.scss (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/_synopsis.scss (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/_welcome.scss (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/add_data.js (87%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/add_data.test.js (95%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/feature_directory.js (88%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/home.js (93%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/home.test.js (97%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/home_app.js (96%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/recently_accessed.js (98%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/recently_accessed.test.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/sample_data/index.tsx (85%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/sample_data_set_card.js (84%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/sample_data_set_cards.js (93%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/sample_data_view_data_button.js (92%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/sample_data_view_data_button.test.js (97%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/synopsis.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/synopsis.test.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/__snapshots__/content.test.js.snap (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/__snapshots__/footer.test.js.snap (92%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/__snapshots__/instruction_set.test.js.snap (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/__snapshots__/introduction.test.js.snap (98%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/__snapshots__/tutorial.test.js.snap (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/_tutorial.scss (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/content.js (94%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/content.test.js (95%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/footer.js (96%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/footer.test.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/instruction.js (97%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/instruction_set.js (93%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/instruction_set.test.js (98%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/introduction.js (94%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/introduction.test.js (97%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/number_parameter.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/parameter_form.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/replace_template_strings.js (92%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/saved_objects_installer.js (92%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/saved_objects_installer.test.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/status_check_states.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/string_parameter.js (100%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/tutorial.js (96%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial/tutorial.test.js (97%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/tutorial_directory.js (90%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/welcome.test.tsx (95%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/components/welcome.tsx (87%) rename src/{legacy/core_plugins/kibana/public/home => plugins/home/public/application}/index.ts (69%) rename src/{legacy/core_plugins/kibana/public/home => plugins/home/public/application}/kibana_services.ts (78%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/load_tutorials.js (91%) rename src/{legacy/core_plugins/kibana/public/home/np_ready => plugins/home/public/application}/sample_data_client.js (97%) rename src/{legacy/core_plugins => plugins}/kibana_react/public/markdown/__snapshots__/markdown.test.tsx.snap (100%) rename src/{legacy/core_plugins => plugins}/kibana_react/public/markdown/index.ts (100%) rename src/{legacy/core_plugins => plugins}/kibana_react/public/markdown/markdown.test.tsx (100%) rename src/{legacy/core_plugins => plugins}/kibana_react/public/markdown/markdown.tsx (100%) rename src/{legacy/core_plugins => plugins}/kibana_react/public/markdown/markdown_simple.tsx (100%) diff --git a/src/legacy/core_plugins/kibana/public/.eslintrc.js b/src/legacy/core_plugins/kibana/public/.eslintrc.js index b3ee0a8fa7b04..e7171a5291d26 100644 --- a/src/legacy/core_plugins/kibana/public/.eslintrc.js +++ b/src/legacy/core_plugins/kibana/public/.eslintrc.js @@ -77,7 +77,7 @@ module.exports = { { basePath: path.resolve(__dirname, '../../../../../'), zones: topLevelRestricedZones.concat( - buildRestrictedPaths(['visualize', 'discover', 'dashboard', 'devTools', 'home']) + buildRestrictedPaths(['visualize', 'discover', 'dashboard', 'devTools']) ), }, ], diff --git a/src/legacy/core_plugins/kibana/public/home/_index.scss b/src/legacy/core_plugins/kibana/public/home/_index.scss deleted file mode 100644 index f42254c1096ce..0000000000000 --- a/src/legacy/core_plugins/kibana/public/home/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import 'np_ready/components/index'; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.mocks.ts b/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.mocks.ts deleted file mode 100644 index a0b9d7c779b02..0000000000000 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.mocks.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 { - notificationServiceMock, - overlayServiceMock, - httpServiceMock, - injectedMetadataServiceMock, -} from '../../../../../../../core/public/mocks'; - -jest.doMock('ui/new_platform', () => { - return { - npSetup: { - core: { - notifications: notificationServiceMock.createSetupContract(), - }, - }, - npStart: { - core: { - overlays: overlayServiceMock.createStartContract(), - http: httpServiceMock.createStartContract({ basePath: 'path' }), - injectedMetadata: injectedMetadataServiceMock.createStartContract(), - }, - }, - }; -}); diff --git a/src/legacy/core_plugins/kibana/public/home/plugin.ts b/src/legacy/core_plugins/kibana/public/home/plugin.ts deleted file mode 100644 index f8c750cc80283..0000000000000 --- a/src/legacy/core_plugins/kibana/public/home/plugin.ts +++ /dev/null @@ -1,105 +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 { - AppMountParameters, - CoreSetup, - CoreStart, - Plugin, - PluginInitializerContext, -} from 'kibana/public'; - -import { DataPublicPluginStart } from 'src/plugins/data/public'; -import { TelemetryPluginStart } from 'src/plugins/telemetry/public'; -import { setServices } from './kibana_services'; -import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public'; -import { UsageCollectionSetup } from '../../../../../plugins/usage_collection/public'; -import { - Environment, - HomePublicPluginStart, - HomePublicPluginSetup, -} from '../../../../../plugins/home/public'; - -export interface HomePluginStartDependencies { - data: DataPublicPluginStart; - home: HomePublicPluginStart; - telemetry?: TelemetryPluginStart; -} - -export interface HomePluginSetupDependencies { - usageCollection: UsageCollectionSetup; - kibanaLegacy: KibanaLegacySetup; - home: HomePublicPluginSetup; -} - -export class HomePlugin implements Plugin { - private dataStart: DataPublicPluginStart | null = null; - private savedObjectsClient: any = null; - private environment: Environment | null = null; - private featureCatalogue: HomePublicPluginStart['featureCatalogue'] | null = null; - private telemetry?: TelemetryPluginStart; - - constructor(private initializerContext: PluginInitializerContext) {} - - setup( - core: CoreSetup, - { home, kibanaLegacy, usageCollection }: HomePluginSetupDependencies - ) { - kibanaLegacy.registerLegacyApp({ - id: 'home', - title: 'Home', - mount: async (params: AppMountParameters) => { - const trackUiMetric = usageCollection.reportUiStats.bind(usageCollection, 'Kibana_home'); - const [coreStart, { home: homeStart }] = await core.getStartServices(); - setServices({ - trackUiMetric, - kibanaVersion: this.initializerContext.env.packageInfo.version, - http: coreStart.http, - toastNotifications: core.notifications.toasts, - banners: coreStart.overlays.banners, - docLinks: coreStart.docLinks, - savedObjectsClient: this.savedObjectsClient!, - chrome: coreStart.chrome, - telemetry: this.telemetry, - uiSettings: core.uiSettings, - addBasePath: core.http.basePath.prepend, - getBasePath: core.http.basePath.get, - indexPatternService: this.dataStart!.indexPatterns, - environment: this.environment!, - config: kibanaLegacy.config, - homeConfig: home.config, - tutorialVariables: homeStart.tutorials.get, - featureCatalogue: this.featureCatalogue!, - }); - const { renderApp } = await import('./np_ready/application'); - return await renderApp(params.element); - }, - }); - } - - start(core: CoreStart, { data, home, telemetry }: HomePluginStartDependencies) { - this.environment = home.environment.get(); - this.featureCatalogue = home.featureCatalogue; - this.dataStart = data; - this.telemetry = telemetry; - this.savedObjectsClient = core.savedObjects.client; - } - - stop() {} -} diff --git a/src/legacy/core_plugins/kibana/public/index.scss b/src/legacy/core_plugins/kibana/public/index.scss index 3eef84c32db79..547f44652cf2b 100644 --- a/src/legacy/core_plugins/kibana/public/index.scss +++ b/src/legacy/core_plugins/kibana/public/index.scss @@ -13,15 +13,15 @@ // Discover styles @import 'discover/index'; -// Home styles -@import './home/index'; - // Visualize styles @import './visualize/index'; // Has to come after visualize because of some // bad cascading in the Editor layout @import 'src/legacy/ui/public/vis/index'; +// Home styles +@import '../../../../plugins/home/public/application/index'; + // Management styles @import './management/index'; diff --git a/src/legacy/core_plugins/kibana/public/kibana.js b/src/legacy/core_plugins/kibana/public/kibana.js index a9f32949628e9..04eaf2cbe2679 100644 --- a/src/legacy/core_plugins/kibana/public/kibana.js +++ b/src/legacy/core_plugins/kibana/public/kibana.js @@ -42,7 +42,6 @@ import 'uiExports/shareContextMenuExtensions'; import 'uiExports/interpreter'; import 'ui/autoload/all'; -import './home'; import './discover/legacy'; import './visualize/legacy'; import './dashboard/legacy'; diff --git a/src/legacy/core_plugins/kibana_react/index.ts b/src/legacy/core_plugins/kibana_react/index.ts index eb936b94c37ef..f4083f3d50c34 100644 --- a/src/legacy/core_plugins/kibana_react/index.ts +++ b/src/legacy/core_plugins/kibana_react/index.ts @@ -25,7 +25,6 @@ export default function DataPlugin(kibana: any) { const config: Legacy.PluginSpecOptions = { id: 'kibana_react', require: [], - publicDir: resolve(__dirname, 'public'), config: (Joi: any) => { return Joi.object({ enabled: Joi.boolean().default(true), diff --git a/src/legacy/core_plugins/kibana_react/public/index.ts b/src/legacy/core_plugins/kibana_react/public/index.ts index 7e68b6c3886ff..a6a7cb72a8dee 100644 --- a/src/legacy/core_plugins/kibana_react/public/index.ts +++ b/src/legacy/core_plugins/kibana_react/public/index.ts @@ -17,10 +17,4 @@ * under the License. */ -// TODO these are imports from the old plugin world. -// Once the new platform is ready, they can get removed -// and handled by the platform itself in the setup method -// of the ExpressionExectorService - -/** @public types */ -export { Markdown, MarkdownSimple } from './markdown'; +export { Markdown, MarkdownSimple } from '../../../../plugins/kibana_react/public'; diff --git a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js index 75f48beb140a2..89617c20a31b7 100644 --- a/src/legacy/ui/public/new_platform/new_platform.karma_mock.js +++ b/src/legacy/ui/public/new_platform/new_platform.karma_mock.js @@ -213,6 +213,9 @@ export const npSetup = { config: { disableWelcomeScreen: false, }, + tutorials: { + setVariable: sinon.fake(), + }, }, charts: { theme: { @@ -381,18 +384,6 @@ export const npStart = { getTriggerActions: sinon.fake(), getTriggerCompatibleActions: sinon.fake(), }, - home: { - featureCatalogue: { - get: sinon.fake(), - register: sinon.fake(), - }, - environment: { - get: sinon.fake(), - }, - config: { - disableWelcomeScreen: false, - }, - }, navigation: { ui: { TopNavMenu: mockComponent, diff --git a/src/legacy/ui/public/new_platform/new_platform.ts b/src/legacy/ui/public/new_platform/new_platform.ts index 00d76bc341322..c5369b00f9f76 100644 --- a/src/legacy/ui/public/new_platform/new_platform.ts +++ b/src/legacy/ui/public/new_platform/new_platform.ts @@ -37,7 +37,7 @@ import { import { ChartsPluginSetup, ChartsPluginStart } from '../../../../plugins/charts/public'; import { DevToolsSetup, DevToolsStart } from '../../../../plugins/dev_tools/public'; import { KibanaLegacySetup, KibanaLegacyStart } from '../../../../plugins/kibana_legacy/public'; -import { HomePublicPluginSetup, HomePublicPluginStart } from '../../../../plugins/home/public'; +import { HomePublicPluginSetup } from '../../../../plugins/home/public'; import { SharePluginSetup, SharePluginStart } from '../../../../plugins/share/public'; import { AdvancedSettingsSetup, @@ -79,7 +79,6 @@ export interface PluginsStart { data: ReturnType; embeddable: IEmbeddableStart; expressions: ReturnType; - home: HomePublicPluginStart; inspector: InspectorStart; uiActions: UiActionsStart; navigation: NavigationPublicPluginStart; diff --git a/src/legacy/ui/public/url/redirect_when_missing.js b/src/legacy/ui/public/url/redirect_when_missing.js index 38938b18e7f3e..e6b4a488160dd 100644 --- a/src/legacy/ui/public/url/redirect_when_missing.js +++ b/src/legacy/ui/public/url/redirect_when_missing.js @@ -19,7 +19,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { MarkdownSimple } from '../../../core_plugins/kibana_react/public/markdown'; +import { MarkdownSimple } from '../../../../plugins/kibana_react/public'; import { toastNotifications } from 'ui/notify'; import { SavedObjectNotFound } from '../../../../plugins/kibana_utils/public'; import { uiModules } from '../modules'; diff --git a/src/plugins/home/kibana.json b/src/plugins/home/kibana.json index 31e7ebc138dcb..d5b047924f599 100644 --- a/src/plugins/home/kibana.json +++ b/src/plugins/home/kibana.json @@ -3,5 +3,6 @@ "version": "kibana", "server": true, "ui": true, - "optionalPlugins": ["usage_collection"] + "requiredPlugins": ["data", "kibanaLegacy"], + "optionalPlugins": ["usage_collection", "telemetry"] } diff --git a/src/plugins/home/public/application/_index.scss b/src/plugins/home/public/application/_index.scss new file mode 100644 index 0000000000000..841415620d691 --- /dev/null +++ b/src/plugins/home/public/application/_index.scss @@ -0,0 +1 @@ +@import 'components/index'; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx b/src/plugins/home/public/application/application.tsx similarity index 90% rename from src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx rename to src/plugins/home/public/application/application.tsx index 578d1f0a766a5..fb45919a9732a 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/application.tsx +++ b/src/plugins/home/public/application/application.tsx @@ -22,10 +22,10 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { i18n } from '@kbn/i18n'; // @ts-ignore import { HomeApp } from './components/home_app'; -import { getServices } from '../kibana_services'; +import { getServices } from './kibana_services'; export const renderApp = async (element: HTMLElement) => { - const homeTitle = i18n.translate('kbn.home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); + const homeTitle = i18n.translate('home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); const { featureCatalogue, chrome } = getServices(); // all the directories could be get in "start" phase of plugin after all of the legacy plugins will be moved to a NP diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/add_data.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap similarity index 92% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/add_data.test.js.snap rename to src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap index fcc7e75276154..57cbe0f17498f 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/add_data.test.js.snap +++ b/src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap @@ -41,7 +41,7 @@ exports[`apmUiEnabled 1`] = `

@@ -77,7 +77,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -108,7 +108,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -139,7 +139,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -178,7 +178,7 @@ exports[`apmUiEnabled 1`] = `

@@ -205,7 +205,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -235,7 +235,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -250,7 +250,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -271,7 +271,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -286,7 +286,7 @@ exports[`apmUiEnabled 1`] = ` > @@ -337,7 +337,7 @@ exports[`isNewKibanaInstance 1`] = `

@@ -373,7 +373,7 @@ exports[`isNewKibanaInstance 1`] = ` > @@ -404,7 +404,7 @@ exports[`isNewKibanaInstance 1`] = ` > @@ -443,7 +443,7 @@ exports[`isNewKibanaInstance 1`] = `

@@ -470,7 +470,7 @@ exports[`isNewKibanaInstance 1`] = ` > @@ -500,7 +500,7 @@ exports[`isNewKibanaInstance 1`] = ` > @@ -515,7 +515,7 @@ exports[`isNewKibanaInstance 1`] = ` > @@ -536,7 +536,7 @@ exports[`isNewKibanaInstance 1`] = ` > @@ -551,7 +551,7 @@ exports[`isNewKibanaInstance 1`] = ` > @@ -602,7 +602,7 @@ exports[`mlEnabled 1`] = `

@@ -638,7 +638,7 @@ exports[`mlEnabled 1`] = ` > @@ -669,7 +669,7 @@ exports[`mlEnabled 1`] = ` > @@ -700,7 +700,7 @@ exports[`mlEnabled 1`] = ` > @@ -739,7 +739,7 @@ exports[`mlEnabled 1`] = `

@@ -766,7 +766,7 @@ exports[`mlEnabled 1`] = ` > @@ -796,7 +796,7 @@ exports[`mlEnabled 1`] = ` > @@ -811,7 +811,7 @@ exports[`mlEnabled 1`] = ` > @@ -832,7 +832,7 @@ exports[`mlEnabled 1`] = ` > @@ -847,7 +847,7 @@ exports[`mlEnabled 1`] = ` > @@ -868,7 +868,7 @@ exports[`mlEnabled 1`] = ` > @@ -883,7 +883,7 @@ exports[`mlEnabled 1`] = ` > @@ -934,7 +934,7 @@ exports[`render 1`] = `

@@ -970,7 +970,7 @@ exports[`render 1`] = ` > @@ -1001,7 +1001,7 @@ exports[`render 1`] = ` > @@ -1040,7 +1040,7 @@ exports[`render 1`] = `

@@ -1067,7 +1067,7 @@ exports[`render 1`] = ` > @@ -1097,7 +1097,7 @@ exports[`render 1`] = ` > @@ -1112,7 +1112,7 @@ exports[`render 1`] = ` > @@ -1133,7 +1133,7 @@ exports[`render 1`] = ` > @@ -1148,7 +1148,7 @@ exports[`render 1`] = ` > diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/home.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap similarity index 89% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/home.test.js.snap rename to src/plugins/home/public/application/components/__snapshots__/home.test.js.snap index 9d27362e62739..60762e44343dc 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/home.test.js.snap +++ b/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap @@ -12,7 +12,7 @@ exports[`home directories should not render directory entry when showOnHomePage

@@ -36,7 +36,7 @@ exports[`home directories should not render directory entry when showOnHomePage

@@ -60,7 +60,7 @@ exports[`home directories should not render directory entry when showOnHomePage

@@ -91,7 +91,7 @@ exports[`home directories should not render directory entry when showOnHomePage

@@ -104,7 +104,7 @@ exports[`home directories should not render directory entry when showOnHomePage > @@ -126,7 +126,7 @@ exports[`home directories should render ADMIN directory entry in "Manage" panel

@@ -150,7 +150,7 @@ exports[`home directories should render ADMIN directory entry in "Manage" panel

@@ -174,7 +174,7 @@ exports[`home directories should render ADMIN directory entry in "Manage" panel

@@ -218,7 +218,7 @@ exports[`home directories should render ADMIN directory entry in "Manage" panel

@@ -231,7 +231,7 @@ exports[`home directories should render ADMIN directory entry in "Manage" panel > @@ -253,7 +253,7 @@ exports[`home directories should render DATA directory entry in "Explore Data" p

@@ -277,7 +277,7 @@ exports[`home directories should render DATA directory entry in "Explore Data" p

@@ -314,7 +314,7 @@ exports[`home directories should render DATA directory entry in "Explore Data" p

@@ -345,7 +345,7 @@ exports[`home directories should render DATA directory entry in "Explore Data" p

@@ -358,7 +358,7 @@ exports[`home directories should render DATA directory entry in "Explore Data" p > @@ -380,7 +380,7 @@ exports[`home isNewKibanaInstance should safely handle execeptions 1`] = `

@@ -404,7 +404,7 @@ exports[`home isNewKibanaInstance should safely handle execeptions 1`] = `

@@ -428,7 +428,7 @@ exports[`home isNewKibanaInstance should safely handle execeptions 1`] = `

@@ -459,7 +459,7 @@ exports[`home isNewKibanaInstance should safely handle execeptions 1`] = `

@@ -472,7 +472,7 @@ exports[`home isNewKibanaInstance should safely handle execeptions 1`] = ` > @@ -494,7 +494,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t

@@ -518,7 +518,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t

@@ -542,7 +542,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t

@@ -573,7 +573,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t

@@ -586,7 +586,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to false when t > @@ -608,7 +608,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when th

@@ -632,7 +632,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when th

@@ -656,7 +656,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when th

@@ -687,7 +687,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when th

@@ -700,7 +700,7 @@ exports[`home isNewKibanaInstance should set isNewKibanaInstance to true when th > @@ -722,7 +722,7 @@ exports[`home should render home component 1`] = `

@@ -746,7 +746,7 @@ exports[`home should render home component 1`] = `

@@ -770,7 +770,7 @@ exports[`home should render home component 1`] = `

@@ -801,7 +801,7 @@ exports[`home should render home component 1`] = `

@@ -814,7 +814,7 @@ exports[`home should render home component 1`] = ` > @@ -836,7 +836,7 @@ exports[`home welcome should show the normal home page if loading fails 1`] = `

@@ -860,7 +860,7 @@ exports[`home welcome should show the normal home page if loading fails 1`] = `

@@ -884,7 +884,7 @@ exports[`home welcome should show the normal home page if loading fails 1`] = `

@@ -915,7 +915,7 @@ exports[`home welcome should show the normal home page if loading fails 1`] = `

@@ -928,7 +928,7 @@ exports[`home welcome should show the normal home page if loading fails 1`] = ` > @@ -950,7 +950,7 @@ exports[`home welcome should show the normal home page if welcome screen is disa

@@ -974,7 +974,7 @@ exports[`home welcome should show the normal home page if welcome screen is disa

@@ -998,7 +998,7 @@ exports[`home welcome should show the normal home page if welcome screen is disa

@@ -1029,7 +1029,7 @@ exports[`home welcome should show the normal home page if welcome screen is disa

@@ -1042,7 +1042,7 @@ exports[`home welcome should show the normal home page if welcome screen is disa > @@ -1071,7 +1071,7 @@ exports[`home welcome stores skip welcome setting if skipped 1`] = `

@@ -1095,7 +1095,7 @@ exports[`home welcome stores skip welcome setting if skipped 1`] = `

@@ -1119,7 +1119,7 @@ exports[`home welcome stores skip welcome setting if skipped 1`] = `

@@ -1150,7 +1150,7 @@ exports[`home welcome stores skip welcome setting if skipped 1`] = `

@@ -1163,7 +1163,7 @@ exports[`home welcome stores skip welcome setting if skipped 1`] = ` > diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/recently_accessed.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/recently_accessed.test.js.snap similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/recently_accessed.test.js.snap rename to src/plugins/home/public/application/components/__snapshots__/recently_accessed.test.js.snap index 5fa1305a9c7e1..c9fd411ab6070 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/recently_accessed.test.js.snap +++ b/src/plugins/home/public/application/components/__snapshots__/recently_accessed.test.js.snap @@ -13,7 +13,7 @@ exports[`render 1`] = ` > diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/sample_data_view_data_button.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/sample_data_view_data_button.test.js.snap rename to src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/synopsis.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/synopsis.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/synopsis.test.js.snap rename to src/plugins/home/public/application/components/__snapshots__/synopsis.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/welcome.test.tsx.snap b/src/plugins/home/public/application/components/__snapshots__/welcome.test.tsx.snap similarity index 89% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/welcome.test.tsx.snap rename to src/plugins/home/public/application/components/__snapshots__/welcome.test.tsx.snap index df7cc7bcbaed0..87e0b13866897 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/__snapshots__/welcome.test.tsx.snap +++ b/src/plugins/home/public/application/components/__snapshots__/welcome.test.tsx.snap @@ -29,7 +29,7 @@ exports[`should render a Welcome screen with no telemetry disclaimer 1`] = `

@@ -42,7 +42,7 @@ exports[`should render a Welcome screen with no telemetry disclaimer 1`] = `

@@ -103,7 +103,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer 1`] = `

@@ -116,7 +116,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer 1`] = `

@@ -147,7 +147,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer 1`] = ` > @@ -215,7 +215,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn

@@ -228,7 +228,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn

@@ -259,7 +259,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn > @@ -327,7 +327,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn

@@ -340,7 +340,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn

@@ -371,7 +371,7 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn > diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/_add_data.scss b/src/plugins/home/public/application/components/_add_data.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/_add_data.scss rename to src/plugins/home/public/application/components/_add_data.scss diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/_home.scss b/src/plugins/home/public/application/components/_home.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/_home.scss rename to src/plugins/home/public/application/components/_home.scss diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/_index.scss b/src/plugins/home/public/application/components/_index.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/_index.scss rename to src/plugins/home/public/application/components/_index.scss diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/_sample_data_set_cards.scss b/src/plugins/home/public/application/components/_sample_data_set_cards.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/_sample_data_set_cards.scss rename to src/plugins/home/public/application/components/_sample_data_set_cards.scss diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/_synopsis.scss b/src/plugins/home/public/application/components/_synopsis.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/_synopsis.scss rename to src/plugins/home/public/application/components/_synopsis.scss diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/_welcome.scss b/src/plugins/home/public/application/components/_welcome.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/_welcome.scss rename to src/plugins/home/public/application/components/_welcome.scss diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js b/src/plugins/home/public/application/components/add_data.js similarity index 87% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js rename to src/plugins/home/public/application/components/add_data.js index 6d980114f9647..6d23ed17b21b2 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js +++ b/src/plugins/home/public/application/components/add_data.js @@ -21,7 +21,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../kibana_services'; import { EuiButton, @@ -43,11 +43,11 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { const renderCards = () => { const apmData = { title: intl.formatMessage({ - id: 'kbn.home.addData.apm.nameTitle', + id: 'home.addData.apm.nameTitle', defaultMessage: 'APM', }), description: intl.formatMessage({ - id: 'kbn.home.addData.apm.nameDescription', + id: 'home.addData.apm.nameDescription', defaultMessage: 'APM automatically collects in-depth performance metrics and errors from inside your applications.', }), @@ -55,11 +55,11 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { }; const loggingData = { title: intl.formatMessage({ - id: 'kbn.home.addData.logging.nameTitle', + id: 'home.addData.logging.nameTitle', defaultMessage: 'Logs', }), description: intl.formatMessage({ - id: 'kbn.home.addData.logging.nameDescription', + id: 'home.addData.logging.nameDescription', defaultMessage: 'Ingest logs from popular data sources and easily visualize in preconfigured dashboards.', }), @@ -67,11 +67,11 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { }; const metricsData = { title: intl.formatMessage({ - id: 'kbn.home.addData.metrics.nameTitle', + id: 'home.addData.metrics.nameTitle', defaultMessage: 'Metrics', }), description: intl.formatMessage({ - id: 'kbn.home.addData.metrics.nameDescription', + id: 'home.addData.metrics.nameDescription', defaultMessage: 'Collect metrics from the operating system and services running on your servers.', }), @@ -79,11 +79,11 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { }; const siemData = { title: intl.formatMessage({ - id: 'kbn.home.addData.siem.nameTitle', + id: 'home.addData.siem.nameTitle', defaultMessage: 'SIEM', }), description: intl.formatMessage({ - id: 'kbn.home.addData.siem.nameDescription', + id: 'home.addData.siem.nameDescription', defaultMessage: 'Centralize security events for interactive investigation in ready-to-go visualizations.', }), @@ -104,10 +104,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { href="#/home/tutorial/apm" aria-describedby={apmData.ariaDescribedby} > - + } /> @@ -132,7 +129,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {

@@ -165,7 +162,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { aria-describedby={loggingData.ariaDescribedby} > @@ -189,7 +186,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { aria-describedby={metricsData.ariaDescribedby} > @@ -207,10 +204,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {

- +

@@ -229,7 +223,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { aria-describedby={siemData.ariaDescribedby} > @@ -255,7 +249,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { @@ -264,7 +258,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { href="#/home/tutorial_directory/sampleData" > @@ -275,7 +269,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { @@ -284,7 +278,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { href={`${basePath}/app/ml#/filedatavisualizer`} > @@ -295,7 +289,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { @@ -304,7 +298,7 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => { href="#/management/kibana/index_pattern" > diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.test.js b/src/plugins/home/public/application/components/add_data.test.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.test.js rename to src/plugins/home/public/application/components/add_data.test.js index 86eec564f0b61..9457f766409b8 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.test.js +++ b/src/plugins/home/public/application/components/add_data.test.js @@ -20,9 +20,9 @@ import React from 'react'; import { AddData } from './add_data'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../kibana_services'; -jest.mock('../../kibana_services', () => { +jest.mock('../kibana_services', () => { const mock = { getBasePath: jest.fn(() => 'path'), }; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js b/src/plugins/home/public/application/components/feature_directory.js similarity index 88% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js rename to src/plugins/home/public/application/components/feature_directory.js index 5545944a1029f..2e979bf589975 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js +++ b/src/plugins/home/public/application/components/feature_directory.js @@ -31,7 +31,7 @@ import { EuiSpacer, } from '@elastic/eui'; -import { FeatureCatalogueCategory } from '../../../../../../../plugins/home/public'; +import { FeatureCatalogueCategory } from '../../services'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -53,17 +53,17 @@ export class FeatureDirectory extends React.Component { this.tabs = [ { id: ALL_TAB_ID, - name: i18n.translate('kbn.home.directory.tabs.allTitle', { defaultMessage: 'All' }), + name: i18n.translate('home.directory.tabs.allTitle', { defaultMessage: 'All' }), }, { id: FeatureCatalogueCategory.DATA, - name: i18n.translate('kbn.home.directory.tabs.dataTitle', { + name: i18n.translate('home.directory.tabs.dataTitle', { defaultMessage: 'Data Exploration & Visualization', }), }, { id: FeatureCatalogueCategory.ADMIN, - name: i18n.translate('kbn.home.directory.tabs.administrativeTitle', { + name: i18n.translate('home.directory.tabs.administrativeTitle', { defaultMessage: 'Administrative', }), }, @@ -71,7 +71,7 @@ export class FeatureDirectory extends React.Component { if (props.directories.some(isOtherCategory)) { this.tabs.push({ id: OTHERS_TAB_ID, - name: i18n.translate('kbn.home.directory.tabs.otherTitle', { defaultMessage: 'Other' }), + name: i18n.translate('home.directory.tabs.otherTitle', { defaultMessage: 'Other' }), }); } @@ -130,7 +130,7 @@ export class FeatureDirectory extends React.Component {

- +

diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js b/src/plugins/home/public/application/components/home.js similarity index 93% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js rename to src/plugins/home/public/application/components/home.js index 617a1810028fc..6d00b1c6a5d14 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js +++ b/src/plugins/home/public/application/components/home.js @@ -38,8 +38,8 @@ import { } from '@elastic/eui'; import { Welcome } from './welcome'; -import { FeatureCatalogueCategory } from '../../../../../../../plugins/home/public'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../kibana_services'; +import { FeatureCatalogueCategory } from '../../services'; const KEY_ENABLE_WELCOME = 'home:welcome:show'; @@ -139,7 +139,7 @@ export class Home extends Component {

- +

@@ -157,7 +157,7 @@ export class Home extends Component {

@@ -173,7 +173,7 @@ export class Home extends Component {

@@ -193,7 +193,7 @@ export class Home extends Component {

@@ -201,7 +201,7 @@ export class Home extends Component { diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.js b/src/plugins/home/public/application/components/home.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.js rename to src/plugins/home/public/application/components/home.test.js index db24cb3e3c1b7..ca8297800b53e 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.test.js +++ b/src/plugins/home/public/application/components/home.test.js @@ -17,16 +17,14 @@ * under the License. */ -import './home.test.mocks'; - import React from 'react'; import sinon from 'sinon'; import { shallow } from 'enzyme'; import { Home } from './home'; -import { FeatureCatalogueCategory } from '../../../../../../../plugins/home/public'; +import { FeatureCatalogueCategory } from '../../services'; -jest.mock('../../kibana_services', () => ({ +jest.mock('../kibana_services', () => ({ getServices: () => ({ getBasePath: () => 'path', tutorialVariables: () => ({}), diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js b/src/plugins/home/public/application/components/home_app.js similarity index 96% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js rename to src/plugins/home/public/application/components/home_app.js index d7531864582a3..d05945a7a90ae 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js +++ b/src/plugins/home/public/application/components/home_app.js @@ -27,16 +27,17 @@ import { Tutorial } from './tutorial/tutorial'; import { HashRouter as Router, Switch, Route, Redirect } from 'react-router-dom'; import { getTutorial } from '../load_tutorials'; import { replaceTemplateStrings } from './tutorial/replace_template_strings'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../kibana_services'; export function HomeApp({ directories }) { const { config, savedObjectsClient, getBasePath, addBasePath, - environment, + environmentService, telemetry, } = getServices(); + const environment = environmentService.getEnvironment(); const isCloudEnabled = environment.cloud; const mlEnabled = environment.ml; const apmUiEnabled = environment.apmUi; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.js b/src/plugins/home/public/application/components/recently_accessed.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.js rename to src/plugins/home/public/application/components/recently_accessed.js index acf49695bd53e..181968a2e063a 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.js +++ b/src/plugins/home/public/application/components/recently_accessed.js @@ -175,7 +175,7 @@ export class RecentlyAccessed extends Component {

diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.test.js b/src/plugins/home/public/application/components/recently_accessed.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.test.js rename to src/plugins/home/public/application/components/recently_accessed.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data/index.tsx b/src/plugins/home/public/application/components/sample_data/index.tsx similarity index 85% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data/index.tsx rename to src/plugins/home/public/application/components/sample_data/index.tsx index 868885417a9f9..381aa49c30d5a 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data/index.tsx +++ b/src/plugins/home/public/application/components/sample_data/index.tsx @@ -44,10 +44,10 @@ export function SampleDataCard({ urlBasePath, onDecline, onConfirm }: Props) { } + title={} description={ @@ -55,14 +55,14 @@ You can try our sample data and dashboards or jump in with your own data." footer={
- + - +
} diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_card.js b/src/plugins/home/public/application/components/sample_data_set_card.js similarity index 84% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_card.js rename to src/plugins/home/public/application/components/sample_data_set_card.js index 444b832be5811..bb46b125a5a80 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_card.js +++ b/src/plugins/home/public/application/components/sample_data_set_card.js @@ -67,13 +67,13 @@ export class SampleDataSetCard extends React.Component { flush="left" aria-label={ this.props.isProcessing - ? i18n.translate('kbn.home.sampleDataSetCard.removingButtonAriaLabel', { + ? i18n.translate('home.sampleDataSetCard.removingButtonAriaLabel', { defaultMessage: 'Removing {datasetName}', values: { datasetName: this.props.name, }, }) - : i18n.translate('kbn.home.sampleDataSetCard.removeButtonAriaLabel', { + : i18n.translate('home.sampleDataSetCard.removeButtonAriaLabel', { defaultMessage: 'Remove {datasetName}', values: { datasetName: this.props.name, @@ -83,12 +83,12 @@ export class SampleDataSetCard extends React.Component { > {this.props.isProcessing ? ( ) : ( )} @@ -115,13 +115,13 @@ export class SampleDataSetCard extends React.Component { data-test-subj={`addSampleDataSet${this.props.id}`} aria-label={ this.props.isProcessing - ? i18n.translate('kbn.home.sampleDataSetCard.addingButtonAriaLabel', { + ? i18n.translate('home.sampleDataSetCard.addingButtonAriaLabel', { defaultMessage: 'Adding {datasetName}', values: { datasetName: this.props.name, }, }) - : i18n.translate('kbn.home.sampleDataSetCard.addButtonAriaLabel', { + : i18n.translate('home.sampleDataSetCard.addButtonAriaLabel', { defaultMessage: 'Add {datasetName}', values: { datasetName: this.props.name, @@ -131,12 +131,12 @@ export class SampleDataSetCard extends React.Component { > {this.props.isProcessing ? ( ) : ( )} @@ -154,7 +154,7 @@ export class SampleDataSetCard extends React.Component { content={

@@ -164,18 +164,15 @@ export class SampleDataSetCard extends React.Component { diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js b/src/plugins/home/public/application/components/sample_data_set_cards.js similarity index 93% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js rename to src/plugins/home/public/application/components/sample_data_set_cards.js index 198e0d95271d7..404c82676c1c3 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js +++ b/src/plugins/home/public/application/components/sample_data_set_cards.js @@ -24,7 +24,7 @@ import { EuiFlexGrid, EuiFlexItem } from '@elastic/eui'; import { SampleDataSetCard, INSTALLED_STATUS, UNINSTALLED_STATUS } from './sample_data_set_card'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../kibana_services'; import { listSampleDataSets, @@ -62,7 +62,7 @@ export class SampleDataSetCards extends React.Component { sampleDataSets = await listSampleDataSets(); } catch (fetchError) { this.toastNotifications.addDanger({ - title: i18n.translate('kbn.home.sampleDataSet.unableToLoadListErrorMessage', { + title: i18n.translate('home.sampleDataSet.unableToLoadListErrorMessage', { defaultMessage: 'Unable to load sample data sets list', }), text: `${fetchError.message}`, @@ -100,7 +100,7 @@ export class SampleDataSetCards extends React.Component { })); } this.toastNotifications.addDanger({ - title: i18n.translate('kbn.home.sampleDataSet.unableToInstallErrorMessage', { + title: i18n.translate('home.sampleDataSet.unableToInstallErrorMessage', { defaultMessage: 'Unable to install sample data set: {name}', values: { name: targetSampleDataSet.name }, }), @@ -122,7 +122,7 @@ export class SampleDataSetCards extends React.Component { } this.toastNotifications.addSuccess({ - title: i18n.translate('kbn.home.sampleDataSet.installedLabel', { + title: i18n.translate('home.sampleDataSet.installedLabel', { defaultMessage: '{name} installed', values: { name: targetSampleDataSet.name }, }), @@ -148,7 +148,7 @@ export class SampleDataSetCards extends React.Component { })); } this.toastNotifications.addDanger({ - title: i18n.translate('kbn.home.sampleDataSet.unableToUninstallErrorMessage', { + title: i18n.translate('home.sampleDataSet.unableToUninstallErrorMessage', { defaultMessage: 'Unable to uninstall sample data set: {name}', values: { name: targetSampleDataSet.name }, }), @@ -170,7 +170,7 @@ export class SampleDataSetCards extends React.Component { } this.toastNotifications.addSuccess({ - title: i18n.translate('kbn.home.sampleDataSet.uninstalledLabel', { + title: i18n.translate('home.sampleDataSet.uninstalledLabel', { defaultMessage: '{name} uninstalled', values: { name: targetSampleDataSet.name }, }), diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js b/src/plugins/home/public/application/components/sample_data_view_data_button.js similarity index 92% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js rename to src/plugins/home/public/application/components/sample_data_view_data_button.js index cb43c18a8e78b..a8a3cda3f9555 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js +++ b/src/plugins/home/public/application/components/sample_data_view_data_button.js @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; import { EuiButton, EuiContextMenu, EuiIcon, EuiPopover } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../kibana_services'; export class SampleDataViewDataButton extends React.Component { addBasePath = getServices().addBasePath; @@ -44,11 +44,11 @@ export class SampleDataViewDataButton extends React.Component { }; render() { - const viewDataButtonLabel = i18n.translate('kbn.home.sampleDataSetCard.viewDataButtonLabel', { + const viewDataButtonLabel = i18n.translate('home.sampleDataSetCard.viewDataButtonLabel', { defaultMessage: 'View data', }); const viewDataButtonAriaLabel = i18n.translate( - 'kbn.home.sampleDataSetCard.viewDataButtonAriaLabel', + 'home.sampleDataSetCard.viewDataButtonAriaLabel', { defaultMessage: 'View {datasetName}', values: { @@ -84,7 +84,7 @@ export class SampleDataViewDataButton extends React.Component { id: 0, items: [ { - name: i18n.translate('kbn.home.sampleDataSetCard.dashboardLinkLabel', { + name: i18n.translate('home.sampleDataSetCard.dashboardLinkLabel', { defaultMessage: 'Dashboard', }), icon: , diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.test.js b/src/plugins/home/public/application/components/sample_data_view_data_button.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.test.js rename to src/plugins/home/public/application/components/sample_data_view_data_button.test.js index e33c206ed8482..f594ec1264c94 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.test.js +++ b/src/plugins/home/public/application/components/sample_data_view_data_button.test.js @@ -22,7 +22,7 @@ import { shallow } from 'enzyme'; import { SampleDataViewDataButton } from './sample_data_view_data_button'; -jest.mock('../../kibana_services', () => ({ +jest.mock('../kibana_services', () => ({ getServices: () => ({ addBasePath: path => `root${path}`, }), diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.js b/src/plugins/home/public/application/components/synopsis.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.js rename to src/plugins/home/public/application/components/synopsis.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.test.js b/src/plugins/home/public/application/components/synopsis.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.test.js rename to src/plugins/home/public/application/components/synopsis.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/content.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/content.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/content.test.js.snap rename to src/plugins/home/public/application/components/tutorial/__snapshots__/content.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/footer.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/footer.test.js.snap similarity index 92% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/footer.test.js.snap rename to src/plugins/home/public/application/components/tutorial/__snapshots__/footer.test.js.snap index 9fd3eebe96d8c..f054b5f5d9363 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/footer.test.js.snap +++ b/src/plugins/home/public/application/components/tutorial/__snapshots__/footer.test.js.snap @@ -14,7 +14,7 @@ exports[`render 1`] = `

diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/instruction_set.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/instruction_set.test.js.snap rename to src/plugins/home/public/application/components/tutorial/__snapshots__/instruction_set.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/introduction.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/introduction.test.js.snap similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/introduction.test.js.snap rename to src/plugins/home/public/application/components/tutorial/__snapshots__/introduction.test.js.snap index de848a670a8bd..d3ba85bd4959a 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/introduction.test.js.snap +++ b/src/plugins/home/public/application/components/tutorial/__snapshots__/introduction.test.js.snap @@ -32,7 +32,7 @@ exports[`props exportedFieldsUrl 1`] = ` > diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap rename to src/plugins/home/public/application/components/tutorial/__snapshots__/saved_objects_installer.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/tutorial.test.js.snap b/src/plugins/home/public/application/components/tutorial/__snapshots__/tutorial.test.js.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/__snapshots__/tutorial.test.js.snap rename to src/plugins/home/public/application/components/tutorial/__snapshots__/tutorial.test.js.snap diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/_tutorial.scss b/src/plugins/home/public/application/components/tutorial/_tutorial.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/_tutorial.scss rename to src/plugins/home/public/application/components/tutorial/_tutorial.scss diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js b/src/plugins/home/public/application/components/tutorial/content.js similarity index 94% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js rename to src/plugins/home/public/application/components/tutorial/content.js index 669eb6c4c42cd..db1f55b503e84 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js +++ b/src/plugins/home/public/application/components/tutorial/content.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Markdown } from '../../../../../../kibana_react/public'; +import { Markdown } from '../../../../../kibana_react/public'; const whiteListedRules = ['backticks', 'emphasis', 'link', 'list']; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.test.js b/src/plugins/home/public/application/components/tutorial/content.test.js similarity index 95% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.test.js rename to src/plugins/home/public/application/components/tutorial/content.test.js index 64864b6a5404d..d3a4d7085a0aa 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.test.js +++ b/src/plugins/home/public/application/components/tutorial/content.test.js @@ -22,7 +22,7 @@ import { shallow } from 'enzyme'; import { Content } from './content'; -jest.mock('../../../../../../kibana_react/public', () => { +jest.mock('../../../../../kibana_react/public', () => { return { Markdown: () =>
, }; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.js b/src/plugins/home/public/application/components/tutorial/footer.js similarity index 96% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.js rename to src/plugins/home/public/application/components/tutorial/footer.js index 0e66ca3f53ff7..02def489b3a24 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.js +++ b/src/plugins/home/public/application/components/tutorial/footer.js @@ -34,7 +34,7 @@ export function Footer({ url, label }) {

diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.test.js b/src/plugins/home/public/application/components/tutorial/footer.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.test.js rename to src/plugins/home/public/application/components/tutorial/footer.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction.js b/src/plugins/home/public/application/components/tutorial/instruction.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction.js rename to src/plugins/home/public/application/components/tutorial/instruction.js index c7094cf11f413..a44fb26bffbbb 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction.js +++ b/src/plugins/home/public/application/components/tutorial/instruction.js @@ -61,7 +61,7 @@ export function Instruction({ commands, paramValues, textPost, textPre, replaceT {copy => ( diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js b/src/plugins/home/public/application/components/tutorial/instruction_set.js similarity index 93% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js rename to src/plugins/home/public/application/components/tutorial/instruction_set.js index 7c938bb813d13..9f7b92b83874c 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js +++ b/src/plugins/home/public/application/components/tutorial/instruction_set.js @@ -22,7 +22,7 @@ import PropTypes from 'prop-types'; import { Instruction } from './instruction'; import { ParameterForm } from './parameter_form'; import { Content } from './content'; -import { getDisplayText } from '../../../../../../../../plugins/home/public'; +import { getDisplayText } from '../../../../common/instruction_variant'; import { EuiTabs, EuiTab, @@ -92,7 +92,7 @@ class InstructionSetUi extends React.Component { message = this.props.statusCheckConfig.success ? this.props.statusCheckConfig.success : this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.instructionSet.successLabel', + id: 'home.tutorial.instructionSet.successLabel', defaultMessage: 'Success', }); color = 'success'; @@ -102,7 +102,7 @@ class InstructionSetUi extends React.Component { message = this.props.statusCheckConfig.error ? this.props.statusCheckConfig.error : this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.instructionSet.noDataLabel', + id: 'home.tutorial.instructionSet.noDataLabel', defaultMessage: 'No data found', }); color = 'warning'; @@ -127,7 +127,7 @@ class InstructionSetUi extends React.Component { throw new Error( this.props.intl.formatMessage( { - id: 'kbn.home.tutorial.unexpectedStatusCheckStateErrorDescription', + id: 'home.tutorial.unexpectedStatusCheckStateErrorDescription', defaultMessage: 'Unexpected status check state {statusCheckState}', }, { @@ -154,7 +154,7 @@ class InstructionSetUi extends React.Component { > {statusCheckConfig.btnLabel || ( )} @@ -172,7 +172,7 @@ class InstructionSetUi extends React.Component { title: statusCheckConfig.title || this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.instructionSet.statusCheckTitle', + id: 'home.tutorial.instructionSet.statusCheckTitle', defaultMessage: 'Status Check', }), status: this.getStepStatus(statusCheckState), @@ -217,7 +217,7 @@ class InstructionSetUi extends React.Component { let paramsVisibilityToggle; if (this.props.params) { const ariaLabel = this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.instructionSet.toggleAriaLabel', + id: 'home.tutorial.instructionSet.toggleAriaLabel', defaultMessage: 'toggle command parameters visibility', }); paramsVisibilityToggle = ( @@ -227,7 +227,7 @@ class InstructionSetUi extends React.Component { onClick={this.handleToggleVisibility} > diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.test.js b/src/plugins/home/public/application/components/tutorial/instruction_set.test.js similarity index 98% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.test.js rename to src/plugins/home/public/application/components/tutorial/instruction_set.test.js index 21c3ddeceff6b..6c9ce530f6b20 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.test.js +++ b/src/plugins/home/public/application/components/tutorial/instruction_set.test.js @@ -45,7 +45,7 @@ const instructionVariants = [ }, ]; -jest.mock('../../../../../../kibana_react/public', () => { +jest.mock('../../../../../kibana_react/public', () => { return { Markdown: () =>
, }; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.js b/src/plugins/home/public/application/components/tutorial/introduction.js similarity index 94% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.js rename to src/plugins/home/public/application/components/tutorial/introduction.js index f95af6b6dfb15..6bccf41216f65 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.js +++ b/src/plugins/home/public/application/components/tutorial/introduction.js @@ -51,7 +51,7 @@ function IntroductionUI({ allowFullScreen fullScreenIconColor="dark" alt={intl.formatMessage({ - id: 'kbn.home.tutorial.introduction.imageAltDescription', + id: 'home.tutorial.introduction.imageAltDescription', defaultMessage: 'screenshot of primary dashboard.', })} url={previewUrl} @@ -65,7 +65,7 @@ function IntroductionUI({ @@ -85,7 +85,7 @@ function IntroductionUI({ betaBadge = ( diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.test.js b/src/plugins/home/public/application/components/tutorial/introduction.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.test.js rename to src/plugins/home/public/application/components/tutorial/introduction.test.js index 8862ef7334f93..ae87bc6030c9a 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.test.js +++ b/src/plugins/home/public/application/components/tutorial/introduction.test.js @@ -22,7 +22,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { Introduction } from './introduction'; -jest.mock('../../../../../../kibana_react/public', () => { +jest.mock('../../../../../kibana_react/public', () => { return { Markdown: () =>
, }; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/number_parameter.js b/src/plugins/home/public/application/components/tutorial/number_parameter.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/number_parameter.js rename to src/plugins/home/public/application/components/tutorial/number_parameter.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/parameter_form.js b/src/plugins/home/public/application/components/tutorial/parameter_form.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/parameter_form.js rename to src/plugins/home/public/application/components/tutorial/parameter_form.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js b/src/plugins/home/public/application/components/tutorial/replace_template_strings.js similarity index 92% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js rename to src/plugins/home/public/application/components/tutorial/replace_template_strings.js index f9fa662e6d507..fd40c59b18d67 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js +++ b/src/plugins/home/public/application/components/tutorial/replace_template_strings.js @@ -18,7 +18,7 @@ */ import { Writer } from 'mustache'; -import { getServices } from '../../../kibana_services'; +import { getServices } from '../../kibana_services'; const TEMPLATE_TAGS = ['{', '}']; @@ -33,7 +33,7 @@ mustacheWriter.escapedValue = function escapedValue(token, context) { }; export function replaceTemplateStrings(text, params = {}) { - const { tutorialVariables, kibanaVersion, docLinks } = getServices(); + const { tutorialService, kibanaVersion, docLinks } = getServices(); const variables = { // '{' and '}' can not be used in template since they are used as template tags. @@ -41,7 +41,7 @@ export function replaceTemplateStrings(text, params = {}) { curlyOpen: '{', curlyClose: '}', config: { - ...tutorialVariables(), + ...tutorialService.getVariables(), docs: { base_url: docLinks.ELASTIC_WEBSITE_URL, beats: { diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.js b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js similarity index 92% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.js rename to src/plugins/home/public/application/components/tutorial/saved_objects_installer.js index 93d85a14c09f8..bf69c419f6464 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.js +++ b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js @@ -36,7 +36,7 @@ import { class SavedObjectsInstallerUi extends React.Component { DEFAULT_BUTTON_LABEL = this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.savedObject.defaultButtonLabel', + id: 'home.tutorial.savedObject.defaultButtonLabel', defaultMessage: 'Load Kibana objects', }); @@ -74,7 +74,7 @@ class SavedObjectsInstallerUi extends React.Component { isInstalling: false, installStatusMsg: this.props.intl.formatMessage( { - id: 'kbn.home.tutorial.savedObject.requestFailedErrorMessage', + id: 'home.tutorial.savedObject.requestFailedErrorMessage', defaultMessage: 'Request failed, Error: {message}', }, { message: error.message } @@ -102,7 +102,7 @@ class SavedObjectsInstallerUi extends React.Component { isInstalling: false, installStatusMsg: this.props.intl.formatMessage( { - id: 'kbn.home.tutorial.savedObject.installStatusLabel', + id: 'home.tutorial.savedObject.installStatusLabel', defaultMessage: "{overwriteErrorsLength} of {savedObjectsLength} objects already exist. \ Click 'Confirm overwrite' to import and overwrite existing objects. Any changes to the objects will be lost.", @@ -115,7 +115,7 @@ Click 'Confirm overwrite' to import and overwrite existing objects. Any changes isInstalled: false, overwrite: true, buttonLabel: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.savedObject.confirmButtonLabel', + id: 'home.tutorial.savedObject.confirmButtonLabel', defaultMessage: 'Confirm overwrite', }), }); @@ -126,7 +126,7 @@ Click 'Confirm overwrite' to import and overwrite existing objects. Any changes const statusMsg = hasErrors ? this.props.intl.formatMessage( { - id: 'kbn.home.tutorial.savedObject.unableToAddErrorMessage', + id: 'home.tutorial.savedObject.unableToAddErrorMessage', defaultMessage: 'Unable to add {errorsLength} of {savedObjectsLength} kibana objects, Error: {errorMessage}', }, @@ -138,7 +138,7 @@ Click 'Confirm overwrite' to import and overwrite existing objects. Any changes ) : this.props.intl.formatMessage( { - id: 'kbn.home.tutorial.savedObject.addedLabel', + id: 'home.tutorial.savedObject.addedLabel', defaultMessage: '{savedObjectsLength} saved objects successfully added', }, { savedObjectsLength: this.props.savedObjects.length } @@ -172,7 +172,7 @@ Click 'Confirm overwrite' to import and overwrite existing objects. Any changes const installMsg = this.props.installMsg ? this.props.installMsg : this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.savedObject.installLabel', + id: 'home.tutorial.savedObject.installLabel', defaultMessage: 'Imports index pattern, visualizations and pre-defined dashboards.', }); const installStep = ( @@ -203,7 +203,7 @@ Click 'Confirm overwrite' to import and overwrite existing objects. Any changes return { title: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.savedObject.loadTitle', + id: 'home.tutorial.savedObject.loadTitle', defaultMessage: 'Load Kibana objects', }), status: this.state.isInstalled ? 'complete' : 'incomplete', diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.test.js b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.test.js rename to src/plugins/home/public/application/components/tutorial/saved_objects_installer.test.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/status_check_states.js b/src/plugins/home/public/application/components/tutorial/status_check_states.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/status_check_states.js rename to src/plugins/home/public/application/components/tutorial/status_check_states.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/string_parameter.js b/src/plugins/home/public/application/components/tutorial/string_parameter.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/string_parameter.js rename to src/plugins/home/public/application/components/tutorial/string_parameter.js diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js b/src/plugins/home/public/application/components/tutorial/tutorial.js similarity index 96% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js rename to src/plugins/home/public/application/components/tutorial/tutorial.js index bb878e0af7089..185b03aa8dd6a 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js +++ b/src/plugins/home/public/application/components/tutorial/tutorial.js @@ -37,7 +37,7 @@ import { import * as StatusCheckStates from './status_check_states'; import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { getServices } from '../../../kibana_services'; +import { getServices } from '../../kibana_services'; const INSTRUCTIONS_TYPE = { ELASTIC_CLOUD: 'elasticCloud', @@ -45,8 +45,8 @@ const INSTRUCTIONS_TYPE = { ON_PREM_ELASTIC_CLOUD: 'onPremElasticCloud', }; -const homeTitle = i18n.translate('kbn.home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); -const addDataTitle = i18n.translate('kbn.home.breadcrumbs.addDataTitle', { +const homeTitle = i18n.translate('home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); +const addDataTitle = i18n.translate('home.breadcrumbs.addDataTitle', { defaultMessage: 'Add data', }); @@ -129,7 +129,7 @@ class TutorialUi extends React.Component { throw new Error( this.props.intl.formatMessage( { - id: 'kbn.home.tutorial.unhandledInstructionTypeErrorDescription', + id: 'home.tutorial.unhandledInstructionTypeErrorDescription', defaultMessage: 'Unhandled instruction type {visibleInstructions}', }, { @@ -226,11 +226,11 @@ class TutorialUi extends React.Component { renderInstructionSetsToggle = () => { if (!this.props.isCloudEnabled && this.state.tutorial.onPremElasticCloud) { const selfManagedLabel = this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.selfManagedButtonLabel', + id: 'home.tutorial.selfManagedButtonLabel', defaultMessage: 'Self managed', }); const cloudLabel = this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.elasticCloudButtonLabel', + id: 'home.tutorial.elasticCloudButtonLabel', defaultMessage: 'Elastic Cloud', }); const radioButtons = [ @@ -339,7 +339,7 @@ class TutorialUi extends React.Component {

diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.test.js b/src/plugins/home/public/application/components/tutorial/tutorial.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.test.js rename to src/plugins/home/public/application/components/tutorial/tutorial.test.js index 733223fe79046..41d83d7562f6e 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.test.js +++ b/src/plugins/home/public/application/components/tutorial/tutorial.test.js @@ -22,7 +22,7 @@ import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers'; import { Tutorial } from './tutorial'; -jest.mock('../../../kibana_services', () => ({ +jest.mock('../../kibana_services', () => ({ getServices: () => ({ getBasePath: jest.fn(() => 'path'), chrome: { @@ -30,7 +30,7 @@ jest.mock('../../../kibana_services', () => ({ }, }), })); -jest.mock('../../../../../../kibana_react/public', () => { +jest.mock('../../../../../kibana_react/public', () => { return { Markdown: () =>

, }; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js b/src/plugins/home/public/application/components/tutorial_directory.js similarity index 90% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js rename to src/plugins/home/public/application/components/tutorial_directory.js index 697c1b0468cd1..9f1e906e341f9 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js +++ b/src/plugins/home/public/application/components/tutorial_directory.js @@ -22,7 +22,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Synopsis } from './synopsis'; import { SampleDataSetCards } from './sample_data_set_cards'; -import { getServices } from '../../kibana_services'; +import { getServices } from '../kibana_services'; import { EuiPage, @@ -43,8 +43,8 @@ import { i18n } from '@kbn/i18n'; const ALL_TAB_ID = 'all'; const SAMPLE_DATA_TAB_ID = 'sampleData'; -const homeTitle = i18n.translate('kbn.home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); -const addDataTitle = i18n.translate('kbn.home.breadcrumbs.addDataTitle', { +const homeTitle = i18n.translate('home.breadcrumbs.homeTitle', { defaultMessage: 'Home' }); +const addDataTitle = i18n.translate('home.breadcrumbs.addDataTitle', { defaultMessage: 'Add data', }); @@ -56,35 +56,35 @@ class TutorialDirectoryUi extends React.Component { { id: ALL_TAB_ID, name: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.tabs.allTitle', + id: 'home.tutorial.tabs.allTitle', defaultMessage: 'All', }), }, { id: 'logging', name: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.tabs.loggingTitle', + id: 'home.tutorial.tabs.loggingTitle', defaultMessage: 'Logs', }), }, { id: 'metrics', name: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.tabs.metricsTitle', + id: 'home.tutorial.tabs.metricsTitle', defaultMessage: 'Metrics', }), }, { id: 'siem', name: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.tabs.siemTitle', + id: 'home.tutorial.tabs.siemTitle', defaultMessage: 'SIEM', }), }, { id: SAMPLE_DATA_TAB_ID, name: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.tabs.sampleDataTitle', + id: 'home.tutorial.tabs.sampleDataTitle', defaultMessage: 'Sample data', }), }, @@ -148,11 +148,11 @@ class TutorialDirectoryUi extends React.Component { // Add card for sample data that only gets show in "all" tab tutorialCards.push({ name: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.card.sampleDataTitle', + id: 'home.tutorial.card.sampleDataTitle', defaultMessage: 'Sample Data', }), description: this.props.intl.formatMessage({ - id: 'kbn.home.tutorial.card.sampleDataDescription', + id: 'home.tutorial.card.sampleDataDescription', defaultMessage: 'Get started exploring Kibana with these "one click" data sets.', }), url: this.props.addBasePath('#/home/tutorial_directory/sampleData'), @@ -234,7 +234,7 @@ class TutorialDirectoryUi extends React.Component {

diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.test.tsx b/src/plugins/home/public/application/components/welcome.test.tsx similarity index 95% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.test.tsx rename to src/plugins/home/public/application/components/welcome.test.tsx index d9da47a2b43da..1332e03ffdc81 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.test.tsx +++ b/src/plugins/home/public/application/components/welcome.test.tsx @@ -20,9 +20,9 @@ import React from 'react'; import { shallow } from 'enzyme'; import { Welcome } from './welcome'; -import { telemetryPluginMock } from '../../../../../../../plugins/telemetry/public/mocks'; +import { telemetryPluginMock } from '../../../../telemetry/public/mocks'; -jest.mock('../../kibana_services', () => ({ +jest.mock('../kibana_services', () => ({ getServices: () => ({ addBasePath: (path: string) => `root${path}`, trackUiMetric: () => {}, diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.tsx b/src/plugins/home/public/application/components/welcome.tsx similarity index 87% rename from src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.tsx rename to src/plugins/home/public/application/components/welcome.tsx index 7906caeda1b38..f7f173f04ef51 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/components/welcome.tsx +++ b/src/plugins/home/public/application/components/welcome.tsx @@ -37,9 +37,9 @@ import { } from '@elastic/eui'; import { METRIC_TYPE } from '@kbn/analytics'; import { FormattedMessage } from '@kbn/i18n/react'; -import { getServices } from '../../kibana_services'; -import { TelemetryPluginStart } from '../../../../../../../plugins/telemetry/public'; -import { PRIVACY_STATEMENT_URL } from '../../../../../../../plugins/telemetry/common/constants'; +import { getServices } from '../kibana_services'; +import { TelemetryPluginStart } from '../../../../telemetry/public'; +import { PRIVACY_STATEMENT_URL } from '../../../../telemetry/common/constants'; import { SampleDataCard } from './sample_data'; interface Props { @@ -99,12 +99,12 @@ export class Welcome extends React.Component { return ( @@ -114,12 +114,12 @@ export class Welcome extends React.Component { return ( @@ -141,13 +141,13 @@ export class Welcome extends React.Component {

- +

@@ -168,12 +168,12 @@ export class Welcome extends React.Component { diff --git a/src/legacy/core_plugins/kibana/public/home/index.ts b/src/plugins/home/public/application/index.ts similarity index 69% rename from src/legacy/core_plugins/kibana/public/home/index.ts rename to src/plugins/home/public/application/index.ts index 74b6da33c6542..a4e65a9daf66c 100644 --- a/src/legacy/core_plugins/kibana/public/home/index.ts +++ b/src/plugins/home/public/application/index.ts @@ -17,13 +17,4 @@ * under the License. */ -import { PluginInitializerContext } from 'kibana/public'; -import { npSetup, npStart } from 'ui/new_platform'; -import { HomePlugin } from './plugin'; - -const instance = new HomePlugin({ - env: npSetup.plugins.kibanaLegacy.env, -} as PluginInitializerContext); -instance.setup(npSetup.core, npSetup.plugins); - -instance.start(npStart.core, npStart.plugins); +export { renderApp } from './application'; diff --git a/src/legacy/core_plugins/kibana/public/home/kibana_services.ts b/src/plugins/home/public/application/kibana_services.ts similarity index 78% rename from src/legacy/core_plugins/kibana/public/home/kibana_services.ts rename to src/plugins/home/public/application/kibana_services.ts index a4fbe83f60e84..6a42795b405a4 100644 --- a/src/legacy/core_plugins/kibana/public/home/kibana_services.ts +++ b/src/plugins/home/public/application/kibana_services.ts @@ -27,14 +27,12 @@ import { IUiSettingsClient, } from 'kibana/public'; import { UiStatsMetricType } from '@kbn/analytics'; -import { TelemetryPluginStart } from '../../../../../plugins/telemetry/public'; -import { - Environment, - HomePublicPluginSetup, - TutorialStart, - HomePublicPluginStart, -} from '../../../../../plugins/home/public'; -import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public'; +import { TelemetryPluginStart } from '../../../telemetry/public'; +import { KibanaLegacySetup } from '../../../kibana_legacy/public'; +import { TutorialService } from '../services/tutorials'; +import { FeatureCatalogueRegistry } from '../services/feature_catalogue'; +import { EnvironmentService } from '../services/environment'; +import { ConfigSchema } from '../../config'; export interface HomeKibanaServices { indexPatternService: any; @@ -42,8 +40,8 @@ export interface HomeKibanaServices { chrome: ChromeStart; uiSettings: IUiSettingsClient; config: KibanaLegacySetup['config']; - homeConfig: HomePublicPluginSetup['config']; - featureCatalogue: HomePublicPluginStart['featureCatalogue']; + homeConfig: ConfigSchema; + featureCatalogue: FeatureCatalogueRegistry; http: HttpStart; savedObjectsClient: SavedObjectsClientContract; toastNotifications: NotificationsSetup['toasts']; @@ -52,9 +50,9 @@ export interface HomeKibanaServices { getBasePath: () => string; docLinks: DocLinksStart; addBasePath: (url: string) => string; - environment: Environment; + environmentService: EnvironmentService; telemetry?: TelemetryPluginStart; - tutorialVariables: TutorialStart['get']; + tutorialService: TutorialService; } let services: HomeKibanaServices | null = null; diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js b/src/plugins/home/public/application/load_tutorials.js similarity index 91% rename from src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js rename to src/plugins/home/public/application/load_tutorials.js index 2f6d4d631baf5..1dbbb707ecf54 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js +++ b/src/plugins/home/public/application/load_tutorials.js @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import { getServices } from '../kibana_services'; +import { getServices } from './kibana_services'; import { i18n } from '@kbn/i18n'; const baseUrl = getServices().addBasePath('/api/kibana/home/tutorials'); @@ -39,7 +39,7 @@ async function loadTutorials() { }); if (response.status >= 300) { throw new Error( - i18n.translate('kbn.home.loadTutorials.requestFailedErrorMessage', { + i18n.translate('home.loadTutorials.requestFailedErrorMessage', { defaultMessage: 'Request failed with status code: {status}', values: { status: response.status }, }) @@ -50,7 +50,7 @@ async function loadTutorials() { tutorialsLoaded = true; } catch (err) { getServices().toastNotifications.addDanger({ - title: i18n.translate('kbn.home.loadTutorials.unableToLoadErrorMessage', { + title: i18n.translate('home.loadTutorials.unableToLoadErrorMessage', { defaultMessage: 'Unable to load tutorials', }), text: err.message, diff --git a/src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js b/src/plugins/home/public/application/sample_data_client.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js rename to src/plugins/home/public/application/sample_data_client.js index 34c85d8d2c350..600b1c3cb7dff 100644 --- a/src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js +++ b/src/plugins/home/public/application/sample_data_client.js @@ -17,7 +17,7 @@ * under the License. */ -import { getServices } from '../kibana_services'; +import { getServices } from './kibana_services'; const sampleDataUrl = '/api/sample_data'; diff --git a/src/plugins/home/public/index.ts b/src/plugins/home/public/index.ts index 7738990bba0d0..587dbe886d505 100644 --- a/src/plugins/home/public/index.ts +++ b/src/plugins/home/public/index.ts @@ -21,13 +21,9 @@ import { PluginInitializerContext } from 'kibana/public'; export { FeatureCatalogueSetup, - FeatureCatalogueStart, EnvironmentSetup, - EnvironmentStart, TutorialSetup, - TutorialStart, HomePublicPluginSetup, - HomePublicPluginStart, } from './plugin'; export { FeatureCatalogueEntry, diff --git a/src/plugins/home/public/mocks/index.ts b/src/plugins/home/public/mocks/index.ts index 42c61fe847250..dcca0308c526b 100644 --- a/src/plugins/home/public/mocks/index.ts +++ b/src/plugins/home/public/mocks/index.ts @@ -29,13 +29,6 @@ const createSetupContract = () => ({ config: configSchema.validate({}), }); -const createStartContract = () => ({ - featureCatalogue: featureCatalogueRegistryMock.createStart(), - environment: environmentServiceMock.createStart(), - tutorials: tutorialServiceMock.createStart(), -}); - export const homePluginMock = { createSetupContract, - createStartContract, }; diff --git a/src/plugins/home/public/plugin.test.ts b/src/plugins/home/public/plugin.test.ts index 0423ad3dd99f5..0b83c4caf1b30 100644 --- a/src/plugins/home/public/plugin.test.ts +++ b/src/plugins/home/public/plugin.test.ts @@ -20,6 +20,7 @@ import { registryMock, environmentMock, tutorialMock } from './plugin.test.mocks'; import { HomePublicPlugin } from './plugin'; import { coreMock } from '../../../core/public/mocks'; +import { kibanaLegacyPluginMock } from '../../kibana_legacy/public/mocks'; const mockInitializerContext = coreMock.createPluginInitializerContext(); @@ -29,58 +30,40 @@ describe('HomePublicPlugin', () => { registryMock.start.mockClear(); tutorialMock.setup.mockClear(); environmentMock.setup.mockClear(); - environmentMock.start.mockClear(); - tutorialMock.start.mockClear(); }); describe('setup', () => { test('wires up and returns registry', async () => { - const setup = await new HomePublicPlugin(mockInitializerContext).setup(); + const setup = await new HomePublicPlugin(mockInitializerContext).setup( + coreMock.createSetup() as any, + { + kibanaLegacy: kibanaLegacyPluginMock.createSetupContract(), + } + ); expect(setup).toHaveProperty('featureCatalogue'); expect(setup.featureCatalogue).toHaveProperty('register'); }); test('wires up and returns environment service', async () => { - const setup = await new HomePublicPlugin(mockInitializerContext).setup(); + const setup = await new HomePublicPlugin(mockInitializerContext).setup( + coreMock.createSetup() as any, + { + kibanaLegacy: kibanaLegacyPluginMock.createSetupContract(), + } + ); expect(setup).toHaveProperty('environment'); expect(setup.environment).toHaveProperty('update'); }); test('wires up and returns tutorial service', async () => { - const setup = await new HomePublicPlugin(mockInitializerContext).setup(); + const setup = await new HomePublicPlugin(mockInitializerContext).setup( + coreMock.createSetup() as any, + { + kibanaLegacy: kibanaLegacyPluginMock.createSetupContract(), + } + ); expect(setup).toHaveProperty('tutorials'); expect(setup.tutorials).toHaveProperty('setVariable'); }); }); - - describe('start', () => { - test('wires up and returns registry', async () => { - const service = new HomePublicPlugin(mockInitializerContext); - await service.setup(); - const core = { application: { capabilities: { catalogue: {} } } } as any; - const start = await service.start(core); - expect(registryMock.start).toHaveBeenCalledWith({ - capabilities: core.application.capabilities, - }); - expect(start.featureCatalogue.get).toBeDefined(); - }); - - test('wires up and returns environment service', async () => { - const service = new HomePublicPlugin(mockInitializerContext); - await service.setup(); - const start = await service.start({ - application: { capabilities: { catalogue: {} } }, - } as any); - expect(environmentMock.start).toHaveBeenCalled(); - expect(start.environment.get).toBeDefined(); - }); - - test('wires up and returns tutorial service', async () => { - const service = new HomePublicPlugin(mockInitializerContext); - await service.setup(); - const start = await service.start(coreMock.createStart()); - expect(tutorialMock.start).toHaveBeenCalled(); - expect(start.tutorials.get).toBeDefined(); - }); - }); }); diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index 975fd7bfb23c0..2353df600aa69 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -17,68 +17,103 @@ * under the License. */ -import { CoreStart, Plugin, PluginInitializerContext } from 'kibana/public'; +import { + AppMountParameters, + CoreSetup, + CoreStart, + Plugin, + PluginInitializerContext, +} from 'kibana/public'; import { EnvironmentService, EnvironmentServiceSetup, - EnvironmentServiceStart, FeatureCatalogueRegistry, FeatureCatalogueRegistrySetup, - FeatureCatalogueRegistryStart, TutorialService, TutorialServiceSetup, - TutorialServiceStart, } from './services'; import { ConfigSchema } from '../config'; +import { setServices } from './application/kibana_services'; +import { DataPublicPluginStart } from '../../data/public'; +import { TelemetryPluginStart } from '../../telemetry/public'; +import { UsageCollectionSetup } from '../../usage_collection/public'; +import { KibanaLegacySetup } from '../../kibana_legacy/public'; + +export interface HomePluginStartDependencies { + data: DataPublicPluginStart; + telemetry?: TelemetryPluginStart; +} + +export interface HomePluginSetupDependencies { + usageCollection?: UsageCollectionSetup; + kibanaLegacy: KibanaLegacySetup; +} -export class HomePublicPlugin implements Plugin { +export class HomePublicPlugin implements Plugin { private readonly featuresCatalogueRegistry = new FeatureCatalogueRegistry(); private readonly environmentService = new EnvironmentService(); private readonly tutorialService = new TutorialService(); constructor(private readonly initializerContext: PluginInitializerContext) {} - public setup(): HomePublicPluginSetup { + public setup( + core: CoreSetup, + { kibanaLegacy, usageCollection }: HomePluginSetupDependencies + ): HomePublicPluginSetup { + kibanaLegacy.registerLegacyApp({ + id: 'home', + title: 'Home', + mount: async (params: AppMountParameters) => { + const trackUiMetric = usageCollection + ? usageCollection.reportUiStats.bind(usageCollection, 'Kibana_home') + : () => {}; + const [coreStart, { telemetry, data }] = await core.getStartServices(); + setServices({ + trackUiMetric, + kibanaVersion: this.initializerContext.env.packageInfo.version, + http: coreStart.http, + toastNotifications: core.notifications.toasts, + banners: coreStart.overlays.banners, + docLinks: coreStart.docLinks, + savedObjectsClient: coreStart.savedObjects.client, + chrome: coreStart.chrome, + telemetry, + uiSettings: core.uiSettings, + addBasePath: core.http.basePath.prepend, + getBasePath: core.http.basePath.get, + indexPatternService: data.indexPatterns, + environmentService: this.environmentService, + config: kibanaLegacy.config, + homeConfig: this.initializerContext.config.get(), + tutorialService: this.tutorialService, + featureCatalogue: this.featuresCatalogueRegistry, + }); + const { renderApp } = await import('./application'); + return await renderApp(params.element); + }, + }); return { featureCatalogue: { ...this.featuresCatalogueRegistry.setup() }, environment: { ...this.environmentService.setup() }, tutorials: { ...this.tutorialService.setup() }, - config: this.initializerContext.config.get(), }; } - public start(core: CoreStart): HomePublicPluginStart { - return { - featureCatalogue: { - ...this.featuresCatalogueRegistry.start({ - capabilities: core.application.capabilities, - }), - }, - tutorials: { ...this.tutorialService.start() }, - environment: { ...this.environmentService.start() }, - }; + public start({ application: { capabilities } }: CoreStart) { + this.featuresCatalogueRegistry.start({ capabilities }); } } /** @public */ export type FeatureCatalogueSetup = FeatureCatalogueRegistrySetup; -/** @public */ -export type FeatureCatalogueStart = FeatureCatalogueRegistryStart; - /** @public */ export type EnvironmentSetup = EnvironmentServiceSetup; -/** @public */ -export type EnvironmentStart = EnvironmentServiceStart; - /** @public */ export type TutorialSetup = TutorialServiceSetup; -/** @public */ -export type TutorialStart = TutorialServiceStart; - /** @public */ export interface HomePublicPluginSetup { tutorials: TutorialServiceSetup; @@ -89,12 +124,4 @@ export interface HomePublicPluginSetup { * @deprecated */ environment: EnvironmentSetup; - config: ConfigSchema; -} - -/** @public */ -export interface HomePublicPluginStart { - tutorials: TutorialServiceStart; - featureCatalogue: FeatureCatalogueStart; - environment: EnvironmentStart; } diff --git a/src/plugins/home/public/services/environment/environment.mock.ts b/src/plugins/home/public/services/environment/environment.mock.ts index 5856145dced29..d8be02bf6552c 100644 --- a/src/plugins/home/public/services/environment/environment.mock.ts +++ b/src/plugins/home/public/services/environment/environment.mock.ts @@ -17,11 +17,7 @@ * under the License. */ -import { - EnvironmentService, - EnvironmentServiceSetup, - EnvironmentServiceStart, -} from './environment'; +import { EnvironmentService, EnvironmentServiceSetup } from './environment'; const createSetupMock = (): jest.Mocked => { const setup = { @@ -30,25 +26,20 @@ const createSetupMock = (): jest.Mocked => { return setup; }; -const createStartMock = (): jest.Mocked => { - const start = { - get: jest.fn(), - }; - return start; -}; - const createMock = (): jest.Mocked> => { const service = { setup: jest.fn(), - start: jest.fn(), + getEnvironment: jest.fn(() => ({ + cloud: false, + apmUi: false, + ml: false, + })), }; service.setup.mockImplementation(createSetupMock); - service.start.mockImplementation(createStartMock); return service; }; export const environmentServiceMock = { createSetup: createSetupMock, - createStart: createStartMock, create: createMock, }; diff --git a/src/plugins/home/public/services/environment/environment.test.ts b/src/plugins/home/public/services/environment/environment.test.ts index f42eba782a760..c4281021e04d6 100644 --- a/src/plugins/home/public/services/environment/environment.test.ts +++ b/src/plugins/home/public/services/environment/environment.test.ts @@ -30,10 +30,10 @@ describe('EnvironmentService', () => { }); }); - describe('start', () => { + describe('getEnvironment', () => { test('returns default values', () => { const service = new EnvironmentService(); - expect(service.start().get()).toEqual({ ml: false, cloud: false, apmUi: false }); + expect(service.getEnvironment()).toEqual({ ml: false, cloud: false, apmUi: false }); }); test('returns last state of update calls', () => { @@ -41,7 +41,7 @@ describe('EnvironmentService', () => { const setup = service.setup(); setup.update({ ml: true, cloud: true }); setup.update({ ml: false, apmUi: true }); - expect(service.start().get()).toEqual({ ml: false, cloud: true, apmUi: true }); + expect(service.getEnvironment()).toEqual({ ml: false, cloud: true, apmUi: true }); }); }); }); diff --git a/src/plugins/home/public/services/environment/environment.ts b/src/plugins/home/public/services/environment/environment.ts index e2ddf912017e5..b340d992c6f3e 100644 --- a/src/plugins/home/public/services/environment/environment.ts +++ b/src/plugins/home/public/services/environment/environment.ts @@ -55,17 +55,9 @@ export class EnvironmentService { }; } - public start() { - return { - /** - * Retrieve the current environment home is running in. This API is only intended for internal - * use and is only exposed during a transition period of migrating the home app to the new platform. - * @deprecated - */ - get: (): Environment => this.environment, - }; + public getEnvironment() { + return this.environment; } } export type EnvironmentServiceSetup = ReturnType; -export type EnvironmentServiceStart = ReturnType; diff --git a/src/plugins/home/public/services/environment/index.ts b/src/plugins/home/public/services/environment/index.ts index ed20f6adb96c6..91d14c358e7db 100644 --- a/src/plugins/home/public/services/environment/index.ts +++ b/src/plugins/home/public/services/environment/index.ts @@ -17,9 +17,4 @@ * under the License. */ -export { - EnvironmentService, - Environment, - EnvironmentServiceSetup, - EnvironmentServiceStart, -} from './environment'; +export { EnvironmentService, Environment, EnvironmentServiceSetup } from './environment'; diff --git a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.mock.ts b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.mock.ts index 54bdd42c1cca9..d7b87adfff78b 100644 --- a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.mock.ts +++ b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.mock.ts @@ -19,7 +19,6 @@ import { FeatureCatalogueRegistrySetup, - FeatureCatalogueRegistryStart, FeatureCatalogueRegistry, } from './feature_catalogue_registry'; @@ -30,25 +29,17 @@ const createSetupMock = (): jest.Mocked => { return setup; }; -const createStartMock = (): jest.Mocked => { - const start = { - get: jest.fn(), - }; - return start; -}; - const createMock = (): jest.Mocked> => { const service = { setup: jest.fn(), start: jest.fn(), + get: jest.fn(() => []), }; service.setup.mockImplementation(createSetupMock); - service.start.mockImplementation(createStartMock); return service; }; export const featureCatalogueRegistryMock = { createSetup: createSetupMock, - createStart: createStartMock, create: createMock, }; diff --git a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts index b174a68aa53be..34095848dbd2c 100644 --- a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts +++ b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts @@ -50,21 +50,24 @@ describe('FeatureCatalogueRegistry', () => { const service = new FeatureCatalogueRegistry(); service.setup().register(DASHBOARD_FEATURE); const capabilities = { catalogue: {} } as any; - expect(service.start({ capabilities }).get()).toEqual([DASHBOARD_FEATURE]); + service.start({ capabilities }); + expect(service.get()).toEqual([DASHBOARD_FEATURE]); }); test('retains items with true in capabilities', () => { const service = new FeatureCatalogueRegistry(); service.setup().register(DASHBOARD_FEATURE); const capabilities = { catalogue: { dashboard: true } } as any; - expect(service.start({ capabilities }).get()).toEqual([DASHBOARD_FEATURE]); + service.start({ capabilities }); + expect(service.get()).toEqual([DASHBOARD_FEATURE]); }); test('removes items with false in capabilities', () => { const service = new FeatureCatalogueRegistry(); service.setup().register(DASHBOARD_FEATURE); const capabilities = { catalogue: { dashboard: false } } as any; - expect(service.start({ capabilities }).get()).toEqual([]); + service.start({ capabilities }); + expect(service.get()).toEqual([]); }); }); }); @@ -77,7 +80,8 @@ describe('FeatureCatalogueRegistry', () => { setup.register({ id: '2', title: 'Apple' } as any); setup.register({ id: '3', title: 'Banana' } as any); const capabilities = { catalogue: {} } as any; - expect(service.start({ capabilities }).get()).toEqual([ + service.start({ capabilities }); + expect(service.get()).toEqual([ { id: '2', title: 'Apple' }, { id: '3', title: 'Banana' }, { id: '1', title: 'Orange' }, diff --git a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts index 6ab342f37dfd9..187a75b376d64 100644 --- a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts +++ b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.ts @@ -46,6 +46,7 @@ export interface FeatureCatalogueEntry { } export class FeatureCatalogueRegistry { + private capabilities: Capabilities | null = null; private readonly features = new Map(); public setup() { @@ -63,17 +64,21 @@ export class FeatureCatalogueRegistry { } public start({ capabilities }: { capabilities: Capabilities }) { - return { - get: (): readonly FeatureCatalogueEntry[] => - [...this.features.values()] - .filter(entry => capabilities.catalogue[entry.id] !== false) - .sort(compareByKey('title')), - }; + this.capabilities = capabilities; + } + + public get(): readonly FeatureCatalogueEntry[] { + if (this.capabilities === null) { + throw new Error('Catalogue entries are only available after start phase'); + } + const capabilities = this.capabilities; + return [...this.features.values()] + .filter(entry => capabilities.catalogue[entry.id] !== false) + .sort(compareByKey('title')); } } export type FeatureCatalogueRegistrySetup = ReturnType; -export type FeatureCatalogueRegistryStart = ReturnType; const compareByKey = (key: keyof T) => (left: T, right: T) => { if (left[key] < right[key]) { diff --git a/src/plugins/home/public/services/feature_catalogue/index.ts b/src/plugins/home/public/services/feature_catalogue/index.ts index eae01271e8559..1e5021a3ad0be 100644 --- a/src/plugins/home/public/services/feature_catalogue/index.ts +++ b/src/plugins/home/public/services/feature_catalogue/index.ts @@ -22,5 +22,4 @@ export { FeatureCatalogueEntry, FeatureCatalogueRegistry, FeatureCatalogueRegistrySetup, - FeatureCatalogueRegistryStart, } from './feature_catalogue_registry'; diff --git a/src/plugins/home/public/services/tutorials/index.ts b/src/plugins/home/public/services/tutorials/index.ts index 13a1c58c80f92..3de1e67204d96 100644 --- a/src/plugins/home/public/services/tutorials/index.ts +++ b/src/plugins/home/public/services/tutorials/index.ts @@ -17,9 +17,4 @@ * under the License. */ -export { - TutorialService, - TutorialVariables, - TutorialServiceSetup, - TutorialServiceStart, -} from './tutorial_service'; +export { TutorialService, TutorialVariables, TutorialServiceSetup } from './tutorial_service'; diff --git a/src/plugins/home/public/services/tutorials/tutorial_service.mock.ts b/src/plugins/home/public/services/tutorials/tutorial_service.mock.ts index 09397a0db8339..bd604fb231dee 100644 --- a/src/plugins/home/public/services/tutorials/tutorial_service.mock.ts +++ b/src/plugins/home/public/services/tutorials/tutorial_service.mock.ts @@ -17,7 +17,7 @@ * under the License. */ -import { TutorialService, TutorialServiceSetup, TutorialServiceStart } from './tutorial_service'; +import { TutorialService, TutorialServiceSetup } from './tutorial_service'; const createSetupMock = (): jest.Mocked => { const setup = { @@ -26,25 +26,16 @@ const createSetupMock = (): jest.Mocked => { return setup; }; -const createStartMock = (): jest.Mocked => { - const start = { - get: jest.fn(), - }; - return start; -}; - const createMock = (): jest.Mocked> => { const service = { setup: jest.fn(), - start: jest.fn(), + getVariables: jest.fn(() => ({})), }; service.setup.mockImplementation(createSetupMock); - service.start.mockImplementation(createStartMock); return service; }; export const tutorialServiceMock = { createSetup: createSetupMock, - createStart: createStartMock, create: createMock, }; diff --git a/src/plugins/home/public/services/tutorials/tutorial_service.test.ts b/src/plugins/home/public/services/tutorials/tutorial_service.test.ts index 04f6bce9b7caa..f4bcd71a39e8a 100644 --- a/src/plugins/home/public/services/tutorials/tutorial_service.test.ts +++ b/src/plugins/home/public/services/tutorials/tutorial_service.test.ts @@ -38,10 +38,10 @@ describe('TutorialService', () => { }); }); - describe('start', () => { + describe('getVariables', () => { test('returns empty object', () => { const service = new TutorialService(); - expect(service.start().get()).toEqual({}); + expect(service.getVariables()).toEqual({}); }); test('returns last state of update calls', () => { @@ -49,7 +49,7 @@ describe('TutorialService', () => { const setup = service.setup(); setup.setVariable('abc', 123); setup.setVariable('def', { subKey: 456 }); - expect(service.start().get()).toEqual({ abc: 123, def: { subKey: 456 } }); + expect(service.getVariables()).toEqual({ abc: 123, def: { subKey: 456 } }); }); }); }); diff --git a/src/plugins/home/public/services/tutorials/tutorial_service.ts b/src/plugins/home/public/services/tutorials/tutorial_service.ts index 824c3d46a76a3..38297a6437315 100644 --- a/src/plugins/home/public/services/tutorials/tutorial_service.ts +++ b/src/plugins/home/public/services/tutorials/tutorial_service.ts @@ -37,17 +37,9 @@ export class TutorialService { }; } - public start() { - return { - /** - * Retrieve the variables for substitution in tutorials. This API is only intended for internal - * use and is only exposed during a transition period of migrating the home app to the new platform. - * @deprecated - */ - get: (): TutorialVariables => this.tutorialVariables, - }; + public getVariables() { + return this.tutorialVariables; } } export type TutorialServiceSetup = ReturnType; -export type TutorialServiceStart = ReturnType; diff --git a/src/plugins/kibana_react/public/index.ts b/src/plugins/kibana_react/public/index.ts index a9087a772a970..f04c6f1f19c33 100644 --- a/src/plugins/kibana_react/public/index.ts +++ b/src/plugins/kibana_react/public/index.ts @@ -25,6 +25,7 @@ export * from './ui_settings'; export * from './field_icon'; export * from './table_list_view'; export * from './split_panel'; +export { Markdown, MarkdownSimple } from './markdown'; export { reactToUiComponent, uiToReactComponent } from './adapters'; export { useUrlTracker } from './use_url_tracker'; export { toMountPoint } from './util'; diff --git a/src/legacy/core_plugins/kibana_react/public/markdown/__snapshots__/markdown.test.tsx.snap b/src/plugins/kibana_react/public/markdown/__snapshots__/markdown.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana_react/public/markdown/__snapshots__/markdown.test.tsx.snap rename to src/plugins/kibana_react/public/markdown/__snapshots__/markdown.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana_react/public/markdown/index.ts b/src/plugins/kibana_react/public/markdown/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana_react/public/markdown/index.ts rename to src/plugins/kibana_react/public/markdown/index.ts diff --git a/src/legacy/core_plugins/kibana_react/public/markdown/markdown.test.tsx b/src/plugins/kibana_react/public/markdown/markdown.test.tsx similarity index 100% rename from src/legacy/core_plugins/kibana_react/public/markdown/markdown.test.tsx rename to src/plugins/kibana_react/public/markdown/markdown.test.tsx diff --git a/src/legacy/core_plugins/kibana_react/public/markdown/markdown.tsx b/src/plugins/kibana_react/public/markdown/markdown.tsx similarity index 100% rename from src/legacy/core_plugins/kibana_react/public/markdown/markdown.tsx rename to src/plugins/kibana_react/public/markdown/markdown.tsx diff --git a/src/legacy/core_plugins/kibana_react/public/markdown/markdown_simple.tsx b/src/plugins/kibana_react/public/markdown/markdown_simple.tsx similarity index 100% rename from src/legacy/core_plugins/kibana_react/public/markdown/markdown_simple.tsx rename to src/plugins/kibana_react/public/markdown/markdown_simple.tsx diff --git a/x-pack/plugins/infra/public/plugin.ts b/x-pack/plugins/infra/public/plugin.ts index 5d529e1fda0dc..d576331662a08 100644 --- a/x-pack/plugins/infra/public/plugin.ts +++ b/x-pack/plugins/infra/public/plugin.ts @@ -24,7 +24,7 @@ import introspectionQueryResultData from './graphql/introspection.json'; import { InfraKibanaObservableApiAdapter } from './lib/adapters/observable_api/kibana_observable_api'; import { registerStartSingleton } from './legacy_singletons'; import { registerFeatures } from './register_feature'; -import { HomePublicPluginSetup, HomePublicPluginStart } from '../../../../src/plugins/home/public'; +import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; import { DataPublicPluginSetup, DataPublicPluginStart } from '../../../../src/plugins/data/public'; import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; import { DataEnhancedSetup, DataEnhancedStart } from '../../data_enhanced/public'; @@ -41,7 +41,6 @@ export interface ClientPluginsSetup { } export interface ClientPluginsStart { - home: HomePublicPluginStart; data: DataPublicPluginStart; dataEnhanced: DataEnhancedStart; } diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index c60734b32ac7f..ae85023442e1b 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1180,102 +1180,6 @@ "kbn.embeddable.inspectorRequestDataTitle": "データ", "kbn.embeddable.inspectorRequestDescription": "このリクエストは Elasticsearch にクエリをかけ、検索データを取得します。", "kbn.embeddable.search.displayName": "検索", - "kbn.home.addData.apm.addApmButtonLabel": "APM を追加", - "kbn.home.addData.apm.nameDescription": "APM は、集約内から自動的に詳細なパフォーマンスメトリックやエラーを集めます。", - "kbn.home.addData.apm.nameTitle": "APM", - "kbn.home.addData.logging.addLogDataButtonLabel": "ログデータを追加", - "kbn.home.addData.logging.nameDescription": "頻繁に使用するデータソースからログを投入し、構成済みのダッシュボードで簡単に可視化できます。", - "kbn.home.addData.logging.nameTitle": "ログ", - "kbn.home.addData.metrics.addMetricsDataButtonLabel": "メトリックデータを追加", - "kbn.home.addData.metrics.nameDescription": "サーバーのオペレーティングシステムと実行中のサービスからメトリックを収集します。", - "kbn.home.addData.metrics.nameTitle": "メトリック", - "kbn.home.addData.sampleDataLink": "データセットと Kibana ダッシュボードを読み込む", - "kbn.home.addData.sampleDataTitle": "サンプルデータの追加", - "kbn.home.addData.siem.addSiemEventsButtonLabel": "セキュリティイベントを追加", - "kbn.home.addData.siem.nameDescription": "即利用可能なビジュアライゼーションで、セキュリティイベントをまとめてインタラクティブな調査を可能にします。", - "kbn.home.addData.siem.nameTitle": "SIEM", - "kbn.home.addData.uploadFileLink": "CSV、NDJSON、またはログファイルをインポート", - "kbn.home.addData.uploadFileTitle": "ログファイルからデータをアップロード", - "kbn.home.addData.yourDataLink": "Elasticsearch インデックスに接続", - "kbn.home.addData.yourDataTitle": "Elasticsearch データの使用", - "kbn.home.breadcrumbs.addDataTitle": "データの投入", - "kbn.home.breadcrumbs.homeTitle": "ホーム", - "kbn.home.dataManagementDisableCollection": "収集を停止するには、", - "kbn.home.dataManagementDisableCollectionLink": "ここで使用状況データを無効にします。", - "kbn.home.dataManagementDisclaimerPrivacy": "使用状況データがどのように製品とサービスの管理と改善につながるのかに関する詳細については ", - "kbn.home.dataManagementDisclaimerPrivacyLink": "プライバシーポリシーをご覧ください。", - "kbn.home.dataManagementEnableCollection": " 収集を開始するには、", - "kbn.home.dataManagementEnableCollectionLink": "ここで使用状況データを有効にします。", - "kbn.home.directories.manage.nameTitle": "Elastic Stack の管理", - "kbn.home.directories.notFound.description": "お探しのものが見つかりませんでしたか?", - "kbn.home.directories.notFound.viewFullButtonLabel": "Kibana プラグインの完全なディレクトリを表示", - "kbn.home.directories.visualize.nameTitle": "データの可視化と閲覧", - "kbn.home.directory.directoryTitle": "ディレクトリ", - "kbn.home.directory.tabs.administrativeTitle": "管理", - "kbn.home.directory.tabs.allTitle": "すべて", - "kbn.home.directory.tabs.dataTitle": "データの閲覧と可視化", - "kbn.home.directory.tabs.otherTitle": "その他", - "kbn.home.exploreButtonLabel": "独りで閲覧", - "kbn.home.exploreYourDataDescription": "すべてのステップを終えたら、データ閲覧準備の完了です。", - "kbn.home.letsStartDescription": "クラスターにデータがありません。サンプルデータやダッシュボードで試すこともできますし、いきなり独自のデータを使用することもできます。", - "kbn.home.letsStartTitle": "始めましょう", - "kbn.home.loadTutorials.requestFailedErrorMessage": "リクエスト失敗、ステータスコード: {status}", - "kbn.home.loadTutorials.unableToLoadErrorMessage": "チュートリアルが読み込めません。", - "kbn.home.recentlyAccessed.recentlyViewedTitle": "最近閲覧", - "kbn.home.sampleDataSet.installedLabel": "{name} がインストールされました", - "kbn.home.sampleDataSet.unableToInstallErrorMessage": "サンプルデータセット「{name}」をインストールできません", - "kbn.home.sampleDataSet.unableToLoadListErrorMessage": "サンプルデータセットのリストを読み込めません", - "kbn.home.sampleDataSet.unableToUninstallErrorMessage": "サンプルデータセット「{name}」をアンインストールできません", - "kbn.home.sampleDataSet.uninstalledLabel": "{name} がアンインストールされました", - "kbn.home.sampleDataSetCard.addButtonAriaLabel": "{datasetName} を追加", - "kbn.home.sampleDataSetCard.addButtonLabel": "データの投入", - "kbn.home.sampleDataSetCard.addingButtonAriaLabel": "{datasetName} を追加中", - "kbn.home.sampleDataSetCard.addingButtonLabel": "追加中", - "kbn.home.sampleDataSetCard.dashboardLinkLabel": "ダッシュボード", - "kbn.home.sampleDataSetCard.default.addButtonAriaLabel": "{datasetName} を追加", - "kbn.home.sampleDataSetCard.default.addButtonLabel": "データの投入", - "kbn.home.sampleDataSetCard.default.unableToVerifyErrorMessage": "データセットステータスを確認できません、エラー: {statusMsg}", - "kbn.home.sampleDataSetCard.removeButtonAriaLabel": "{datasetName} を削除", - "kbn.home.sampleDataSetCard.removeButtonLabel": "削除", - "kbn.home.sampleDataSetCard.removingButtonAriaLabel": "{datasetName} を削除中", - "kbn.home.sampleDataSetCard.removingButtonLabel": "削除中", - "kbn.home.sampleDataSetCard.viewDataButtonAriaLabel": "{datasetName} を表示", - "kbn.home.sampleDataSetCard.viewDataButtonLabel": "データを表示", - "kbn.home.tryButtonLabel": "サンプルデータを試す", - "kbn.home.tutorial.addDataToKibanaTitle": "Kibana にデータを追加", - "kbn.home.tutorial.card.sampleDataDescription": "これらの「ワンクリック」データセットで Kibana の探索を始めましょう。", - "kbn.home.tutorial.card.sampleDataTitle": "サンプルデータ", - "kbn.home.tutorial.elasticCloudButtonLabel": "Elastic Cloud", - "kbn.home.tutorial.instruction.copyButtonLabel": "スニペットをコピー", - "kbn.home.tutorial.instructionSet.checkStatusButtonLabel": "ステータスを確認", - "kbn.home.tutorial.instructionSet.customizeLabel": "コードスニペットのカスタマイズ", - "kbn.home.tutorial.instructionSet.noDataLabel": "データが見つかりません", - "kbn.home.tutorial.instructionSet.statusCheckTitle": "ステータス確認", - "kbn.home.tutorial.instructionSet.successLabel": "成功", - "kbn.home.tutorial.instructionSet.toggleAriaLabel": "コマンドパラメーターの可視性を調整します", - "kbn.home.tutorial.introduction.betaLabel": "ベータ", - "kbn.home.tutorial.introduction.imageAltDescription": "プライマリダッシュボードのスクリーンショット", - "kbn.home.tutorial.introduction.viewButtonLabel": "エクスポートされたフィールドを表示", - "kbn.home.tutorial.noTutorialLabel": "チュートリアル {tutorialId} が見つかりません", - "kbn.home.tutorial.savedObject.addedLabel": "{savedObjectsLength} 件の保存されたオブジェクトが追加されました", - "kbn.home.tutorial.savedObject.confirmButtonLabel": "上書きを確定", - "kbn.home.tutorial.savedObject.defaultButtonLabel": "Kibana オブジェクトを読み込む", - "kbn.home.tutorial.savedObject.installLabel": "インデックスパターン、ビジュアライゼーション、事前定義済みのダッシュボードをインポートします。", - "kbn.home.tutorial.savedObject.installStatusLabel": "{savedObjectsLength} 件中 {overwriteErrorsLength} 件のオブジェクトが既に存在します。インポートして既存のオブジェクトを上書きするには、「上書きを確定」をクリックしてください。オブジェクトへの変更はすべて失われます。", - "kbn.home.tutorial.savedObject.loadTitle": "Kibana オブジェクトを読み込む", - "kbn.home.tutorial.savedObject.requestFailedErrorMessage": "リクエスト失敗、エラー: {message}", - "kbn.home.tutorial.savedObject.unableToAddErrorMessage": "{savedObjectsLength} 件中 {errorsLength} 件の kibana オブジェクトが追加できません、エラー: {errorMessage}", - "kbn.home.tutorial.selfManagedButtonLabel": "セルフマネージド", - "kbn.home.tutorial.tabs.allTitle": "すべて", - "kbn.home.tutorial.tabs.loggingTitle": "ログ", - "kbn.home.tutorial.tabs.metricsTitle": "メトリック", - "kbn.home.tutorial.tabs.sampleDataTitle": "サンプルデータ", - "kbn.home.tutorial.tabs.siemTitle": "SIEM", - "kbn.home.tutorial.unexpectedStatusCheckStateErrorDescription": "予期せぬステータス確認ステータス {statusCheckState}", - "kbn.home.tutorial.unhandledInstructionTypeErrorDescription": "予期せぬ指示タイプ {visibleInstructions}", - "kbn.home.welcomeDescription": "Elastic Stack への開かれた窓", - "kbn.home.welcomeHomePageHeader": "Kibana ホーム", - "kbn.home.welcomeTitle": "Kibana へようこそ", "kbn.management.createIndexPattern.betaLabel": "ベータ", "kbn.management.createIndexPattern.emptyState.checkDataButton": "新規データを確認", "kbn.management.createIndexPattern.emptyStateHeader": "Elasticsearch データが見つかりませんでした", @@ -1647,6 +1551,99 @@ "kibana_legacy.notify.toaster.errorMessage": "错误:{errorMessage}\n {errorStack}", "kibana_legacy.notify.toaster.errorStatusMessage": "错误 {errStatus} {errStatusText}:{errMessage}", "kibana_legacy.notify.toaster.unavailableServerErrorMessage": "HTTP 请求无法连接。请检查 Kibana 服务器是否正在运行以及您的浏览器是否具有有效的连接,或请联系您的系统管理员。", + "home.addData.apm.addApmButtonLabel": "APM を追加", + "home.addData.apm.nameDescription": "APM は、集約内から自動的に詳細なパフォーマンスメトリックやエラーを集めます。", + "home.addData.apm.nameTitle": "APM", + "home.addData.logging.addLogDataButtonLabel": "ログデータを追加", + "home.addData.logging.nameDescription": "頻繁に使用するデータソースからログを投入し、構成済みのダッシュボードで簡単に可視化できます。", + "home.addData.logging.nameTitle": "ログ", + "home.addData.metrics.addMetricsDataButtonLabel": "メトリックデータを追加", + "home.addData.metrics.nameDescription": "サーバーのオペレーティングシステムと実行中のサービスからメトリックを収集します。", + "home.addData.metrics.nameTitle": "メトリック", + "home.addData.sampleDataLink": "データセットと Kibana ダッシュボードを読み込む", + "home.addData.sampleDataTitle": "サンプルデータの追加", + "home.addData.siem.addSiemEventsButtonLabel": "セキュリティイベントを追加", + "home.addData.siem.nameDescription": "即利用可能なビジュアライゼーションで、セキュリティイベントをまとめてインタラクティブな調査を可能にします。", + "home.addData.siem.nameTitle": "SIEM", + "home.addData.uploadFileLink": "CSV、NDJSON、またはログファイルをインポート", + "home.addData.uploadFileTitle": "ログファイルからデータをアップロード", + "home.addData.yourDataLink": "Elasticsearch インデックスに接続", + "home.addData.yourDataTitle": "Elasticsearch データの使用", + "home.breadcrumbs.addDataTitle": "データの投入", + "home.breadcrumbs.homeTitle": "ホーム", + "home.dataManagementDisableCollection": "収集を停止するには、", + "home.dataManagementDisableCollectionLink": "ここで使用状況データを無効にします。", + "home.dataManagementDisclaimerPrivacy": "使用状況データがどのように製品とサービスの管理と改善につながるのかに関する詳細については ", + "home.dataManagementDisclaimerPrivacyLink": "プライバシーポリシーをご覧ください。", + "home.dataManagementEnableCollection": " 収集を開始するには、", + "home.dataManagementEnableCollectionLink": "ここで使用状況データを有効にします。", + "home.directories.manage.nameTitle": "Elastic Stack の管理", + "home.directories.notFound.description": "お探しのものが見つかりませんでしたか?", + "home.directories.notFound.viewFullButtonLabel": "Kibana プラグインの完全なディレクトリを表示", + "home.directories.visualize.nameTitle": "データの可視化と閲覧", + "home.directory.directoryTitle": "ディレクトリ", + "home.directory.tabs.administrativeTitle": "管理", + "home.directory.tabs.allTitle": "すべて", + "home.directory.tabs.dataTitle": "データの閲覧と可視化", + "home.directory.tabs.otherTitle": "その他", + "home.exploreButtonLabel": "独りで閲覧", + "home.exploreYourDataDescription": "すべてのステップを終えたら、データ閲覧準備の完了です。", + "home.letsStartDescription": "クラスターにデータがありません。サンプルデータやダッシュボードで試すこともできますし、いきなり独自のデータを使用することもできます。", + "home.letsStartTitle": "始めましょう", + "home.loadTutorials.requestFailedErrorMessage": "リクエスト失敗、ステータスコード: {status}", + "home.loadTutorials.unableToLoadErrorMessage": "チュートリアルが読み込めません。", + "home.recentlyAccessed.recentlyViewedTitle": "最近閲覧", + "home.sampleDataSet.installedLabel": "{name} がインストールされました", + "home.sampleDataSet.unableToInstallErrorMessage": "サンプルデータセット「{name}」をインストールできません", + "home.sampleDataSet.unableToLoadListErrorMessage": "サンプルデータセットのリストを読み込めません", + "home.sampleDataSet.unableToUninstallErrorMessage": "サンプルデータセット「{name}」をアンインストールできません", + "home.sampleDataSet.uninstalledLabel": "{name} がアンインストールされました", + "home.sampleDataSetCard.addButtonAriaLabel": "{datasetName} を追加", + "home.sampleDataSetCard.addButtonLabel": "データの投入", + "home.sampleDataSetCard.addingButtonAriaLabel": "{datasetName} を追加中", + "home.sampleDataSetCard.addingButtonLabel": "追加中", + "home.sampleDataSetCard.dashboardLinkLabel": "ダッシュボード", + "home.sampleDataSetCard.default.addButtonAriaLabel": "{datasetName} を追加", + "home.sampleDataSetCard.default.addButtonLabel": "データの投入", + "home.sampleDataSetCard.default.unableToVerifyErrorMessage": "データセットステータスを確認できません、エラー: {statusMsg}", + "home.sampleDataSetCard.removeButtonAriaLabel": "{datasetName} を削除", + "home.sampleDataSetCard.removeButtonLabel": "削除", + "home.sampleDataSetCard.removingButtonAriaLabel": "{datasetName} を削除中", + "home.sampleDataSetCard.removingButtonLabel": "削除中", + "home.sampleDataSetCard.viewDataButtonAriaLabel": "{datasetName} を表示", + "home.sampleDataSetCard.viewDataButtonLabel": "データを表示", + "home.tryButtonLabel": "サンプルデータを試す", + "home.tutorial.addDataToKibanaTitle": "Kibana にデータを追加", + "home.tutorial.card.sampleDataDescription": "これらの「ワンクリック」データセットで Kibana の探索を始めましょう。", + "home.tutorial.card.sampleDataTitle": "サンプルデータ", + "home.tutorial.elasticCloudButtonLabel": "Elastic Cloud", + "home.tutorial.instruction.copyButtonLabel": "スニペットをコピー", + "home.tutorial.instructionSet.checkStatusButtonLabel": "ステータスを確認", + "home.tutorial.instructionSet.customizeLabel": "コードスニペットのカスタマイズ", + "home.tutorial.instructionSet.noDataLabel": "データが見つかりません", + "home.tutorial.instructionSet.statusCheckTitle": "ステータス確認", + "home.tutorial.instructionSet.successLabel": "成功", + "home.tutorial.instructionSet.toggleAriaLabel": "コマンドパラメーターの可視性を調整します", + "home.tutorial.introduction.betaLabel": "ベータ", + "home.tutorial.introduction.imageAltDescription": "プライマリダッシュボードのスクリーンショット", + "home.tutorial.introduction.viewButtonLabel": "エクスポートされたフィールドを表示", + "home.tutorial.noTutorialLabel": "チュートリアル {tutorialId} が見つかりません", + "home.tutorial.savedObject.addedLabel": "{savedObjectsLength} 件の保存されたオブジェクトが追加されました", + "home.tutorial.savedObject.confirmButtonLabel": "上書きを確定", + "home.tutorial.savedObject.defaultButtonLabel": "Kibana オブジェクトを読み込む", + "home.tutorial.savedObject.installLabel": "インデックスパターン、ビジュアライゼーション、事前定義済みのダッシュボードをインポートします。", + "home.tutorial.savedObject.installStatusLabel": "{savedObjectsLength} 件中 {overwriteErrorsLength} 件のオブジェクトが既に存在します。インポートして既存のオブジェクトを上書きするには、「上書きを確定」をクリックしてください。オブジェクトへの変更はすべて失われます。", + "home.tutorial.savedObject.loadTitle": "Kibana オブジェクトを読み込む", + "home.tutorial.savedObject.requestFailedErrorMessage": "リクエスト失敗、エラー: {message}", + "home.tutorial.savedObject.unableToAddErrorMessage": "{savedObjectsLength} 件中 {errorsLength} 件の kibana オブジェクトが追加できません、エラー: {errorMessage}", + "home.tutorial.selfManagedButtonLabel": "セルフマネージド", + "home.tutorial.tabs.allTitle": "すべて", + "home.tutorial.tabs.loggingTitle": "ログ", + "home.tutorial.tabs.metricsTitle": "メトリック", + "home.tutorial.tabs.sampleDataTitle": "サンプルデータ", + "home.tutorial.tabs.siemTitle": "SIEM", + "home.tutorial.unexpectedStatusCheckStateErrorDescription": "予期せぬステータス確認ステータス {statusCheckState}", + "home.tutorial.unhandledInstructionTypeErrorDescription": "予期せぬ指示タイプ {visibleInstructions}", "home.tutorials.common.auditbeat.cloudInstructions.gettingStarted.title": "はじめに", "home.tutorials.common.auditbeat.premCloudInstructions.gettingStarted.title": "はじめに", "home.tutorials.common.auditbeat.premInstructions.gettingStarted.title": "はじめに", @@ -2202,6 +2199,9 @@ "home.tutorials.zookeeperMetrics.longDescription": "「{moduleName}」Metricbeat モジュールは、Zookeeper サーバーから内部メトリックを取得します。 [詳細]({learnMoreLink})。", "home.tutorials.zookeeperMetrics.nameTitle": "Zookeeper メトリック", "home.tutorials.zookeeperMetrics.shortDescription": "Zookeeper サーバーから内部メトリックを取得します。", + "home.welcomeDescription": "Elastic Stack への開かれた窓", + "home.welcomeHomePageHeader": "Kibana ホーム", + "home.welcomeTitle": "Kibana へようこそ", "visTypeVislib.area.areaDescription": "折れ線グラフの下の数量を強調します。", "visTypeVislib.area.areaTitle": "エリア", "visTypeVislib.area.countText": "カウント", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 8c9f6729aa076..5a62740ba366f 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1180,102 +1180,6 @@ "kbn.embeddable.inspectorRequestDataTitle": "数据", "kbn.embeddable.inspectorRequestDescription": "此请求将查询 Elasticsearch 以获取搜索的数据。", "kbn.embeddable.search.displayName": "搜索", - "kbn.home.addData.apm.addApmButtonLabel": "添加 APM", - "kbn.home.addData.apm.nameDescription": "APM 自动从您的应用程序内收集深入全面的性能指标和错误。", - "kbn.home.addData.apm.nameTitle": "APM", - "kbn.home.addData.logging.addLogDataButtonLabel": "添加日志数据", - "kbn.home.addData.logging.nameDescription": "从常见的数据源采集日志,并在预配置的仪表板中轻松实现可视化。", - "kbn.home.addData.logging.nameTitle": "日志", - "kbn.home.addData.metrics.addMetricsDataButtonLabel": "添加指标数据", - "kbn.home.addData.metrics.nameDescription": "从您的服务器上运行的操作系统和服务收集指标。", - "kbn.home.addData.metrics.nameTitle": "指标", - "kbn.home.addData.sampleDataLink": "加载数据集和 Kibana 仪表板", - "kbn.home.addData.sampleDataTitle": "添加样例数据", - "kbn.home.addData.siem.addSiemEventsButtonLabel": "添加安全事件", - "kbn.home.addData.siem.nameDescription": "集中安全事件,以通过即用型可视化实现交互式调查。", - "kbn.home.addData.siem.nameTitle": "SIEM", - "kbn.home.addData.uploadFileLink": "导入 CSV、NDJSON 或日志文件", - "kbn.home.addData.uploadFileTitle": "从日志文件上传数据", - "kbn.home.addData.yourDataLink": "连接到您的 Elasticsearch 索引", - "kbn.home.addData.yourDataTitle": "使用 Elasticsearch 数据", - "kbn.home.breadcrumbs.addDataTitle": "添加数据", - "kbn.home.breadcrumbs.homeTitle": "主页", - "kbn.home.dataManagementDisableCollection": "要停止收集,", - "kbn.home.dataManagementDisableCollectionLink": "请在此禁用使用情况数据。", - "kbn.home.dataManagementDisclaimerPrivacy": "要了解使用情况数据如何帮助我们管理和改善产品和服务,请参阅我们的 ", - "kbn.home.dataManagementDisclaimerPrivacyLink": "隐私声明。", - "kbn.home.dataManagementEnableCollection": " 要启动收集,", - "kbn.home.dataManagementEnableCollectionLink": "请在此处启用使用情况数据。", - "kbn.home.directories.manage.nameTitle": "管理 Elastic Stack", - "kbn.home.directories.notFound.description": "未找到要寻找的内容?", - "kbn.home.directories.notFound.viewFullButtonLabel": "查看 Kibana 插件的完整目录", - "kbn.home.directories.visualize.nameTitle": "可视化和浏览数据", - "kbn.home.directory.directoryTitle": "目录", - "kbn.home.directory.tabs.administrativeTitle": "管理", - "kbn.home.directory.tabs.allTitle": "全部", - "kbn.home.directory.tabs.dataTitle": "数据浏览和可视化", - "kbn.home.directory.tabs.otherTitle": "其他", - "kbn.home.exploreButtonLabel": "自己浏览", - "kbn.home.exploreYourDataDescription": "完成所有步骤后,您便可以随时浏览自己的数据。", - "kbn.home.letsStartDescription": "我们注意到在您的集群中没有任何数据。您可以试用我们的样例数据和仪表板,也可以直接使用自己的数据。", - "kbn.home.letsStartTitle": "开始使用", - "kbn.home.loadTutorials.requestFailedErrorMessage": "请求失败,状态代码:{status}", - "kbn.home.loadTutorials.unableToLoadErrorMessage": "无法加载教程", - "kbn.home.recentlyAccessed.recentlyViewedTitle": "最近查看", - "kbn.home.sampleDataSet.installedLabel": "{name} 已安装", - "kbn.home.sampleDataSet.unableToInstallErrorMessage": "无法安装样例数据集:{name}", - "kbn.home.sampleDataSet.unableToLoadListErrorMessage": "无法加载样例数据集列表", - "kbn.home.sampleDataSet.unableToUninstallErrorMessage": "无法卸载样例数据集:{name}", - "kbn.home.sampleDataSet.uninstalledLabel": "{name} 已卸载", - "kbn.home.sampleDataSetCard.addButtonAriaLabel": "添加{datasetName}", - "kbn.home.sampleDataSetCard.addButtonLabel": "添加数据", - "kbn.home.sampleDataSetCard.addingButtonAriaLabel": "正在添加 {datasetName}", - "kbn.home.sampleDataSetCard.addingButtonLabel": "正在添加", - "kbn.home.sampleDataSetCard.dashboardLinkLabel": "仪表板", - "kbn.home.sampleDataSetCard.default.addButtonAriaLabel": "添加{datasetName}", - "kbn.home.sampleDataSetCard.default.addButtonLabel": "添加数据", - "kbn.home.sampleDataSetCard.default.unableToVerifyErrorMessage": "无法确认数据集状态,错误:{statusMsg}", - "kbn.home.sampleDataSetCard.removeButtonAriaLabel": "移除 {datasetName}", - "kbn.home.sampleDataSetCard.removeButtonLabel": "删除", - "kbn.home.sampleDataSetCard.removingButtonAriaLabel": "正在移除 {datasetName}", - "kbn.home.sampleDataSetCard.removingButtonLabel": "正在删除", - "kbn.home.sampleDataSetCard.viewDataButtonAriaLabel": "查看“{datasetName}”", - "kbn.home.sampleDataSetCard.viewDataButtonLabel": "查看数据", - "kbn.home.tryButtonLabel": "试用我的样例数据", - "kbn.home.tutorial.addDataToKibanaTitle": "将数据添加到 Kibana", - "kbn.home.tutorial.card.sampleDataDescription": "开始使用这些“一键式”数据集浏览 Kibana。", - "kbn.home.tutorial.card.sampleDataTitle": "样例数据", - "kbn.home.tutorial.elasticCloudButtonLabel": "Elastic Cloud", - "kbn.home.tutorial.instruction.copyButtonLabel": "复制代码片段", - "kbn.home.tutorial.instructionSet.checkStatusButtonLabel": "检查状态", - "kbn.home.tutorial.instructionSet.customizeLabel": "定制您的代码片段", - "kbn.home.tutorial.instructionSet.noDataLabel": "未找到任何数据", - "kbn.home.tutorial.instructionSet.statusCheckTitle": "状态检查", - "kbn.home.tutorial.instructionSet.successLabel": "成功", - "kbn.home.tutorial.instructionSet.toggleAriaLabel": "切换命令参数可见性", - "kbn.home.tutorial.introduction.betaLabel": "公测版", - "kbn.home.tutorial.introduction.imageAltDescription": "主仪表板的截图。", - "kbn.home.tutorial.introduction.viewButtonLabel": "查看导出的字段", - "kbn.home.tutorial.noTutorialLabel": "无法找到教程 {tutorialId}", - "kbn.home.tutorial.savedObject.addedLabel": "{savedObjectsLength} 个已保存对象已成功添加", - "kbn.home.tutorial.savedObject.confirmButtonLabel": "确认覆盖", - "kbn.home.tutorial.savedObject.defaultButtonLabel": "加载 Kibana 对象", - "kbn.home.tutorial.savedObject.installLabel": "导入索引模式、可视化和预定义仪表板。", - "kbn.home.tutorial.savedObject.installStatusLabel": "{savedObjectsLength} 个对象中有 {overwriteErrorsLength} 个已存在。单击“确认覆盖”以导入和覆盖现有对象。对这些对象的任何更改将丢失。", - "kbn.home.tutorial.savedObject.loadTitle": "加载 Kibana 对象", - "kbn.home.tutorial.savedObject.requestFailedErrorMessage": "请求失败,错误:{message}", - "kbn.home.tutorial.savedObject.unableToAddErrorMessage": "{savedObjectsLength} 个 kibana 对象中有 {errorsLength} 个无法添加,错误:{errorMessage}", - "kbn.home.tutorial.selfManagedButtonLabel": "自管型", - "kbn.home.tutorial.tabs.allTitle": "全部", - "kbn.home.tutorial.tabs.loggingTitle": "日志", - "kbn.home.tutorial.tabs.metricsTitle": "指标", - "kbn.home.tutorial.tabs.sampleDataTitle": "样例数据", - "kbn.home.tutorial.tabs.siemTitle": "SIEM", - "kbn.home.tutorial.unexpectedStatusCheckStateErrorDescription": "意外的状态检查状态 {statusCheckState}", - "kbn.home.tutorial.unhandledInstructionTypeErrorDescription": "未处理的指令类型 {visibleInstructions}", - "kbn.home.welcomeDescription": "您了解 Elastic Stack 的窗口", - "kbn.home.welcomeHomePageHeader": "Kibana 主页", - "kbn.home.welcomeTitle": "欢迎使用 Kibana", "kbn.management.createIndexPattern.betaLabel": "公测版", "kbn.management.createIndexPattern.emptyState.checkDataButton": "检查新数据", "kbn.management.createIndexPattern.emptyStateHeader": "找不到任何 Elasticsearch 数据", @@ -1648,6 +1552,99 @@ "kibana_legacy.notify.toaster.errorMessage": "错误:{errorMessage}\n {errorStack}", "kibana_legacy.notify.toaster.errorStatusMessage": "错误 {errStatus} {errStatusText}:{errMessage}", "kibana_legacy.notify.toaster.unavailableServerErrorMessage": "HTTP 请求无法连接。请检查 Kibana 服务器是否正在运行以及您的浏览器是否具有有效的连接,或请联系您的系统管理员。", + "home.addData.apm.addApmButtonLabel": "添加 APM", + "home.addData.apm.nameDescription": "APM 自动从您的应用程序内收集深入全面的性能指标和错误。", + "home.addData.apm.nameTitle": "APM", + "home.addData.logging.addLogDataButtonLabel": "添加日志数据", + "home.addData.logging.nameDescription": "从常见的数据源采集日志,并在预配置的仪表板中轻松实现可视化。", + "home.addData.logging.nameTitle": "日志", + "home.addData.metrics.addMetricsDataButtonLabel": "添加指标数据", + "home.addData.metrics.nameDescription": "从您的服务器上运行的操作系统和服务收集指标。", + "home.addData.metrics.nameTitle": "指标", + "home.addData.sampleDataLink": "加载数据集和 Kibana 仪表板", + "home.addData.sampleDataTitle": "添加样例数据", + "home.addData.siem.addSiemEventsButtonLabel": "添加安全事件", + "home.addData.siem.nameDescription": "集中安全事件,以通过即用型可视化实现交互式调查。", + "home.addData.siem.nameTitle": "SIEM", + "home.addData.uploadFileLink": "导入 CSV、NDJSON 或日志文件", + "home.addData.uploadFileTitle": "从日志文件上传数据", + "home.addData.yourDataLink": "连接到您的 Elasticsearch 索引", + "home.addData.yourDataTitle": "使用 Elasticsearch 数据", + "home.breadcrumbs.addDataTitle": "添加数据", + "home.breadcrumbs.homeTitle": "主页", + "home.dataManagementDisableCollection": "要停止收集,", + "home.dataManagementDisableCollectionLink": "请在此禁用使用情况数据。", + "home.dataManagementDisclaimerPrivacy": "要了解使用情况数据如何帮助我们管理和改善产品和服务,请参阅我们的 ", + "home.dataManagementDisclaimerPrivacyLink": "隐私声明。", + "home.dataManagementEnableCollection": " 要启动收集,", + "home.dataManagementEnableCollectionLink": "请在此处启用使用情况数据。", + "home.directories.manage.nameTitle": "管理 Elastic Stack", + "home.directories.notFound.description": "未找到要寻找的内容?", + "home.directories.notFound.viewFullButtonLabel": "查看 Kibana 插件的完整目录", + "home.directories.visualize.nameTitle": "可视化和浏览数据", + "home.directory.directoryTitle": "目录", + "home.directory.tabs.administrativeTitle": "管理", + "home.directory.tabs.allTitle": "全部", + "home.directory.tabs.dataTitle": "数据浏览和可视化", + "home.directory.tabs.otherTitle": "其他", + "home.exploreButtonLabel": "自己浏览", + "home.exploreYourDataDescription": "完成所有步骤后,您便可以随时浏览自己的数据。", + "home.letsStartDescription": "我们注意到在您的集群中没有任何数据。您可以试用我们的样例数据和仪表板,也可以直接使用自己的数据。", + "home.letsStartTitle": "开始使用", + "home.loadTutorials.requestFailedErrorMessage": "请求失败,状态代码:{status}", + "home.loadTutorials.unableToLoadErrorMessage": "无法加载教程", + "home.recentlyAccessed.recentlyViewedTitle": "最近查看", + "home.sampleDataSet.installedLabel": "{name} 已安装", + "home.sampleDataSet.unableToInstallErrorMessage": "无法安装样例数据集:{name}", + "home.sampleDataSet.unableToLoadListErrorMessage": "无法加载样例数据集列表", + "home.sampleDataSet.unableToUninstallErrorMessage": "无法卸载样例数据集:{name}", + "home.sampleDataSet.uninstalledLabel": "{name} 已卸载", + "home.sampleDataSetCard.addButtonAriaLabel": "添加{datasetName}", + "home.sampleDataSetCard.addButtonLabel": "添加数据", + "home.sampleDataSetCard.addingButtonAriaLabel": "正在添加 {datasetName}", + "home.sampleDataSetCard.addingButtonLabel": "正在添加", + "home.sampleDataSetCard.dashboardLinkLabel": "仪表板", + "home.sampleDataSetCard.default.addButtonAriaLabel": "添加{datasetName}", + "home.sampleDataSetCard.default.addButtonLabel": "添加数据", + "home.sampleDataSetCard.default.unableToVerifyErrorMessage": "无法确认数据集状态,错误:{statusMsg}", + "home.sampleDataSetCard.removeButtonAriaLabel": "移除 {datasetName}", + "home.sampleDataSetCard.removeButtonLabel": "删除", + "home.sampleDataSetCard.removingButtonAriaLabel": "正在移除 {datasetName}", + "home.sampleDataSetCard.removingButtonLabel": "正在删除", + "home.sampleDataSetCard.viewDataButtonAriaLabel": "查看“{datasetName}”", + "home.sampleDataSetCard.viewDataButtonLabel": "查看数据", + "home.tryButtonLabel": "试用我的样例数据", + "home.tutorial.addDataToKibanaTitle": "将数据添加到 Kibana", + "home.tutorial.card.sampleDataDescription": "开始使用这些“一键式”数据集浏览 Kibana。", + "home.tutorial.card.sampleDataTitle": "样例数据", + "home.tutorial.elasticCloudButtonLabel": "Elastic Cloud", + "home.tutorial.instruction.copyButtonLabel": "复制代码片段", + "home.tutorial.instructionSet.checkStatusButtonLabel": "检查状态", + "home.tutorial.instructionSet.customizeLabel": "定制您的代码片段", + "home.tutorial.instructionSet.noDataLabel": "未找到任何数据", + "home.tutorial.instructionSet.statusCheckTitle": "状态检查", + "home.tutorial.instructionSet.successLabel": "成功", + "home.tutorial.instructionSet.toggleAriaLabel": "切换命令参数可见性", + "home.tutorial.introduction.betaLabel": "公测版", + "home.tutorial.introduction.imageAltDescription": "主仪表板的截图。", + "home.tutorial.introduction.viewButtonLabel": "查看导出的字段", + "home.tutorial.noTutorialLabel": "无法找到教程 {tutorialId}", + "home.tutorial.savedObject.addedLabel": "{savedObjectsLength} 个已保存对象已成功添加", + "home.tutorial.savedObject.confirmButtonLabel": "确认覆盖", + "home.tutorial.savedObject.defaultButtonLabel": "加载 Kibana 对象", + "home.tutorial.savedObject.installLabel": "导入索引模式、可视化和预定义仪表板。", + "home.tutorial.savedObject.installStatusLabel": "{savedObjectsLength} 个对象中有 {overwriteErrorsLength} 个已存在。单击“确认覆盖”以导入和覆盖现有对象。对这些对象的任何更改将丢失。", + "home.tutorial.savedObject.loadTitle": "加载 Kibana 对象", + "home.tutorial.savedObject.requestFailedErrorMessage": "请求失败,错误:{message}", + "home.tutorial.savedObject.unableToAddErrorMessage": "{savedObjectsLength} 个 kibana 对象中有 {errorsLength} 个无法添加,错误:{errorMessage}", + "home.tutorial.selfManagedButtonLabel": "自管型", + "home.tutorial.tabs.allTitle": "全部", + "home.tutorial.tabs.loggingTitle": "日志", + "home.tutorial.tabs.metricsTitle": "指标", + "home.tutorial.tabs.sampleDataTitle": "样例数据", + "home.tutorial.tabs.siemTitle": "SIEM", + "home.tutorial.unexpectedStatusCheckStateErrorDescription": "意外的状态检查状态 {statusCheckState}", + "home.tutorial.unhandledInstructionTypeErrorDescription": "未处理的指令类型 {visibleInstructions}", "home.tutorials.common.auditbeat.cloudInstructions.gettingStarted.title": "入门", "home.tutorials.common.auditbeat.premCloudInstructions.gettingStarted.title": "入门", "home.tutorials.common.auditbeat.premInstructions.gettingStarted.title": "入门", @@ -2203,6 +2200,9 @@ "home.tutorials.zookeeperMetrics.longDescription": "Metricbeat 模块 `{moduleName}` 从 Zookeeper 服务器提取内部指标。[了解详情]({learnMoreLink})。", "home.tutorials.zookeeperMetrics.nameTitle": "Zookeeper 指标", "home.tutorials.zookeeperMetrics.shortDescription": "从 Zookeeper 服务器提取内部指标。", + "home.welcomeDescription": "您了解 Elastic Stack 的窗口", + "home.welcomeHomePageHeader": "Kibana 主页", + "home.welcomeTitle": "欢迎使用 Kibana", "visTypeVislib.area.areaDescription": "突出折线图下方的数量", "visTypeVislib.area.areaTitle": "面积图", "visTypeVislib.area.countText": "计数",