value formats: another rename and updates code to use new valueFormats func

This commit is contained in:
Torkel Ödegaard
2019-01-11 13:31:25 +01:00
parent 8aae6e8c09
commit 9e6411bf4b
13 changed files with 14 additions and 12 deletions

View File

@@ -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,
};
});