1
1
import { cx } from '@emotion/css' ;
2
+ import { Box } from '@mui/material' ;
2
3
import React , { PureComponent } from 'react' ;
3
4
import { connect , ConnectedProps , MapDispatchToProps , MapStateToProps } from 'react-redux' ;
4
5
5
6
import { NavModel , NavModelItem , TimeRange , PageLayoutType , locationUtil } from '@grafana/data' ;
6
7
import { selectors } from '@grafana/e2e-selectors' ;
7
8
import { config , locationService } from '@grafana/runtime' ;
8
- import { Themeable2 , withTheme2 } from '@grafana/ui' ;
9
+ import { Themeable2 , withTheme2 , ToolbarButtonRow } from '@grafana/ui' ;
9
10
import { notifyApp } from 'app/core/actions' ;
10
11
import { Page } from 'app/core/components/Page/Page' ;
11
12
import { EntityNotFound } from 'app/core/components/PageNotFound/EntityNotFound' ;
@@ -17,6 +18,7 @@ import { FnGlobalState } from 'app/core/reducers/fn-slice';
17
18
import { getNavModel } from 'app/core/selectors/navModel' ;
18
19
import { PanelModel } from 'app/features/dashboard/state' ;
19
20
import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher' ;
21
+ import { updateTimeZoneForSession } from 'app/features/profile/state/reducers' ;
20
22
import { getPageNavFromSlug , getRootContentNavModel } from 'app/features/storage/StorageFolderPage' ;
21
23
import { FNDashboardProps } from 'app/fn-app/types' ;
22
24
import { DashboardRoutes , DashboardState , KioskMode , StoreState } from 'app/types' ;
@@ -25,7 +27,7 @@ import { PanelEditEnteredEvent, PanelEditExitedEvent } from 'app/types/events';
25
27
import { cancelVariables , templateVarsChangedInUrl } from '../../variables/state/actions' ;
26
28
import { findTemplateVarChanges } from '../../variables/utils' ;
27
29
import { AddWidgetModal } from '../components/AddWidgetModal/AddWidgetModal' ;
28
- import { DashNav } from '../components/DashNav' ;
30
+ import { DashNavTimeControls } from '../components/DashNav/DashNavTimeControls ' ;
29
31
import { DashboardFailed } from '../components/DashboardLoading/DashboardFailed' ;
30
32
import { DashboardLoading } from '../components/DashboardLoading/DashboardLoading' ;
31
33
import { FnLoader } from '../components/DashboardLoading/FnLoader' ;
@@ -411,20 +413,29 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
411
413
>
412
414
{ showToolbar && (
413
415
< header data-testid = { selectors . pages . Dashboard . DashNav . navV2 } >
414
- < DashNav
416
+ < Box mb = { 4 } >
417
+ < ToolbarButtonRow alignment = "right" >
418
+ < DashNavTimeControls
419
+ dashboard = { dashboard }
420
+ onChangeTimeZone = { updateTimeZoneForSession }
421
+ key = "time-controls"
422
+ />
423
+ </ ToolbarButtonRow >
424
+ </ Box >
425
+ { /* <DashNav
415
426
dashboard={dashboard}
416
427
title={dashboard.title}
417
428
folderTitle={dashboard.meta.folderTitle}
418
429
isFullscreen={!!viewPanel}
419
430
onAddPanel={this.onAddPanel}
420
431
kioskMode={kioskMode}
421
432
hideTimePicker={dashboard.timepicker.hidden}
422
- />
433
+ /> */ }
423
434
</ header >
424
435
) }
425
436
{ ! FNDashboard && < DashboardPrompt dashboard = { dashboard } /> }
426
437
{ initError && < DashboardFailed /> }
427
- { showSubMenu && ! FNDashboard && (
438
+ { showSubMenu && (
428
439
< section aria-label = { selectors . pages . Dashboard . SubMenu . submenu } >
429
440
< SubMenu dashboard = { dashboard } annotations = { dashboard . annotations . list } links = { dashboard . links } />
430
441
</ section >
0 commit comments