From f793f0ea53e8828511a066788fc265232b46743d Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Mon, 22 Jul 2024 18:18:05 +0800 Subject: [PATCH] add unit test Signed-off-by: Hailong Cui --- src/core/public/chrome/chrome_service.tsx | 2 +- src/plugins/workspace/public/plugin.ts | 4 ++-- src/plugins/workspace/public/utils.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 7378a86f736..b334792a3df 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -194,7 +194,7 @@ export class ChromeService { const helpExtension$ = new BehaviorSubject(undefined); const breadcrumbs$ = new BehaviorSubject([]); const breadcrumbsEnricher$ = new BehaviorSubject( - (breadcrumbs) => breadcrumbs + undefined ); const badge$ = new BehaviorSubject(undefined); const customNavLink$ = new BehaviorSubject(undefined); diff --git a/src/plugins/workspace/public/plugin.ts b/src/plugins/workspace/public/plugin.ts index 8cf94882ec7..846e13cd14a 100644 --- a/src/plugins/workspace/public/plugin.ts +++ b/src/plugins/workspace/public/plugin.ts @@ -41,7 +41,7 @@ import { WorkspaceMenu } from './components/workspace_menu/workspace_menu'; import { getWorkspaceColumn } from './components/workspace_column'; import { DataSourceManagementPluginSetup } from '../../../plugins/data_source_management/public'; import { - enhanceBreadcrumbsWithUseCase, + enrichBreadcrumbsWithWorkspace, filterWorkspaceConfigurableApps, getFirstUseCaseOfFeatureConfigs, isAppAccessibleInWorkspace, @@ -459,7 +459,7 @@ export class WorkspacePlugin this.registerGetStartedCardToNewHome(core, contentManagement); // set breadcrumbs enricher for workspace - this.breadcrumbsSubscription = enhanceBreadcrumbsWithUseCase(core); + this.breadcrumbsSubscription = enrichBreadcrumbsWithWorkspace(core); } return {}; } diff --git a/src/plugins/workspace/public/utils.ts b/src/plugins/workspace/public/utils.ts index ec26b3d510d..e1093495c04 100644 --- a/src/plugins/workspace/public/utils.ts +++ b/src/plugins/workspace/public/utils.ts @@ -269,7 +269,7 @@ const isNotNull = (value: T | null): value is T => !!value; export const getFirstUseCaseOfFeatureConfigs = (featureConfigs: string[]): string | undefined => featureConfigs.map(getUseCaseFromFeatureConfig).filter(isNotNull)[0]; -export function enhanceBreadcrumbsWithUseCase(core: CoreStart) { +export function enrichBreadcrumbsWithWorkspace(core: CoreStart) { return combineLatest([ core.workspaces.currentWorkspace$, core.application.currentAppId$,