From 5a6f83f0cee3fb3be97f38977dfac8b3f75dd295 Mon Sep 17 00:00:00 2001 From: Josh Dover Date: Thu, 20 Feb 2020 14:43:15 -0700 Subject: [PATCH] Expose serverBasePath on client-side (#58070) --- .../core/public/kibana-plugin-public.ibasepath.md | 1 + ...bana-plugin-public.ibasepath.serverbasepath.md | 15 +++++++++++++++ src/core/public/http/base_path.test.ts | 10 ++++++++++ src/core/public/http/base_path.ts | 5 ++++- src/core/public/http/http_service.ts | 5 ++++- src/core/public/http/types.ts | 7 +++++++ .../injected_metadata_service.mock.ts | 1 + .../injected_metadata_service.ts | 6 ++++++ src/core/public/public.api.md | 2 ++ .../__snapshots__/rendering_service.test.ts.snap | 10 ++++++++++ src/core/server/rendering/rendering_service.tsx | 2 ++ src/core/server/rendering/types.ts | 1 + .../dashboard_empty_screen.test.tsx.snap | 3 +++ .../query_string_input.test.tsx.snap | 6 ++++++ .../api_keys/api_keys_management_app.test.tsx | 2 +- .../role_mappings_management_app.test.tsx | 6 +++--- .../roles/roles_management_app.test.tsx | 8 ++++---- .../users/users_management_app.test.tsx | 6 +++--- .../management/spaces_management_app.test.tsx | 6 +++--- 19 files changed, 86 insertions(+), 16 deletions(-) create mode 100644 docs/development/core/public/kibana-plugin-public.ibasepath.serverbasepath.md diff --git a/docs/development/core/public/kibana-plugin-public.ibasepath.md b/docs/development/core/public/kibana-plugin-public.ibasepath.md index ca4c4b7ad3be..7f2070eb1fd6 100644 --- a/docs/development/core/public/kibana-plugin-public.ibasepath.md +++ b/docs/development/core/public/kibana-plugin-public.ibasepath.md @@ -19,4 +19,5 @@ export interface IBasePath | [get](./kibana-plugin-public.ibasepath.get.md) | () => string | Gets the basePath string. | | [prepend](./kibana-plugin-public.ibasepath.prepend.md) | (url: string) => string | Prepends path with the basePath. | | [remove](./kibana-plugin-public.ibasepath.remove.md) | (url: string) => string | Removes the prepended basePath from the path. | +| [serverBasePath](./kibana-plugin-public.ibasepath.serverbasepath.md) | string | Returns the server's root basePath as configured, without any namespace prefix.See for getting the basePath value for a specific request | diff --git a/docs/development/core/public/kibana-plugin-public.ibasepath.serverbasepath.md b/docs/development/core/public/kibana-plugin-public.ibasepath.serverbasepath.md new file mode 100644 index 000000000000..0c2b5451767c --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ibasepath.serverbasepath.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IBasePath](./kibana-plugin-public.ibasepath.md) > [serverBasePath](./kibana-plugin-public.ibasepath.serverbasepath.md) + +## IBasePath.serverBasePath property + +Returns the server's root basePath as configured, without any namespace prefix. + +See for getting the basePath value for a specific request + +Signature: + +```typescript +readonly serverBasePath: string; +``` diff --git a/src/core/public/http/base_path.test.ts b/src/core/public/http/base_path.test.ts index 63b7fa61cee8..6468e674d5e7 100644 --- a/src/core/public/http/base_path.test.ts +++ b/src/core/public/http/base_path.test.ts @@ -88,4 +88,14 @@ describe('BasePath', () => { }); }); }); + + describe('serverBasePath', () => { + it('defaults to basePath', () => { + expect(new BasePath('/foo/bar').serverBasePath).toEqual('/foo/bar'); + }); + + it('returns value when passed into constructor', () => { + expect(new BasePath('/foo/bar', '/foo').serverBasePath).toEqual('/foo'); + }); + }); }); diff --git a/src/core/public/http/base_path.ts b/src/core/public/http/base_path.ts index 6352327c4162..67464a6196b0 100644 --- a/src/core/public/http/base_path.ts +++ b/src/core/public/http/base_path.ts @@ -38,7 +38,10 @@ import { modifyUrl } from '../../utils'; export class BasePath { - constructor(private readonly basePath: string = '') {} + constructor( + private readonly basePath: string = '', + public readonly serverBasePath: string = basePath + ) {} public get = () => { return this.basePath; diff --git a/src/core/public/http/http_service.ts b/src/core/public/http/http_service.ts index 8965747ba683..44fc9d65565d 100644 --- a/src/core/public/http/http_service.ts +++ b/src/core/public/http/http_service.ts @@ -39,7 +39,10 @@ export class HttpService implements CoreService { public setup({ injectedMetadata, fatalErrors }: HttpDeps): HttpSetup { const kibanaVersion = injectedMetadata.getKibanaVersion(); - const basePath = new BasePath(injectedMetadata.getBasePath()); + const basePath = new BasePath( + injectedMetadata.getBasePath(), + injectedMetadata.getServerBasePath() + ); const fetchService = new Fetch({ basePath, kibanaVersion }); const loadingCount = this.loadingCount.setup({ fatalErrors }); diff --git a/src/core/public/http/types.ts b/src/core/public/http/types.ts index 5909572c7e54..6370ae165282 100644 --- a/src/core/public/http/types.ts +++ b/src/core/public/http/types.ts @@ -94,6 +94,13 @@ export interface IBasePath { * Removes the prepended basePath from the `path`. */ remove: (url: string) => string; + + /** + * Returns the server's root basePath as configured, without any namespace prefix. + * + * See {@link BasePath.get} for getting the basePath value for a specific request + */ + readonly serverBasePath: string; } /** diff --git a/src/core/public/injected_metadata/injected_metadata_service.mock.ts b/src/core/public/injected_metadata/injected_metadata_service.mock.ts index 3c06f40d976d..5caa9830a643 100644 --- a/src/core/public/injected_metadata/injected_metadata_service.mock.ts +++ b/src/core/public/injected_metadata/injected_metadata_service.mock.ts @@ -21,6 +21,7 @@ import { InjectedMetadataService, InjectedMetadataSetup } from './injected_metad const createSetupContractMock = () => { const setupContract: jest.Mocked = { getBasePath: jest.fn(), + getServerBasePath: jest.fn(), getKibanaVersion: jest.fn(), getKibanaBranch: jest.fn(), getCspConfig: jest.fn(), diff --git a/src/core/public/injected_metadata/injected_metadata_service.ts b/src/core/public/injected_metadata/injected_metadata_service.ts index 64a8b8a855fb..75abdd6d87d5 100644 --- a/src/core/public/injected_metadata/injected_metadata_service.ts +++ b/src/core/public/injected_metadata/injected_metadata_service.ts @@ -54,6 +54,7 @@ export interface InjectedMetadataParams { buildNumber: number; branch: string; basePath: string; + serverBasePath: string; category?: AppCategory; csp: { warnLegacyBrowsers: boolean; @@ -115,6 +116,10 @@ export class InjectedMetadataService { return this.state.basePath; }, + getServerBasePath: () => { + return this.state.serverBasePath; + }, + getKibanaVersion: () => { return this.state.version; }, @@ -161,6 +166,7 @@ export class InjectedMetadataService { */ export interface InjectedMetadataSetup { getBasePath: () => string; + getServerBasePath: () => string; getKibanaBuildNumber: () => number; getKibanaBranch: () => string; getKibanaVersion: () => string; diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 5ae5e1ee5195..7158d8b9932d 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -718,6 +718,8 @@ export interface IBasePath { get: () => string; prepend: (url: string) => string; remove: (url: string) => string; + // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "BasePath" + readonly serverBasePath: string; } // @public diff --git a/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap b/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap index 5e6e977663bc..3b11313367d9 100644 --- a/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap +++ b/src/core/server/rendering/__snapshots__/rendering_service.test.ts.snap @@ -65,6 +65,7 @@ Object { "version": Any, }, "legacyMode": false, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -136,6 +137,7 @@ Object { "version": Any, }, "legacyMode": false, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -211,6 +213,7 @@ Object { "version": Any, }, "legacyMode": false, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -282,6 +285,7 @@ Object { "version": Any, }, "legacyMode": false, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -353,6 +357,7 @@ Object { "version": Any, }, "legacyMode": false, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -424,6 +429,7 @@ Object { "version": Any, }, "legacyMode": true, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -495,6 +501,7 @@ Object { "version": Any, }, "legacyMode": true, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -566,6 +573,7 @@ Object { "version": Any, }, "legacyMode": true, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object { "fake": "__TEST_TOKEN__", @@ -639,6 +647,7 @@ Object { "version": Any, }, "legacyMode": true, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object {}, "version": Any, @@ -710,6 +719,7 @@ Object { "version": Any, }, "legacyMode": true, + "serverBasePath": "/mock-server-basepath", "uiPlugins": Array [], "vars": Object { "fake": "__TEST_TOKEN__", diff --git a/src/core/server/rendering/rendering_service.tsx b/src/core/server/rendering/rendering_service.tsx index 11d1fb271c81..dbafd5806bd7 100644 --- a/src/core/server/rendering/rendering_service.tsx +++ b/src/core/server/rendering/rendering_service.tsx @@ -60,6 +60,7 @@ export class RenderingService implements CoreService { ) => { const { env } = this.coreContext; const basePath = http.basePath.get(request); + const serverBasePath = http.basePath.serverBasePath; const settings = { defaults: uiSettings.getRegistered(), user: includeUserSettings ? await uiSettings.getUserProvided() : {}, @@ -79,6 +80,7 @@ export class RenderingService implements CoreService { buildNumber: env.packageInfo.buildNum, branch: env.packageInfo.branch, basePath, + serverBasePath, env, legacyMode: appId !== 'core', i18n: { diff --git a/src/core/server/rendering/types.ts b/src/core/server/rendering/types.ts index 3f9f6ff29490..cfaa23d49113 100644 --- a/src/core/server/rendering/types.ts +++ b/src/core/server/rendering/types.ts @@ -39,6 +39,7 @@ export interface RenderingMetadata { buildNumber: number; branch: string; basePath: string; + serverBasePath: string; env: Env; legacyMode: boolean; i18n: { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/__snapshots__/dashboard_empty_screen.test.tsx.snap index f7fc3b0891fe..c9f56dc89838 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -14,6 +14,7 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = ` "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -376,6 +377,7 @@ exports[`DashboardEmptyScreen renders correctly with visualize paragraph 1`] = ` "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -735,6 +737,7 @@ exports[`DashboardEmptyScreen renders correctly without visualize paragraph 1`] "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], diff --git a/src/plugins/data/public/ui/query_string_input/__snapshots__/query_string_input.test.tsx.snap b/src/plugins/data/public/ui/query_string_input/__snapshots__/query_string_input.test.tsx.snap index 93af543fba1a..4bf838e74c76 100644 --- a/src/plugins/data/public/ui/query_string_input/__snapshots__/query_string_input.test.tsx.snap +++ b/src/plugins/data/public/ui/query_string_input/__snapshots__/query_string_input.test.tsx.snap @@ -345,6 +345,7 @@ exports[`QueryStringInput Should disable autoFocus on EuiFieldText when disableA "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -1001,6 +1002,7 @@ exports[`QueryStringInput Should disable autoFocus on EuiFieldText when disableA "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -1639,6 +1641,7 @@ exports[`QueryStringInput Should pass the query language to the language switche "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -2292,6 +2295,7 @@ exports[`QueryStringInput Should pass the query language to the language switche "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -2930,6 +2934,7 @@ exports[`QueryStringInput Should render the given query 1`] = ` "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -3583,6 +3588,7 @@ exports[`QueryStringInput Should render the given query 1`] = ` "get": [Function], "prepend": [Function], "remove": [Function], + "serverBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx index 05427960d42b..11e65f14e270 100644 --- a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx @@ -43,7 +43,7 @@ describe('apiKeysManagementApp', () => { expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: '#/some-base-path', text: 'API Keys' }]); expect(container).toMatchInlineSnapshot(`
- Page: {"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"apiKeysAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}}} + Page: {"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"apiKeysAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}}}
`); diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx index 86f54bca88db..9c41d6624065 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx @@ -53,7 +53,7 @@ describe('roleMappingsManagementApp', () => { expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `#${basePath}`, text: 'Role Mappings' }]); expect(container).toMatchInlineSnapshot(`
- Role Mappings Page: {"notifications":{"toasts":{}},"roleMappingsAPI":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"}} + Role Mappings Page: {"notifications":{"toasts":{}},"roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"}}
`); @@ -75,7 +75,7 @@ describe('roleMappingsManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- Role Mapping Edit Page: {"roleMappingsAPI":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"}} + Role Mapping Edit Page: {"roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"}}
`); @@ -98,7 +98,7 @@ describe('roleMappingsManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- Role Mapping Edit Page: {"name":"someRoleMappingName","roleMappingsAPI":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"}} + Role Mapping Edit Page: {"name":"someRoleMappingName","roleMappingsAPI":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"}}
`); diff --git a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx index 48bc1a6580a9..5936409eb6e8 100644 --- a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx @@ -64,7 +64,7 @@ describe('rolesManagementApp', () => { expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `#${basePath}`, text: 'Roles' }]); expect(container).toMatchInlineSnapshot(`
- Roles Page: {"notifications":{"toasts":{}},"rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}}} + Roles Page: {"notifications":{"toasts":{}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}}}
`); @@ -86,7 +86,7 @@ describe('rolesManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"userAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"http":{"basePath":{"basePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}}} + Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}}}
`); @@ -109,7 +109,7 @@ describe('rolesManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- Role Edit Page: {"action":"edit","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"userAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"http":{"basePath":{"basePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}}} + Role Edit Page: {"action":"edit","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}}}
`); @@ -132,7 +132,7 @@ describe('rolesManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"userAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"http":{"basePath":{"basePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}}} + Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{"esDocBasePath":"https://www.elastic.co/guide/en/elasticsearch/reference/mocked-test-branch/"},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}}}
`); diff --git a/x-pack/plugins/security/public/management/users/users_management_app.test.tsx b/x-pack/plugins/security/public/management/users/users_management_app.test.tsx index 48ffcfc550a8..fd81756f176f 100644 --- a/x-pack/plugins/security/public/management/users/users_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/users/users_management_app.test.tsx @@ -58,7 +58,7 @@ describe('usersManagementApp', () => { expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `#${basePath}`, text: 'Users' }]); expect(container).toMatchInlineSnapshot(`
- Users Page: {"notifications":{"toasts":{}},"apiClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}}} + Users Page: {"notifications":{"toasts":{}},"apiClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}}}
`); @@ -80,7 +80,7 @@ describe('usersManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- User Edit Page: {"authc":{},"apiClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}}} + User Edit Page: {"authc":{},"apiClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}}}
`); @@ -103,7 +103,7 @@ describe('usersManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- User Edit Page: {"authc":{},"apiClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}},"username":"someUserName"} + User Edit Page: {"authc":{},"apiClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}}},"notifications":{"toasts":{}},"username":"someUserName"}
`); diff --git a/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx b/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx index b19ef995283d..2e274e08ee13 100644 --- a/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx @@ -81,7 +81,7 @@ describe('spacesManagementApp', () => { expect(setBreadcrumbs).toHaveBeenCalledWith([{ href: `#${basePath}`, text: 'Spaces' }]); expect(container).toMatchInlineSnapshot(`
- Spaces Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"http":{"basePath":{"basePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{"_isScalar":false}},"securityEnabled":true} + Spaces Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{"_isScalar":false}},"securityEnabled":true}
`); @@ -103,7 +103,7 @@ describe('spacesManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- Spaces Edit Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"http":{"basePath":{"basePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{"_isScalar":false}},"securityEnabled":true} + Spaces Edit Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{"_isScalar":false}},"securityEnabled":true}
`); @@ -126,7 +126,7 @@ describe('spacesManagementApp', () => { ]); expect(container).toMatchInlineSnapshot(`
- Spaces Edit Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"http":{"basePath":{"basePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{"_isScalar":false}},"spaceId":"some-space","securityEnabled":true} + Spaces Edit Page: {"capabilities":{"catalogue":{},"management":{},"navLinks":{}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{}},"notifications":{"toasts":{}},"spacesManager":{"onActiveSpaceChange$":{"_isScalar":false}},"spaceId":"some-space","securityEnabled":true}
`);