Moved defaultProps to ui/components

This commit is contained in:
Hugo Häggmark
2019-01-11 09:16:53 +01:00
parent 0b8165fee2
commit 5ceedc4ac4
6 changed files with 31 additions and 27 deletions

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { shallow } from 'enzyme';
import { BasicGaugeColor, GaugeOptions, PanelOptionsProps } from '@grafana/ui';
import { ThresholdsEditor } from './ThresholdsEditor';
import { BasicGaugeColor, PanelOptionsProps, GaugeOptions } from '../../types';
const defaultProps = {
options: {

View File

@@ -1,6 +1,8 @@
import React, { PureComponent } from 'react';
import tinycolor, { ColorInput } from 'tinycolor2';
import { BasicGaugeColor, ColorPicker, GaugeOptions, PanelOptionsProps, Threshold } from '@grafana/ui';
import { Threshold, PanelOptionsProps, GaugeOptions, BasicGaugeColor } from '../../types';
import { ColorPicker } from '../ColorPicker/ColorPicker';
interface State {
thresholds: Threshold[];

View File

@@ -1,4 +1,4 @@
import { RangeMap, Threshold, ValueMap } from '@grafana/ui';
import { BasicGaugeColor, RangeMap, Threshold, ValueMap } from './panel';
export interface GaugeOptions {
baseColor: string;
@@ -14,3 +14,20 @@ export interface GaugeOptions {
thresholds: Threshold[];
unit: string;
}
export const GaugePanelOptionsDefaultProps = {
options: {
baseColor: BasicGaugeColor.Green,
minValue: 0,
maxValue: 100,
prefix: '',
showThresholdMarkers: true,
showThresholdLabels: false,
suffix: '',
decimals: 0,
stat: 'avg',
unit: 'none',
mappings: [],
thresholds: [],
},
};