diff --git a/public/pages/Overview/containers/Overview/Overview.tsx b/public/pages/Overview/containers/Overview/Overview.tsx index 5735dd3a..398fe695 100644 --- a/public/pages/Overview/containers/Overview/Overview.tsx +++ b/public/pages/Overview/containers/Overview/Overview.tsx @@ -39,8 +39,10 @@ import { OverviewProps, OverviewState, OverviewViewModel } from '../../../../../ import { setBreadcrumbs } from '../../../../utils/helpers'; import { PageHeader } from '../../../../components/PageHeader/PageHeader'; import { getOverviewStatsProps, getOverviewsCardsProps } from '../../utils/constants'; -import { getUseUpdatedUx } from '../../../../services/utils/constants'; +import { getChrome, getUseUpdatedUx } from '../../../../services/utils/constants'; import { RecentThreatIntelFindingsWidget } from '../../components/Widgets/RecentThreatIntelFindingsWidget'; +import { useObservable } from 'react-use'; +import { SECURITY_ANALYTICS_USE_CASE_ID } from '../../../../../../../src/core/public'; export const Overview: React.FC = (props) => { const { @@ -101,15 +103,17 @@ export const Overview: React.FC = (props) => { () => new OverviewViewModelActor(saContext?.services, context?.notifications!), [saContext?.services, context] ); + const currentNavGroup = useObservable(getChrome().navGroup.getCurrentNavGroup$()); + const isSecurityAnalyticsUseCase = currentNavGroup?.id === SECURITY_ANALYTICS_USE_CASE_ID; useEffect(() => { - setBreadcrumbs([BREADCRUMBS.OVERVIEW]); + setBreadcrumbs(isSecurityAnalyticsUseCase ? [ BREADCRUMBS.OVERVIEW] : [{...BREADCRUMBS.OVERVIEW, text: 'Security Analytics overview'}]); overviewViewModelActor.registerRefreshHandler(updateState, true /* allowPartialResults */); overviewViewModelActor.registerRefreshHandler( onLoadingComplete, false /* allowPartialResults */ ); - }, []); + }, [isSecurityAnalyticsUseCase]); useEffect(() => { const abortController = new AbortController(); @@ -269,7 +273,7 @@ export const Overview: React.FC = (props) => { {getOverviewsCardsProps().map((p, idx) => ( - + ))} diff --git a/public/plugin.ts b/public/plugin.ts index f58e5254..e40a2949 100644 --- a/public/plugin.ts +++ b/public/plugin.ts @@ -42,6 +42,7 @@ import { setNavigationUI, setApplication, setBreadCrumbsSetter, + setChrome, setContentManagement, setDataSourceManagementPlugin, setNotifications, @@ -261,6 +262,7 @@ export class SecurityAnalyticsPlugin setNavigationUI(navigation.ui); setApplication(core.application); setBreadCrumbsSetter(core.chrome.setBreadcrumbs); + setChrome(core.chrome); setContentManagement(contentManagement); setNotifications(core.notifications); setSavedObjectsClient(core.savedObjects.client); diff --git a/public/services/utils/constants.ts b/public/services/utils/constants.ts index 6ef75d07..e32ea73a 100644 --- a/public/services/utils/constants.ts +++ b/public/services/utils/constants.ts @@ -36,6 +36,10 @@ export const [getBreadCrumbsSetter, setBreadCrumbsSetter] = createGetterSetter< CoreStart['chrome']['setBreadcrumbs'] >('breadCrumbSetter'); +export const [getChrome, setChrome] = createGetterSetter< + CoreStart['chrome'] +>('chrome'); + export const [getContentManagement, setContentManagement] = createGetterSetter< ContentManagementPluginStart >('contentManagement'); diff --git a/public/utils/helpers.tsx b/public/utils/helpers.tsx index 6b374233..fdf5f2bb 100644 --- a/public/utils/helpers.tsx +++ b/public/utils/helpers.tsx @@ -701,6 +701,7 @@ export function registerThreatAlertsCard() { detectorService={getBrowserServices().detectorsService} /> ), + width: 16, }), }); }