mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove BasicGaugeColor from state
This commit is contained in:
parent
0b1aea905a
commit
38c0e91666
@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import { ThresholdsEditor, Props } from './ThresholdsEditor';
|
import { ThresholdsEditor, Props } from './ThresholdsEditor';
|
||||||
import { BasicGaugeColor } from '../../types';
|
|
||||||
|
|
||||||
const setup = (propOverrides?: object) => {
|
const setup = (propOverrides?: object) => {
|
||||||
const props: Props = {
|
const props: Props = {
|
||||||
@ -135,7 +134,6 @@ describe('change threshold value', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
instance.state = {
|
instance.state = {
|
||||||
baseColor: BasicGaugeColor.Green,
|
|
||||||
thresholds,
|
thresholds,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -161,7 +159,6 @@ describe('on blur threshold value', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
instance.state = {
|
instance.state = {
|
||||||
baseColor: BasicGaugeColor.Green,
|
|
||||||
thresholds,
|
thresholds,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
// import tinycolor, { ColorInput } from 'tinycolor2';
|
// import tinycolor, { ColorInput } from 'tinycolor2';
|
||||||
|
|
||||||
import { Threshold, BasicGaugeColor } from '../../types';
|
import { Threshold } from '../../types';
|
||||||
import { ColorPicker } from '../ColorPicker/ColorPicker';
|
import { ColorPicker } from '../ColorPicker/ColorPicker';
|
||||||
import { PanelOptionsGroup } from '../PanelOptionsGroup/PanelOptionsGroup';
|
import { PanelOptionsGroup } from '../PanelOptionsGroup/PanelOptionsGroup';
|
||||||
import { colors } from '../../utils';
|
import { colors } from '../../utils';
|
||||||
@ -13,7 +13,6 @@ export interface Props {
|
|||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
thresholds: Threshold[];
|
thresholds: Threshold[];
|
||||||
baseColor: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ThresholdsEditor extends PureComponent<Props, State> {
|
export class ThresholdsEditor extends PureComponent<Props, State> {
|
||||||
@ -22,7 +21,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
|
|||||||
|
|
||||||
const thresholds: Threshold[] =
|
const thresholds: Threshold[] =
|
||||||
props.thresholds.length > 0 ? props.thresholds : [{ index: 0, value: -Infinity, color: colors[0] }];
|
props.thresholds.length > 0 ? props.thresholds : [{ index: 0, value: -Infinity, color: colors[0] }];
|
||||||
this.state = { thresholds, baseColor: BasicGaugeColor.Green };
|
this.state = { thresholds };
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddThreshold = (index: number) => {
|
onAddThreshold = (index: number) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user