6
6
import React , { ReactNode , useEffect , useState } from 'react' ;
7
7
import { HashRouter , Route , Switch } from 'react-router-dom' ;
8
8
import { FormattedMessage } from '@osd/i18n/react' ;
9
+ import { useObservable } from 'react-use' ;
10
+ import { EMPTY } from 'rxjs' ;
11
+ import {
12
+ observabilityOverviewTitle ,
13
+ observabilityOverviewTitleWithUseCase ,
14
+ } from '../../../common/constants/shared' ;
9
15
import { alertsPluginID , anomalyPluginID } from '../../../common/constants/overview' ;
10
16
import { DashboardSavedObjectsType } from '../../../common/types/overview' ;
11
17
import { setNavBreadCrumbs } from '../../../common/utils/set_nav_bread_crumbs' ;
@@ -17,6 +23,7 @@ import { ObsDashboardStateManager } from './components/obs_dashboard_state_manag
17
23
import { SelectDashboardFlyout } from './components/select_dashboard_flyout' ;
18
24
import { getObservabilityDashboardsId , setObservabilityDashboardsId } from './components/utils' ;
19
25
import './index.scss' ;
26
+ import { OBSERVABILITY_USE_CASE_ID } from '../../../../../src/core/public' ;
20
27
21
28
export const Home = ( ) => {
22
29
const [ homePage , setHomePage ] = useState < ReactNode > ( < > </ > ) ;
@@ -68,6 +75,8 @@ export const Home = () => {
68
75
description : card . description ,
69
76
title : card . title ,
70
77
cardProps : {
78
+ titleSize : 's' ,
79
+ titleElement : 'h4' ,
71
80
selectable : {
72
81
children : (
73
82
< FormattedMessage
@@ -178,18 +187,23 @@ export const Home = () => {
178
187
loadHomePage ( ) ;
179
188
} , [ dashboardsSavedObjects ] ) ;
180
189
190
+ const currentNavGroup = useObservable ( coreRefs ?. chrome ?. navGroup . getCurrentNavGroup$ ( ) || EMPTY ) ;
191
+ const isObservabilityUseCase = currentNavGroup ?. id === OBSERVABILITY_USE_CASE_ID ;
192
+
181
193
useEffect ( ( ) => {
182
194
setNavBreadCrumbs (
183
195
[ ] ,
184
196
[
185
197
{
186
- text : 'Observability overview' ,
198
+ text : isObservabilityUseCase
199
+ ? observabilityOverviewTitle
200
+ : observabilityOverviewTitleWithUseCase ,
187
201
href : '#/' ,
188
202
} ,
189
203
]
190
204
) ;
191
205
loadDashboardsState ( ) ;
192
- } , [ ] ) ;
206
+ } , [ isObservabilityUseCase ] ) ;
193
207
194
208
return (
195
209
< div >
0 commit comments