diff --git a/packages/grafana-schema/src/schema/mudball.cue b/packages/grafana-schema/src/schema/mudball.cue index 0a6d423cd48..e101d9ea65c 100644 --- a/packages/grafana-schema/src/schema/mudball.cue +++ b/packages/grafana-schema/src/schema/mudball.cue @@ -175,7 +175,7 @@ OptionsWithLegend: { // TODO docs OptionsWithTimezones: { - timezones?: [...string] + timezone?: [...string] } @cuetsy(kind="interface") // TODO docs diff --git a/packages/grafana-schema/src/schema/mudball.gen.ts b/packages/grafana-schema/src/schema/mudball.gen.ts index 33834d5c365..078650f0b56 100644 --- a/packages/grafana-schema/src/schema/mudball.gen.ts +++ b/packages/grafana-schema/src/schema/mudball.gen.ts @@ -208,11 +208,11 @@ export interface OptionsWithLegend { } export interface OptionsWithTimezones { - timezones?: string[]; + timezone?: string[]; } export const defaultOptionsWithTimezones: Partial = { - timezones: [], + timezone: [], }; export interface OptionsWithTextFormatting { diff --git a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx index 72a2a5db301..09cbf6783ea 100644 --- a/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx +++ b/packages/grafana-ui/src/components/GraphNG/GraphNG.tsx @@ -44,7 +44,7 @@ export interface GraphNGProps extends Themeable2 { width: number; height: number; timeRange: TimeRange; - timeZones: TimeZone[] | TimeZone; + timeZone: TimeZone[] | TimeZone; legend: VizLegendOptions; fields?: XYFieldMatchers; // default will assume timeseries data renderers?: Renderers; @@ -216,17 +216,17 @@ export class GraphNG extends Component { } componentDidUpdate(prevProps: GraphNGProps) { - const { frames, structureRev, timeZones, propsToDiff } = this.props; + const { frames, structureRev, timeZone, propsToDiff } = this.props; const propsChanged = !sameProps(prevProps, this.props, propsToDiff); - if (frames !== prevProps.frames || propsChanged || timeZones !== prevProps.timeZones) { + if (frames !== prevProps.frames || propsChanged || timeZone !== prevProps.timeZone) { let newState = this.prepState(this.props, false); if (newState) { const shouldReconfig = this.state.config === undefined || - timeZones !== prevProps.timeZones || + timeZone !== prevProps.timeZone || structureRev !== prevProps.structureRev || !structureRev || propsChanged; diff --git a/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx b/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx index 648de7ba22b..9dd4a7c385d 100644 --- a/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx +++ b/packages/grafana-ui/src/components/TimeSeries/TimeSeries.tsx @@ -20,12 +20,12 @@ export class UnthemedTimeSeries extends Component { prepConfig = (alignedFrame: DataFrame, allFrames: DataFrame[], getTimeRange: () => TimeRange) => { const { eventBus, sync } = this.context as PanelContext; - const { theme, timeZones, renderers, tweakAxis, tweakScale } = this.props; + const { theme, timeZone, renderers, tweakAxis, tweakScale } = this.props; return preparePlotConfigBuilder({ frame: alignedFrame, theme, - timeZones: Array.isArray(timeZones) ? timeZones : [timeZones], + timeZones: Array.isArray(timeZone) ? timeZone : [timeZone], getTimeRange, eventBus, sync, diff --git a/public/app/plugins/panel/barchart/BarChartPanel.tsx b/public/app/plugins/panel/barchart/BarChartPanel.tsx index a36ddac4201..8416a943ca8 100644 --- a/public/app/plugins/panel/barchart/BarChartPanel.tsx +++ b/public/app/plugins/panel/barchart/BarChartPanel.tsx @@ -277,7 +277,7 @@ export const BarChartPanel: React.FunctionComponent = ({ preparePlotFrame={(f) => f[0]} // already processed in by the panel above! renderLegend={renderLegend} legend={options.legend} - timeZones={timeZone} + timeZone={timeZone} timeRange={{ from: 1, to: 1 } as unknown as TimeRange} // HACK structureRev={structureRev} width={width} diff --git a/public/app/plugins/panel/candlestick/CandlestickPanel.tsx b/public/app/plugins/panel/candlestick/CandlestickPanel.tsx index 6fe572658a1..aa4544ebb71 100644 --- a/public/app/plugins/panel/candlestick/CandlestickPanel.tsx +++ b/public/app/plugins/panel/candlestick/CandlestickPanel.tsx @@ -233,7 +233,7 @@ export const CandlestickPanel: React.FC = ({ frames={[info.frame]} structureRev={data.structureRev} timeRange={timeRange} - timeZones={timeZone} + timeZone={timeZone} width={width} height={height} legend={options.legend} diff --git a/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx b/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx index 51a7a9146a3..966ad8d8c22 100644 --- a/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx +++ b/public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx @@ -67,7 +67,7 @@ export const StateTimelinePanel: React.FC = ({ [frames, options.legend, theme] ); - const timezones = useMemo(() => getTimezones(options.timezones, timeZone), [options.timezones, timeZone]); + const timezones = useMemo(() => getTimezones(options.timezone, timeZone), [options.timezone, timeZone]); const renderCustomTooltip = useCallback( (alignedData: DataFrame, seriesIdx: number | null, datapointIdx: number | null, onAnnotationAdd?: () => void) => { @@ -153,7 +153,7 @@ export const StateTimelinePanel: React.FC = ({ frames={frames} structureRev={data.structureRev} timeRange={timeRange} - timeZones={timezones} + timeZone={timezones} width={width} height={height} legendItems={legendItems} diff --git a/public/app/plugins/panel/state-timeline/TimelineChart.tsx b/public/app/plugins/panel/state-timeline/TimelineChart.tsx index 9eb63a960d4..8c2cac0e5c8 100644 --- a/public/app/plugins/panel/state-timeline/TimelineChart.tsx +++ b/public/app/plugins/panel/state-timeline/TimelineChart.tsx @@ -62,7 +62,7 @@ export class TimelineChart extends React.Component { ...this.props, // Ensure timezones is passed as an array - timeZones: Array.isArray(this.props.timeZones) ? this.props.timeZones : [this.props.timeZones], + timeZones: Array.isArray(this.props.timeZone) ? this.props.timeZone : [this.props.timeZone], // When there is only one row, use the full space rowHeight: alignedFrame.fields.length > 2 ? this.props.rowHeight : 1, diff --git a/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx b/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx index be01c2d78bb..fac039f47be 100644 --- a/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx +++ b/public/app/plugins/panel/status-history/StatusHistoryPanel.tsx @@ -126,7 +126,7 @@ export const StatusHistoryPanel: React.FC = ({ [timeZone, frames, shouldDisplayCloseButton] ); - const timezones = useMemo(() => getTimezones(options.timezones, timeZone), [options.timezones, timeZone]); + const timezones = useMemo(() => getTimezones(options.timezone, timeZone), [options.timezone, timeZone]); if (!frames || warn) { return ( @@ -154,7 +154,7 @@ export const StatusHistoryPanel: React.FC = ({ frames={frames} structureRev={data.structureRev} timeRange={timeRange} - timeZones={timezones} + timeZone={timezones} width={width} height={height} legendItems={legendItems} diff --git a/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx b/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx index a5bf02bb08f..a622e32b4a3 100644 --- a/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx +++ b/public/app/plugins/panel/timeseries/TimeSeriesPanel.tsx @@ -37,7 +37,7 @@ export const TimeSeriesPanel: React.FC = ({ }; const frames = useMemo(() => prepareGraphableFields(data.series, config.theme2, timeRange), [data, timeRange]); - const timezones = useMemo(() => getTimezones(options.timezones, timeZone), [options.timezones, timeZone]); + const timezones = useMemo(() => getTimezones(options.timezone, timeZone), [options.timezone, timeZone]); if (!frames) { return ( @@ -58,7 +58,7 @@ export const TimeSeriesPanel: React.FC = ({ frames={frames} structureRev={data.structureRev} timeRange={timeRange} - timeZones={timezones} + timeZone={timezones} width={width} height={height} legend={options.legend}