mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TimeZonePicker: expose for panel configuraiton (#23523)
This commit is contained in:
parent
1378cadb68
commit
c344422a68
@ -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,
|
||||
];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user