Commit c344422a by Ryan McKinley Committed by GitHub

TimeZonePicker: expose for panel configuraiton (#23523)

parent 1378cadb
......@@ -192,6 +192,15 @@ export class PanelOptionsEditorBuilder<TOptions> extends OptionsUIRegistryBuilde
});
}
addTimeZonePicker<TSettings = any>(config: PanelOptionsEditorConfig<TOptions, TSettings, string>): this {
return this.addCustomEditor({
...config,
id: config.path,
editor: standardEditorsRegistry.get('timezone').editor as any,
settings: config.settings || {},
});
}
addUnitPicker<TSettings = any>(
config: PanelOptionsEditorConfig<TOptions, TSettings & UnitFieldConfigSettings, string>
): this {
......
......@@ -17,6 +17,7 @@ import {
ValueMappingFieldConfigSettings,
valueMappingsOverrideProcessor,
ThresholdsMode,
TimeZone,
} from '@grafana/data';
import { Switch } from '../components/Switch/Switch';
......@@ -26,6 +27,7 @@ import {
StringValueEditor,
StringArrayEditor,
SelectValueEditor,
TimeZonePicker,
} from '../components';
import { ValueMappingsValueEditor } from '../components/OptionsUI/mappings';
import { ThresholdsValueEditor } from '../components/OptionsUI/thresholds';
......@@ -303,5 +305,26 @@ export const getStandardOptionEditors = () => {
description: '',
};
return [text, number, boolean, radio, select, unit, mappings, thresholds, links, color, statsPicker, strings];
const timeZone: StandardEditorsRegistryItem<TimeZone> = {
id: 'timezone',
name: 'Time Zone',
description: 'Time zone selection',
editor: TimeZonePicker as any,
};
return [
text,
number,
boolean,
radio,
select,
unit,
mappings,
thresholds,
links,
color,
statsPicker,
strings,
timeZone,
];
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment