diff --git a/package.json b/package.json index 98b2252cc0dba1..950a916b2419f7 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.14", "@elastic/ems-client": "7.14.0", - "@elastic/eui": "36.1.0", + "@elastic/eui": "37.1.1", "@elastic/filesaver": "1.1.2", "@elastic/good": "^9.0.1-kibana3", "@elastic/maki": "6.3.0", diff --git a/packages/kbn-rule-data-utils/src/alerts_as_data_rbac.ts b/packages/kbn-rule-data-utils/src/alerts_as_data_rbac.ts index 476425487df1bf..719301bce8e068 100644 --- a/packages/kbn-rule-data-utils/src/alerts_as_data_rbac.ts +++ b/packages/kbn-rule-data-utils/src/alerts_as_data_rbac.ts @@ -13,9 +13,6 @@ import type { EsQueryConfig } from '@kbn/es-query'; * registering a new instance of the rule data client * in a new plugin will require updating the below data structure * to include the index name where the alerts as data will be written to. - * - * This doesn't work in combination with the `xpack.ruleRegistry.index` - * setting, with which the user can change the index prefix. */ export const AlertConsumers = { @@ -24,7 +21,7 @@ export const AlertConsumers = { INFRASTRUCTURE: 'infrastructure', OBSERVABILITY: 'observability', SIEM: 'siem', - SYNTHETICS: 'synthetics', + UPTIME: 'uptime', } as const; export type AlertConsumers = typeof AlertConsumers[keyof typeof AlertConsumers]; export type STATUS_VALUES = 'open' | 'acknowledged' | 'closed' | 'in-progress'; // TODO: remove 'in-progress' after migration to 'acknowledged' @@ -35,7 +32,7 @@ export const mapConsumerToIndexName: Record = infrastructure: '.alerts-observability.metrics', observability: '.alerts-observability', siem: ['.alerts-security.alerts', '.siem-signals'], - synthetics: '.alerts-observability-synthetics', + uptime: '.alerts-observability.uptime', }; export type ValidFeatureId = keyof typeof mapConsumerToIndexName; diff --git a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap index f723cf5bca23af..1f932d62c94b92 100644 --- a/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap +++ b/src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap @@ -100,6 +100,8 @@ exports[`#start() returns \`Context\` component 1`] = ` "euiDataGridSchema.jsonSortTextDesc": "Large-Small", "euiDataGridSchema.numberSortTextAsc": "Low-High", "euiDataGridSchema.numberSortTextDesc": "High-Low", + "euiDatePopoverButton.invalidTitle": [Function], + "euiDatePopoverButton.outdatedTitle": [Function], "euiFieldPassword.maskPassword": "Mask password", "euiFieldPassword.showPassword": "Show password as plain text. Note: this will visually expose your password on the screen.", "euiFilePicker.clearSelectedFiles": "Clear selected files", diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 0a6c7a05e1c75e..98b3fa8f812114 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -497,6 +497,16 @@ export const getEuiContextMapping = (): EuiTokensObject => { description: 'Descending size label', } ), + 'euiDatePopoverButton.invalidTitle': ({ title }: EuiValues) => + i18n.translate('core.euiDatePopoverButton.invalidTitle', { + defaultMessage: 'Invalid date: {title}', + values: { title }, + }), + 'euiDatePopoverButton.outdatedTitle': ({ title }: EuiValues) => + i18n.translate('core.euiDatePopoverButton.outdatedTitle', { + defaultMessage: 'Update needed: {title}', + values: { title }, + }), 'euiFieldPassword.showPassword': i18n.translate('core.euiFieldPassword.showPassword', { defaultMessage: 'Show password as plain text. Note: this will visually expose your password on the screen.', diff --git a/src/core/server/environment/resolve_uuid.test.ts b/src/core/server/environment/resolve_uuid.test.ts index 60d740ef121932..40db2d697906bc 100644 --- a/src/core/server/environment/resolve_uuid.test.ts +++ b/src/core/server/environment/resolve_uuid.test.ts @@ -227,7 +227,7 @@ describe('resolveInstanceUuid', () => { await expect( resolveInstanceUuid({ pathConfig, serverConfig, logger }) ).rejects.toThrowErrorMatchingInlineSnapshot( - `"Unable to read Kibana UUID file, please check the uuid.server configuration value in kibana.yml and ensure Kibana has sufficient permissions to read / write to this file. Error was: EACCES"` + `"Unable to read UUID file at data-folder/uuid. Ensure Kibana has sufficient permissions to read / write to this file. Error was: EACCES"` ); }); it('throws an explicit error for file write errors', async () => { @@ -235,7 +235,7 @@ describe('resolveInstanceUuid', () => { await expect( resolveInstanceUuid({ pathConfig, serverConfig, logger }) ).rejects.toThrowErrorMatchingInlineSnapshot( - `"Unable to write Kibana UUID file, please check the uuid.server configuration value in kibana.yml and ensure Kibana has sufficient permissions to read / write to this file. Error was: EISDIR"` + `"Unable to write to UUID file at data-folder/uuid. Ensure Kibana has sufficient permissions to read / write to this file. Error was: EISDIR"` ); }); }); diff --git a/src/core/server/environment/resolve_uuid.ts b/src/core/server/environment/resolve_uuid.ts index aaee205dfbb902..74201a7ffa04ff 100644 --- a/src/core/server/environment/resolve_uuid.ts +++ b/src/core/server/environment/resolve_uuid.ts @@ -79,8 +79,8 @@ async function readUuidFromFile(filepath: string, logger: Logger): Promise/R +function withContextMock(context: KibanaExecutionContext | undefined, fn: () => any): any { + return fn(); +} + const createExecutionContextMock = () => { const mock: jest.Mocked = { set: jest.fn(), @@ -21,6 +27,7 @@ const createExecutionContextMock = () => { getParentContextFrom: jest.fn(), getAsHeader: jest.fn(), }; + mock.withContext.mockImplementation(withContextMock); return mock; }; const createInternalSetupContractMock = () => { @@ -32,6 +39,7 @@ const createSetupContractMock = () => { const mock: jest.Mocked = { withContext: jest.fn(), }; + mock.withContext.mockImplementation(withContextMock); return mock; }; diff --git a/src/core/server/execution_context/execution_context_service.test.ts b/src/core/server/execution_context/execution_context_service.test.ts index 3abaa13d11103c..3fa4de34ebda08 100644 --- a/src/core/server/execution_context/execution_context_service.test.ts +++ b/src/core/server/execution_context/execution_context_service.test.ts @@ -346,7 +346,7 @@ describe('ExecutionContextService', () => { id: 'id-a', description: 'description-a', }, - (i) => i + () => null ); expect(loggingSystemMock.collect(core.logger).debug).toMatchInlineSnapshot(` Array [ @@ -378,6 +378,26 @@ describe('ExecutionContextService', () => { expect(result).toBeUndefined(); }); + it('executes provided function when disabled', async () => { + const coreWithDisabledService = mockCoreContext.create(); + coreWithDisabledService.configService.atPath.mockReturnValue( + new BehaviorSubject({ enabled: false }) + ); + const disabledService = new ExecutionContextService(coreWithDisabledService).setup(); + const fn = jest.fn(); + + disabledService.withContext( + { + type: 'type-b', + name: 'name-b', + id: 'id-b', + description: 'description-b', + }, + fn + ); + + expect(fn).toHaveBeenCalledTimes(1); + }); }); describe('getAsHeader', () => { @@ -387,6 +407,21 @@ describe('ExecutionContextService', () => { expect(service.getAsHeader()).toBe('1234'); }); + it('falls back to "unknownId" if no id provided', async () => { + expect(service.getAsHeader()).toBe('unknownId'); + }); + + it('falls back to "unknownId" and context if no id provided', async () => { + service.set({ + type: 'type-a', + name: 'name-a', + id: 'id-a', + description: 'description-a', + }); + + expect(service.getAsHeader()).toBe('unknownId;kibana:type-a:name-a:id-a'); + }); + it('returns request id and registered context', async () => { service.setRequestId('1234'); service.set({ diff --git a/src/core/server/execution_context/execution_context_service.ts b/src/core/server/execution_context/execution_context_service.ts index 5a8d104cebcd98..41b225cf1d0f3a 100644 --- a/src/core/server/execution_context/execution_context_service.ts +++ b/src/core/server/execution_context/execution_context_service.ts @@ -34,7 +34,7 @@ export interface IExecutionContext { * https://nodejs.org/api/async_context.html#async_context_asynclocalstorage_enterwith_store */ get(): IExecutionContextContainer | undefined; - withContext(context: KibanaExecutionContext | undefined, fn: (...args: any[]) => R): R; + withContext(context: KibanaExecutionContext | undefined, fn: () => R): R; /** * returns serialized representation to send as a header **/ @@ -153,8 +153,11 @@ export class ExecutionContextService private getAsHeader(): string | undefined { if (!this.enabled) return; - const stringifiedCtx = this.contextStore.getStore()?.toString(); - const requestId = this.requestIdStore.getStore()?.requestId; - return stringifiedCtx ? `${requestId};kibana:${stringifiedCtx}` : requestId; + // requestId may not be present in the case of FakeRequest + const requestId = this.requestIdStore.getStore()?.requestId ?? 'unknownId'; + const executionContext = this.contextStore.getStore()?.toString(); + const executionContextStr = executionContext ? `;kibana:${executionContext}` : ''; + + return `${requestId}${executionContextStr}`; } } diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index e1900019a5b300..46326fcc3b52e7 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -75,7 +75,7 @@ export const LICENSE_OVERRIDES = { '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint 'node-sql-parser@3.6.1': ['(GPL-2.0 OR MIT)'], // GPL-2.0* https://github.com/taozhi8833998/node-sql-parser '@elastic/ems-client@7.14.0': ['Elastic License 2.0'], - '@elastic/eui@36.0.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@37.1.1': ['SSPL-1.0 OR Elastic License 2.0'], // TODO can be removed if the https://github.com/jindw/xmldom/issues/239 is released 'xmldom@0.1.27': ['MIT'], diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index 419d4f0854ecc7..0244cb2cd91150 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -40,6 +40,22 @@ export const PROJECTS = [ createProject('x-pack/plugins/security_solution/cypress/tsconfig.json', { name: 'security_solution/cypress', }), + createProject( + 'x-pack/plugins/enterprise_search/public/applications/shared/cypress/tsconfig.json', + { name: 'enterprise_search/shared/cypress' } + ), + createProject( + 'x-pack/plugins/enterprise_search/public/applications/enterprise_search/cypress/tsconfig.json', + { name: 'enterprise_search/overview/cypress' } + ), + createProject( + 'x-pack/plugins/enterprise_search/public/applications/app_search/cypress/tsconfig.json', + { name: 'enterprise_search/app_search/cypress' } + ), + createProject( + 'x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress/tsconfig.json', + { name: 'enterprise_search/workplace_search/cypress' } + ), createProject('x-pack/plugins/osquery/cypress/tsconfig.json', { name: 'osquery/cypress', }), diff --git a/src/plugins/kibana_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap b/src/plugins/kibana_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap deleted file mode 100644 index b5f501eb88a013..00000000000000 --- a/src/plugins/kibana_overview/public/components/getting_started/__snapshots__/getting_started.test.tsx.snap +++ /dev/null @@ -1,391 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`GettingStarted dark mode on 1`] = ` -
- - -
- -

- -

-
- - -

- -

-
- - - - - } - layout="horizontal" - paddingSize="none" - title="Dashboard" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Discover" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Canvas" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Maps" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Machine Learning" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Graph" - titleElement="h3" - titleSize="xs" - /> - - - - - - - - -
-
- - - -
-
-`; - -exports[`GettingStarted render 1`] = ` -
- - -
- -

- -

-
- - -

- -

-
- - - - - } - layout="horizontal" - paddingSize="none" - title="Dashboard" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Discover" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Canvas" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Maps" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Machine Learning" - titleElement="h3" - titleSize="xs" - /> - - - - } - layout="horizontal" - paddingSize="none" - title="Graph" - titleElement="h3" - titleSize="xs" - /> - - - - - - - - -
-
- - - -
-
-`; diff --git a/src/plugins/kibana_overview/public/components/getting_started/getting_started.test.tsx b/src/plugins/kibana_overview/public/components/getting_started/getting_started.test.tsx deleted file mode 100644 index a2ce059f913f41..00000000000000 --- a/src/plugins/kibana_overview/public/components/getting_started/getting_started.test.tsx +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { GettingStarted } from './getting_started'; -import { shallowWithIntl } from '@kbn/test/jest'; -import { FeatureCatalogueCategory } from 'src/plugins/home/public'; - -const addBasePathMock = jest.fn((path: string) => (path ? path : 'path')); - -const mockApps = [ - { - category: FeatureCatalogueCategory.DATA, - description: 'Display and share a collection of visualizations and saved searches.', - icon: 'dashboardApp', - id: 'dashboard', - order: 100, - path: 'path-to-dashboard', - showOnHomePage: false, - solutionId: 'kibana', - subtitle: 'Analyze data in dashboards.', - title: 'Dashboard', - }, - { - category: FeatureCatalogueCategory.DATA, - description: 'Interactively explore your data by querying and filtering raw documents.', - icon: 'discoverApp', - id: 'discover', - order: 200, - path: 'path-to-discover', - - showOnHomePage: false, - solutionId: 'kibana', - subtitle: 'Search and find insights.', - title: 'Discover', - }, - { - category: FeatureCatalogueCategory.DATA, - description: 'Showcase your data in a pixel-perfect way.', - icon: 'canvasApp', - id: 'canvas', - order: 300, - path: 'path-to-canvas', - - showOnHomePage: false, - solutionId: 'kibana', - subtitle: 'Design pixel-perfect reports.', - title: 'Canvas', - }, - { - category: FeatureCatalogueCategory.DATA, - description: 'Explore geospatial data from Elasticsearch and the Elastic Maps Service.', - icon: 'gisApp', - id: 'maps', - order: 400, - path: 'path-to-maps', - showOnHomePage: false, - solutionId: 'kibana', - subtitle: 'Plot geographic data.', - title: 'Maps', - }, - { - category: FeatureCatalogueCategory.DATA, - description: - 'Automatically model the normal behavior of your time series data to detect anomalies.', - icon: 'machineLearningApp', - id: 'ml', - order: 500, - path: 'path-to-ml', - showOnHomePage: false, - solutionId: 'kibana', - subtitle: 'Model, predict, and detect.', - title: 'Machine Learning', - }, - { - category: FeatureCatalogueCategory.DATA, - description: 'Surface and analyze relevant relationships in your Elasticsearch data.', - icon: 'graphApp', - id: 'graph', - order: 600, - path: 'path-to-graph', - showOnHomePage: false, - solutionId: 'kibana', - subtitle: 'Reveal patterns and relationships.', - title: 'Graph', - }, -]; - -describe('GettingStarted', () => { - test('render', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); - test('dark mode on', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/src/plugins/kibana_overview/public/components/getting_started/getting_started.tsx b/src/plugins/kibana_overview/public/components/getting_started/getting_started.tsx deleted file mode 100644 index 56247c4e91fa12..00000000000000 --- a/src/plugins/kibana_overview/public/components/getting_started/getting_started.tsx +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { FC } from 'react'; -import { - EuiButton, - EuiCard, - EuiFlexGrid, - EuiFlexGroup, - EuiFlexItem, - EuiIcon, - EuiImage, - EuiSpacer, - EuiText, - EuiTitle, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { CoreStart } from 'kibana/public'; -import { RedirectAppLinks, useKibana } from '../../../../../../src/plugins/kibana_react/public'; -import { FeatureCatalogueEntry } from '../../../../../../src/plugins/home/public'; -import { PLUGIN_ID } from '../../../common'; - -interface Props { - addBasePath: (path: string) => string; - isDarkTheme: boolean; - apps: FeatureCatalogueEntry[]; -} - -export const GettingStarted: FC = ({ addBasePath, isDarkTheme, apps }) => { - const { - services: { application }, - } = useKibana(); - const gettingStartedGraphicURL = `/plugins/${PLUGIN_ID}/assets/kibana_montage_${ - isDarkTheme ? 'dark' : 'light' - }.svg`; - - return ( -
- - -
- -

- -

-
- - - - -

- -

-
- - - - - {apps.map(({ subtitle = '', icon, title }) => ( - - } - layout="horizontal" - paddingSize="none" - title={title} - titleElement="h3" - titleSize="xs" - /> - - ))} - - - - - - - - - -
-
- - - - -
-
- ); -}; diff --git a/src/plugins/kibana_overview/public/components/getting_started/index.ts b/src/plugins/kibana_overview/public/components/getting_started/index.ts deleted file mode 100644 index 10977941afeeeb..00000000000000 --- a/src/plugins/kibana_overview/public/components/getting_started/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export * from './getting_started'; diff --git a/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap b/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap index a32e27050fad17..6581fcd88cb77f 100644 --- a/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap +++ b/src/plugins/kibana_overview/public/components/overview/__snapshots__/overview.test.tsx.snap @@ -233,6 +233,9 @@ exports[`Overview render 1`] = ` addBasePath={ [MockFunction] { "calls": Array [ + Array [ + "home#/tutorial_directory", + ], Array [ "kibana_landing_page", ], @@ -259,6 +262,10 @@ exports[`Overview render 1`] = ` ], ], "results": Array [ + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, Object { "type": "return", "value": "kibana_landing_page", @@ -534,6 +541,9 @@ exports[`Overview without features 1`] = ` addBasePath={ [MockFunction] { "calls": Array [ + Array [ + "home#/tutorial_directory", + ], Array [ "kibana_landing_page", ], @@ -558,6 +568,12 @@ exports[`Overview without features 1`] = ` Array [ "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", ], + Array [ + "home#/tutorial_directory", + ], + Array [ + "home#/tutorial_directory", + ], Array [ "kibana_landing_page", ], @@ -584,6 +600,10 @@ exports[`Overview without features 1`] = ` ], ], "results": Array [ + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, Object { "type": "return", "value": "kibana_landing_page", @@ -616,6 +636,14 @@ exports[`Overview without features 1`] = ` "type": "return", "value": "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", }, + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, Object { "type": "return", "value": "kibana_landing_page", @@ -760,6 +788,9 @@ exports[`Overview without solutions 1`] = ` addBasePath={ [MockFunction] { "calls": Array [ + Array [ + "home#/tutorial_directory", + ], Array [ "kibana_landing_page", ], @@ -784,8 +815,15 @@ exports[`Overview without solutions 1`] = ` Array [ "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", ], + Array [ + "home#/tutorial_directory", + ], ], "results": Array [ + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, Object { "type": "return", "value": "kibana_landing_page", @@ -818,6 +856,10 @@ exports[`Overview without solutions 1`] = ` "type": "return", "value": "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", }, + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, ], } } @@ -829,6 +871,9 @@ exports[`Overview without solutions 1`] = ` addBasePath={ [MockFunction] { "calls": Array [ + Array [ + "home#/tutorial_directory", + ], Array [ "kibana_landing_page", ], @@ -853,8 +898,15 @@ exports[`Overview without solutions 1`] = ` Array [ "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", ], + Array [ + "home#/tutorial_directory", + ], ], "results": Array [ + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, Object { "type": "return", "value": "kibana_landing_page", @@ -887,6 +939,10 @@ exports[`Overview without solutions 1`] = ` "type": "return", "value": "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", }, + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, ], } } @@ -904,6 +960,9 @@ exports[`Overview without solutions 1`] = ` addBasePath={ [MockFunction] { "calls": Array [ + Array [ + "home#/tutorial_directory", + ], Array [ "kibana_landing_page", ], @@ -928,8 +987,15 @@ exports[`Overview without solutions 1`] = ` Array [ "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", ], + Array [ + "home#/tutorial_directory", + ], ], "results": Array [ + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, Object { "type": "return", "value": "kibana_landing_page", @@ -962,6 +1028,10 @@ exports[`Overview without solutions 1`] = ` "type": "return", "value": "/plugins/kibanaOverview/assets/solutions_solution_4_2x.png", }, + Object { + "type": "return", + "value": "home#/tutorial_directory", + }, ], } } diff --git a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx index 9d260469625ada..6320b5070a8a67 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx @@ -18,6 +18,11 @@ jest.mock('../../../../../../src/plugins/kibana_react/public', () => ({ http: { basePath: { prepend: jest.fn((path: string) => (path ? path : 'path')) } }, data: { indexPatterns: {} }, uiSettings: { get: jest.fn() }, + docLinks: { + links: { + kibana: 'kibana_docs_url', + }, + }, }, }), RedirectAppLinks: jest.fn((element: JSX.Element) => element), diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index 9bba923371f640..a037cbc214266a 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -24,6 +24,7 @@ import { RedirectAppLinks, useKibana, KibanaPageTemplate, + KibanaPageTemplateProps, overviewPageActions, OverviewPageFooter, } from '../../../../../../src/plugins/kibana_react/public'; @@ -36,7 +37,6 @@ import { import { PLUGIN_ID, PLUGIN_PATH } from '../../../common'; import { AppPluginStartDependencies } from '../../types'; import { AddData } from '../add_data'; -import { GettingStarted } from '../getting_started'; import { ManageData } from '../manage_data'; import { NewsFeed } from '../news_feed'; import { METRIC_TYPE, trackUiMetric } from '../../lib/ui_metric'; @@ -53,7 +53,7 @@ interface Props { export const Overview: FC = ({ newsFetchResult, solutions, features }) => { const [isNewKibanaInstance, setNewKibanaInstance] = useState(false); const { - services: { http, data, uiSettings, application }, + services: { http, docLinks, data, uiSettings, application }, } = useKibana(); const addBasePath = http.basePath.prepend; const indexPatternService = data.indexPatterns; @@ -72,6 +72,16 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) => const addDataFeatures = getFeaturesByCategory(FeatureCatalogueCategory.DATA); const manageDataFeatures = getFeaturesByCategory(FeatureCatalogueCategory.ADMIN); const devTools = findFeatureById('console'); + const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = { + solution: 'Analytics', + logo: 'logoKibana', + actions: { + beats: { + href: addBasePath(`home#/tutorial_directory`), + }, + }, + docsLink: docLinks.links.kibana, + }; // Show card for console if none of the manage data plugins are available, most likely in OSS if (manageDataFeatures.length < 1 && devTools) { @@ -127,126 +137,123 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) => hidden: isNewKibanaInstance, }), }} + noDataConfig={isNewKibanaInstance ? noDataConfig : undefined} template="empty" > - {isNewKibanaInstance ? ( - - ) : ( - <> -
- -

- -

-
- - {mainApps.length ? ( - <> - - {mainApps.map(renderAppCard)} - + <> +
+ +

+ +

+
- - - ) : null} - - {remainingApps.length ? ( + {mainApps.length ? ( + <> - {remainingApps.map(renderAppCard)} + {mainApps.map(renderAppCard)} - ) : null} -
-
- - {newsFetchResult && newsFetchResult.feedItems.length ? ( - - - - ) : null} + +