From ee4df155261eb65b6c69b705232306f0c06250f0 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Tue, 5 Mar 2019 13:55:29 +0100 Subject: [PATCH] moving --- .../grafana-ui/src/components/UnitPicker}/UnitPicker.tsx | 8 +++++--- packages/grafana-ui/src/components/index.ts | 1 + public/app/plugins/panel/gauge/SingleStatValueEditor.tsx | 3 +-- 3 files changed, 7 insertions(+), 5 deletions(-) rename {public/app/core/components/Select => packages/grafana-ui/src/components/UnitPicker}/UnitPicker.tsx (87%) diff --git a/public/app/core/components/Select/UnitPicker.tsx b/packages/grafana-ui/src/components/UnitPicker/UnitPicker.tsx similarity index 87% rename from public/app/core/components/Select/UnitPicker.tsx rename to packages/grafana-ui/src/components/UnitPicker/UnitPicker.tsx index f9dbc0ae421..3a34df02a39 100644 --- a/public/app/core/components/Select/UnitPicker.tsx +++ b/packages/grafana-ui/src/components/UnitPicker/UnitPicker.tsx @@ -1,6 +1,8 @@ import React, { PureComponent } from 'react'; -import { getValueFormats } from '@grafana/ui'; -import { Select } from '@grafana/ui'; + +import { Select } from '..'; + +import { getValueFormats } from '../../utils'; interface Props { onChange: (item: any) => void; @@ -8,7 +10,7 @@ interface Props { width?: number; } -export default class UnitPicker extends PureComponent { +export class UnitPicker extends PureComponent { static defaultProps = { width: 12, }; diff --git a/packages/grafana-ui/src/components/index.ts b/packages/grafana-ui/src/components/index.ts index ca8899bd928..b62fdff6498 100644 --- a/packages/grafana-ui/src/components/index.ts +++ b/packages/grafana-ui/src/components/index.ts @@ -26,3 +26,4 @@ export { ValueMappingsEditor } from './ValueMappingsEditor/ValueMappingsEditor'; export { Gauge } from './Gauge/Gauge'; export { Switch } from './Switch/Switch'; export { EmptySearchResult } from './EmptySearchResult/EmptySearchResult'; +export { UnitPicker } from './UnitPicker/UnitPicker'; diff --git a/public/app/plugins/panel/gauge/SingleStatValueEditor.tsx b/public/app/plugins/panel/gauge/SingleStatValueEditor.tsx index 86c177bb5e5..e711df6a2d3 100644 --- a/public/app/plugins/panel/gauge/SingleStatValueEditor.tsx +++ b/public/app/plugins/panel/gauge/SingleStatValueEditor.tsx @@ -2,8 +2,7 @@ import React, { PureComponent } from 'react'; // Components -import UnitPicker from 'app/core/components/Select/UnitPicker'; -import { FormField, FormLabel, PanelOptionsGroup, Select } from '@grafana/ui'; +import { FormField, FormLabel, PanelOptionsGroup, Select, UnitPicker } from '@grafana/ui'; // Types import { SingleStatValueOptions } from './types';