|
@@ -1,6 +1,6 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
import React, { PureComponent } from 'react';
|
|
|
import Select from './Select';
|
|
import Select from './Select';
|
|
|
-import kbn from 'app/core/utils/kbn';
|
|
|
|
|
|
|
+import { getValueFormats } from '@grafana/ui';
|
|
|
|
|
|
|
|
interface Props {
|
|
interface Props {
|
|
|
onChange: (item: any) => void;
|
|
onChange: (item: any) => void;
|
|
@@ -16,14 +16,14 @@ export default class UnitPicker extends PureComponent<Props> {
|
|
|
render() {
|
|
render() {
|
|
|
const { defaultValue, onChange, width } = this.props;
|
|
const { defaultValue, onChange, width } = this.props;
|
|
|
|
|
|
|
|
- const unitGroups = kbn.getUnitFormats();
|
|
|
|
|
|
|
+ const unitGroups = getValueFormats();
|
|
|
|
|
|
|
|
// Need to transform the data structure to work well with Select
|
|
// Need to transform the data structure to work well with Select
|
|
|
const groupOptions = unitGroups.map(group => {
|
|
const groupOptions = unitGroups.map(group => {
|
|
|
const options = group.submenu.map(unit => {
|
|
const options = group.submenu.map(unit => {
|
|
|
return {
|
|
return {
|
|
|
label: unit.text,
|
|
label: unit.text,
|
|
|
- value: unit.id,
|
|
|
|
|
|
|
+ value: unit.value,
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|