From 69b9e4c6947deaedc0686abe8ded748ba490c684 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 16 Jun 2023 17:03:50 +0800 Subject: [PATCH 1/2] fix import error Signed-off-by: Hailong Cui --- src/plugins/discover/public/plugin.ts | 3 +-- src/plugins/visualize/public/plugin.ts | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/plugins/discover/public/plugin.ts b/src/plugins/discover/public/plugin.ts index a4c5bb78d649..21f80ab61b75 100644 --- a/src/plugins/discover/public/plugin.ts +++ b/src/plugins/discover/public/plugin.ts @@ -38,7 +38,6 @@ import { AppUpdater, CoreSetup, CoreStart, - DEFAULT_WORKSPACE_TEMPLATES, Plugin, PluginInitializerContext, } from 'opensearch-dashboards/public'; @@ -60,7 +59,7 @@ import rison from 'rison-node'; import { DataPublicPluginStart, DataPublicPluginSetup, opensearchFilters } from '../../data/public'; import { SavedObjectLoader } from '../../saved_objects/public'; import { createOsdUrlTracker, url } from '../../opensearch_dashboards_utils/public'; -import { DEFAULT_APP_CATEGORIES } from '../../../core/public'; +import { DEFAULT_APP_CATEGORIES, DEFAULT_WORKSPACE_TEMPLATES } from '../../../core/public'; import { UrlGeneratorState } from '../../share/public'; import { DocViewInput, DocViewInputFn } from './application/doc_views/doc_views_types'; import { DocViewLink } from './application/doc_views_links/doc_views_links_types'; diff --git a/src/plugins/visualize/public/plugin.ts b/src/plugins/visualize/public/plugin.ts index a5cbbfc849e3..5fb5d523edb2 100644 --- a/src/plugins/visualize/public/plugin.ts +++ b/src/plugins/visualize/public/plugin.ts @@ -37,12 +37,10 @@ import { AppUpdater, CoreSetup, CoreStart, - DEFAULT_WORKSPACE_TEMPLATES, Plugin, PluginInitializerContext, ScopedHistory, } from 'opensearch-dashboards/public'; - import { Storage, createOsdUrlTracker, @@ -57,7 +55,7 @@ import { VisualizationsStart } from '../../visualizations/public'; import { VisualizeConstants } from './application/visualize_constants'; import { FeatureCatalogueCategory, HomePublicPluginSetup } from '../../home/public'; import { VisualizeServices } from './application/types'; -import { DEFAULT_APP_CATEGORIES } from '../../../core/public'; +import { DEFAULT_APP_CATEGORIES, DEFAULT_WORKSPACE_TEMPLATES } from '../../../core/public'; import { SavedObjectsStart } from '../../saved_objects/public'; import { EmbeddableStart } from '../../embeddable/public'; import { DashboardStart } from '../../dashboard/public'; From 73488b171a6a72efd512e9dd8565250c6eca0b8e Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 16 Jun 2023 17:07:21 +0800 Subject: [PATCH 2/2] fix osd bootstrap failure Signed-off-by: Hailong Cui --- src/core/public/chrome/chrome_service.test.ts | 2 ++ src/core/public/chrome/ui/header/collapsible_nav.test.tsx | 2 ++ src/core/public/chrome/ui/header/header.test.tsx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/core/public/chrome/chrome_service.test.ts b/src/core/public/chrome/chrome_service.test.ts index b8635f5a070f..6e36775b90c2 100644 --- a/src/core/public/chrome/chrome_service.test.ts +++ b/src/core/public/chrome/chrome_service.test.ts @@ -41,6 +41,7 @@ import { notificationServiceMock } from '../notifications/notifications_service. import { uiSettingsServiceMock } from '../ui_settings/ui_settings_service.mock'; import { ChromeService } from './chrome_service'; import { getAppInfo } from '../application/utils'; +import { workspacesServiceMock } from '../fatal_errors/fatal_errors_service.mock'; class FakeApp implements App { public title = `${this.id} App`; @@ -67,6 +68,7 @@ function defaultStartDeps(availableApps?: App[]) { injectedMetadata: injectedMetadataServiceMock.createStartContract(), notifications: notificationServiceMock.createStartContract(), uiSettings: uiSettingsServiceMock.createStartContract(), + workspaces: workspacesServiceMock.createStartContract(), }; if (availableApps) { diff --git a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx index dc44fe5053fe..4df3f68ec90e 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx @@ -37,6 +37,7 @@ import { ChromeNavLink, DEFAULT_APP_CATEGORIES } from '../../..'; import { httpServiceMock } from '../../../http/http_service.mock'; import { ChromeRecentlyAccessedHistoryItem } from '../../recently_accessed'; import { CollapsibleNav } from './collapsible_nav'; +import { workspacesServiceMock } from '../../../fatal_errors/fatal_errors_service.mock'; jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ htmlIdGenerator: () => () => 'mockId', @@ -80,6 +81,7 @@ function mockProps() { navigateToApp: () => Promise.resolve(), navigateToUrl: () => Promise.resolve(), customNavLink$: new BehaviorSubject(undefined), + currentWorkspace$: workspacesServiceMock.createStartContract().client.currentWorkspace$, branding: { darkMode: false, mark: { diff --git a/src/core/public/chrome/ui/header/header.test.tsx b/src/core/public/chrome/ui/header/header.test.tsx index 319dea4c394b..cd969fcc7275 100644 --- a/src/core/public/chrome/ui/header/header.test.tsx +++ b/src/core/public/chrome/ui/header/header.test.tsx @@ -36,6 +36,7 @@ import { httpServiceMock } from '../../../http/http_service.mock'; import { applicationServiceMock } from '../../../mocks'; import { Header } from './header'; import { StubBrowserStorage } from 'test_utils/stub_browser_storage'; +import { workspacesServiceMock } from '../../../fatal_errors/fatal_errors_service.mock'; jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ htmlIdGenerator: () => () => 'mockId', @@ -76,6 +77,7 @@ function mockProps() { applicationTitle: 'OpenSearch Dashboards', }, survey: '/', + currentWorkspace$: workspacesServiceMock.createStartContract().client.currentWorkspace$, }; }