grafana/public/app/features/profile/state/reducers.ts
Marcus Efraimsson 02cb7ff436
Explore: Support user timezone (#16469)
Explore now uses the timezone of the user to decide if local browser 
time or UTC should be used. 
- Now uses TimeRange instead of RawTimeRange in explore item
state tree and only parsing actual time in a few action
handlers.
- Time picker should now properly handle moving back/forward and
apply time range when both utc and non utc time zone.
- URL range representation is changed from YYYY-MM-DD HH:mm:ss
to epoch ms.
- Now uses AbsoluteTimeRange in graph component instead of moment.
- Makes a copy of the time range passed to timeSrv to make sure immutability
of explore time range when for example elasticsearch test datasources uses
timeSrv and sets a time range of last 1 min.
- Various refactorings and cleanup.

Closes #12812
2019-04-29 18:28:41 +02:00

16 lines
343 B
TypeScript

import { UserState } from 'app/types';
import config from 'app/core/config';
export const initialState: UserState = {
orgId: config.bootData.user.orgId,
timeZone: config.bootData.user.timezone,
};
export const userReducer = (state = initialState, action: any): UserState => {
return state;
};
export default {
user: userReducer,
};