diff --git a/changelogs/fragments/7858.yml b/changelogs/fragments/7858.yml new file mode 100644 index 000000000000..6145c80780a7 --- /dev/null +++ b/changelogs/fragments/7858.yml @@ -0,0 +1,2 @@ +fix: +- [Workspace] Revert new home page ui setting for workspace default route ([#7858](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7858)) \ No newline at end of file diff --git a/src/plugins/workspace/server/plugin.test.ts b/src/plugins/workspace/server/plugin.test.ts index b71532e36273..433fb2703f00 100644 --- a/src/plugins/workspace/server/plugin.test.ts +++ b/src/plugins/workspace/server/plugin.test.ts @@ -183,23 +183,6 @@ describe('Workspace server plugin', () => { describe('#setUpRedirectPage', () => { const setupMock = coreMock.createSetup(); const uiSettingsMock = uiSettingsServiceMock.createClient(); - setupMock.getStartServices.mockResolvedValue([ - { - ...coreMock.createStart(), - uiSettings: { - asScopedToClient: () => ({ - ...uiSettingsMock, - get: jest.fn().mockImplementation((key) => { - if (key === 'home:useNewHomePage') { - return Promise.resolve(true); - } - }), - }), - }, - }, - {}, - {}, - ]); const initializerContextConfigMock = coreMock.createPluginInitializerContext({ enabled: true, permission: { @@ -304,8 +287,6 @@ describe('Workspace server plugin', () => { get: jest.fn().mockImplementation((key) => { if (key === 'defaultWorkspace') { return Promise.resolve('defaultWorkspace'); - } else if (key === 'home:useNewHomePage') { - return Promise.resolve('true'); } }), }), @@ -337,29 +318,6 @@ describe('Workspace server plugin', () => { }, }); }); - - it('with / request path and home:useNewHomePage is false', async () => { - const request = httpServerMock.createOpenSearchDashboardsRequest({ - path: '/', - }); - setupMock.getStartServices.mockResolvedValue([ - { - ...coreMock.createStart(), - uiSettings: { - asScopedToClient: () => ({ - ...uiSettingsMock, - get: jest.fn().mockResolvedValue(false), - }), - }, - }, - {}, - {}, - ]); - const toolKitMock = httpServerMock.createToolkit(); - - await registerOnPostAuthFn(request, response, toolKitMock); - expect(toolKitMock.next).toBeCalledTimes(1); - }); }); it('#start', async () => { diff --git a/src/plugins/workspace/server/plugin.ts b/src/plugins/workspace/server/plugin.ts index d7c1ba69206c..21f90fbe0d91 100644 --- a/src/plugins/workspace/server/plugin.ts +++ b/src/plugins/workspace/server/plugin.ts @@ -114,15 +114,6 @@ export class WorkspacePlugin implements Plugin { const path = request.url.pathname; if (path === '/') { - const [coreStart] = await core.getStartServices(); - const uiSettings = coreStart.uiSettings.asScopedToClient( - coreStart.savedObjects.getScopedClient(request) - ); - const useNewHomePage = await uiSettings.get('home:useNewHomePage'); - if (!useNewHomePage) { - return toolkit.next(); - } - const workspaceListResponse = await this.client?.list( { request, logger: this.logger }, { page: 1, perPage: 100 } @@ -139,6 +130,10 @@ export class WorkspacePlugin implements Plugin