diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index f0cd8afddfa..151004b2bfc 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -59,7 +59,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={Object {}} @@ -2012,7 +2012,7 @@ exports[`CollapsibleNav renders the default nav 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={Object {}} @@ -2316,7 +2316,7 @@ exports[`CollapsibleNav renders the default nav 2`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={Object {}} @@ -2621,7 +2621,7 @@ exports[`CollapsibleNav renders the default nav 3`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={Object {}} @@ -3217,7 +3217,7 @@ exports[`CollapsibleNav with custom branding renders the nav bar in dark mode 1` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={ @@ -4334,7 +4334,7 @@ exports[`CollapsibleNav with custom branding renders the nav bar in default mode "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={ @@ -5450,7 +5450,7 @@ exports[`CollapsibleNav without custom branding renders the nav bar in dark mode "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={ @@ -6559,7 +6559,7 @@ exports[`CollapsibleNav without custom branding renders the nav bar in default m "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={Object {}} diff --git a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap index b763760e58d..6aa25a794be 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap @@ -247,7 +247,7 @@ exports[`Header handles visibility and lock changes 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={Object {}} @@ -5880,7 +5880,7 @@ exports[`Header handles visibility and lock changes 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } closeNav={[Function]} @@ -6943,7 +6943,7 @@ exports[`Header renders condensed header 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } branding={ @@ -11357,7 +11357,7 @@ exports[`Header renders condensed header 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "/test", - "workspaceBasePath": "", + "clientBasePath": "", } } closeNav={[Function]} diff --git a/src/core/public/http/base_path.test.ts b/src/core/public/http/base_path.test.ts index e541c1c8c6d..ac979205b8d 100644 --- a/src/core/public/http/base_path.test.ts +++ b/src/core/public/http/base_path.test.ts @@ -111,7 +111,7 @@ describe('BasePath', () => { }); }); - describe('workspaceBasePath', () => { + describe('clientBasePath', () => { it('get path with workspace', () => { expect(new BasePath('/foo/bar', '/foo/bar', '/workspace').get()).toEqual( '/foo/bar/workspace' diff --git a/src/core/public/http/base_path.ts b/src/core/public/http/base_path.ts index 254e4e2e6ad..5849f8e7aad 100644 --- a/src/core/public/http/base_path.ts +++ b/src/core/public/http/base_path.ts @@ -35,11 +35,11 @@ export class BasePath { constructor( private readonly basePath: string = '', public readonly serverBasePath: string = basePath, - private readonly workspaceBasePath: string = '' + private readonly clientBasePath: string = '' ) {} public get = () => { - return `${this.basePath}${this.workspaceBasePath}`; + return `${this.basePath}${this.clientBasePath}`; }; public getBasePath = () => { diff --git a/src/core/public/http/http_service.mock.ts b/src/core/public/http/http_service.mock.ts index 934e4cbc939..b34b4d1cfa8 100644 --- a/src/core/public/http/http_service.mock.ts +++ b/src/core/public/http/http_service.mock.ts @@ -39,7 +39,7 @@ export type HttpSetupMock = jest.Mocked & { anonymousPaths: jest.Mocked; }; -const createServiceMock = ({ basePath = '', workspaceBasePath = '' } = {}): HttpSetupMock => ({ +const createServiceMock = ({ basePath = '', clientBasePath = '' } = {}): HttpSetupMock => ({ fetch: jest.fn(), get: jest.fn(), head: jest.fn(), @@ -48,7 +48,7 @@ const createServiceMock = ({ basePath = '', workspaceBasePath = '' } = {}): Http patch: jest.fn(), delete: jest.fn(), options: jest.fn(), - basePath: new BasePath(basePath, undefined, workspaceBasePath), + basePath: new BasePath(basePath, undefined, clientBasePath), anonymousPaths: { register: jest.fn(), isAnonymous: jest.fn(), @@ -58,14 +58,14 @@ const createServiceMock = ({ basePath = '', workspaceBasePath = '' } = {}): Http intercept: jest.fn(), }); -const createMock = ({ basePath = '', workspaceBasePath = '' } = {}) => { +const createMock = ({ basePath = '', clientBasePath = '' } = {}) => { const mocked: jest.Mocked> = { setup: jest.fn(), start: jest.fn(), stop: jest.fn(), }; - mocked.setup.mockReturnValue(createServiceMock({ basePath, workspaceBasePath })); - mocked.start.mockReturnValue(createServiceMock({ basePath, workspaceBasePath })); + mocked.setup.mockReturnValue(createServiceMock({ basePath, clientBasePath })); + mocked.start.mockReturnValue(createServiceMock({ basePath, clientBasePath })); return mocked; }; diff --git a/src/core/public/http/http_service.ts b/src/core/public/http/http_service.ts index f0b988f5d95..e0faa05d07b 100644 --- a/src/core/public/http/http_service.ts +++ b/src/core/public/http/http_service.ts @@ -52,7 +52,7 @@ export class HttpService implements CoreService { public setup({ injectedMetadata, fatalErrors }: HttpDeps): HttpSetup { const opensearchDashboardsVersion = injectedMetadata.getOpenSearchDashboardsVersion(); - let workspaceBasePath = ''; + let clientBasePath = ''; const plugins = injectedMetadata.getPlugins(); const findWorkspaceConfig = plugins.find((plugin) => plugin.id === 'workspace'); // Only try to get workspace id from url when workspace feature is enabled @@ -62,13 +62,13 @@ export class HttpService implements CoreService { injectedMetadata.getBasePath() ); if (workspaceId) { - workspaceBasePath = `${WORKSPACE_PATH_PREFIX}/${workspaceId}`; + clientBasePath = `${WORKSPACE_PATH_PREFIX}/${workspaceId}`; } } const basePath = new BasePath( injectedMetadata.getBasePath(), injectedMetadata.getServerBasePath(), - workspaceBasePath + clientBasePath ); const fetchService = new Fetch({ basePath, opensearchDashboardsVersion }); const loadingCount = this.loadingCount.setup({ fatalErrors }); diff --git a/src/core/utils/workspace.test.ts b/src/core/utils/workspace.test.ts index a10d0549ce6..a852ddcc519 100644 --- a/src/core/utils/workspace.test.ts +++ b/src/core/utils/workspace.test.ts @@ -25,16 +25,16 @@ describe('#getWorkspaceIdFromUrl', () => { }); describe('#formatUrlWithWorkspaceId', () => { - const basePathWithoutWorkspaceBasePath = httpServiceMock.createSetupContract().basePath; + const basePathWithoutClientBasePath = httpServiceMock.createSetupContract().basePath; it('return url with workspace prefix when format with a id provided', () => { expect( - formatUrlWithWorkspaceId('/app/dashboard', 'foo', basePathWithoutWorkspaceBasePath) + formatUrlWithWorkspaceId('/app/dashboard', 'foo', basePathWithoutClientBasePath) ).toEqual('http://localhost/w/foo/app/dashboard'); }); it('return url without workspace prefix when format without a id', () => { expect( - formatUrlWithWorkspaceId('/w/foo/app/dashboard', '', basePathWithoutWorkspaceBasePath) + formatUrlWithWorkspaceId('/w/foo/app/dashboard', '', basePathWithoutClientBasePath) ).toEqual('http://localhost/app/dashboard'); }); }); diff --git a/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap b/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap index 2102d4cbc6b..930b8eca265 100644 --- a/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap +++ b/src/plugins/dashboard/public/application/components/dashboard_listing/__snapshots__/dashboard_listing.test.tsx.snap @@ -861,7 +861,7 @@ exports[`dashboard listing hideWriteControls 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -1996,7 +1996,7 @@ exports[`dashboard listing render table listing with initial filters from URL 1` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -3192,7 +3192,7 @@ exports[`dashboard listing renders call to action when no dashboards exist 1`] = "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -4388,7 +4388,7 @@ exports[`dashboard listing renders table rows 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -5584,7 +5584,7 @@ exports[`dashboard listing renders warning when listingLimit is exceeded 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], diff --git a/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap b/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap index 414ec142374..cb858689bd1 100644 --- a/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap +++ b/src/plugins/dashboard/public/application/components/dashboard_top_nav/__snapshots__/dashboard_top_nav.test.tsx.snap @@ -753,7 +753,7 @@ exports[`Dashboard top nav render in embed mode 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -1713,7 +1713,7 @@ exports[`Dashboard top nav render in embed mode, and force hide filter bar 1`] = "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -2673,7 +2673,7 @@ exports[`Dashboard top nav render in embed mode, components can be forced show b "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -3633,7 +3633,7 @@ exports[`Dashboard top nav render in full screen mode with appended URL param bu "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -4593,7 +4593,7 @@ exports[`Dashboard top nav render in full screen mode, no componenets should be "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -5553,7 +5553,7 @@ exports[`Dashboard top nav render with all components 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], diff --git a/src/plugins/dashboard/public/application/embeddable/empty/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/embeddable/empty/__snapshots__/dashboard_empty_screen.test.tsx.snap index 187c24ba152..2e23e1e91d3 100644 --- a/src/plugins/dashboard/public/application/embeddable/empty/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/plugins/dashboard/public/application/embeddable/empty/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -16,7 +16,7 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -385,7 +385,7 @@ exports[`DashboardEmptyScreen renders correctly with visualize paragraph 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], @@ -764,7 +764,7 @@ exports[`DashboardEmptyScreen renders correctly without visualize paragraph 1`] "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap index fe237e8d8d0..75882d4ebc1 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap @@ -265,7 +265,7 @@ exports[`SavedObjectsTable should render normally 1`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", } } canDelete={false} diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap index 7f47a6cef27..ff8009e90ce 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap @@ -173,7 +173,7 @@ exports[`Flyout conflicts should allow conflict resolution 2`] = ` "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction], diff --git a/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap b/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap index 1576310d60e..34d29ddf73c 100644 --- a/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap +++ b/src/plugins/telemetry_management_section/public/components/__snapshots__/telemetry_management_section.test.tsx.snap @@ -318,7 +318,7 @@ exports[`TelemetryManagementSectionComponent renders null because allowChangingO "prepend": [Function], "remove": [Function], "serverBasePath": "", - "workspaceBasePath": "", + "clientBasePath": "", }, "delete": [MockFunction], "fetch": [MockFunction],