mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
value formats: another rename and updates code to use new valueFormats func
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import Select from './Select';
|
||||
import kbn from 'app/core/utils/kbn';
|
||||
import { getValueFormats } from '@grafana/ui';
|
||||
|
||||
interface Props {
|
||||
onChange: (item: any) => void;
|
||||
@@ -16,14 +16,14 @@ export default class UnitPicker extends PureComponent<Props> {
|
||||
render() {
|
||||
const { defaultValue, onChange, width } = this.props;
|
||||
|
||||
const unitGroups = kbn.getUnitFormats();
|
||||
const unitGroups = getValueFormats();
|
||||
|
||||
// Need to transform the data structure to work well with Select
|
||||
const groupOptions = unitGroups.map(group => {
|
||||
const options = group.submenu.map(unit => {
|
||||
return {
|
||||
label: unit.text,
|
||||
value: unit.id,
|
||||
value: unit.value,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user