mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard Settings: Fix TimeZone dropdown doesn't change the timezone (#35680)
* Use redux action to update dashboard.timezone * Added unit test Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
This commit is contained in:
@@ -11,12 +11,14 @@ import {
|
||||
} from './reducers';
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import { loadPanelPlugin } from 'app/features/plugins/state/actions';
|
||||
import { updateTimeZoneForSession } from 'app/features/profile/state/reducers';
|
||||
// Types
|
||||
import { DashboardAcl, DashboardAclUpdateDTO, NewDashboardAclItem, PermissionLevel, ThunkResult } from 'app/types';
|
||||
import { PanelModel } from './PanelModel';
|
||||
import { cancelVariables } from '../../variables/state/actions';
|
||||
import { getPanelPluginNotFound } from '../dashgrid/PanelPluginError';
|
||||
import { getTimeSrv } from '../services/TimeSrv';
|
||||
import { TimeZone } from '@grafana/data';
|
||||
|
||||
export function getDashboardPermissions(id: number): ThunkResult<void> {
|
||||
return async (dispatch) => {
|
||||
@@ -181,3 +183,8 @@ export const cleanUpDashboardAndVariables = (): ThunkResult<void> => (dispatch,
|
||||
dispatch(cleanUpDashboard());
|
||||
dispatch(cancelVariables());
|
||||
};
|
||||
|
||||
export const updateTimeZoneDashboard = (timeZone: TimeZone): ThunkResult<void> => (dispatch) => {
|
||||
dispatch(updateTimeZoneForSession(timeZone));
|
||||
getTimeSrv().refreshDashboard();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user