From 38c0e91666539559aa1d9e8ab6ce31a86951d48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 15 Jan 2019 11:26:13 +0100 Subject: [PATCH] Remove BasicGaugeColor from state --- .../components/ThresholdsEditor/ThresholdsEditor.test.tsx | 3 --- .../src/components/ThresholdsEditor/ThresholdsEditor.tsx | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx index e07cf3ae862..845ff5f6bf4 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx +++ b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { shallow } from 'enzyme'; import { ThresholdsEditor, Props } from './ThresholdsEditor'; -import { BasicGaugeColor } from '../../types'; const setup = (propOverrides?: object) => { const props: Props = { @@ -135,7 +134,6 @@ describe('change threshold value', () => { ]; instance.state = { - baseColor: BasicGaugeColor.Green, thresholds, }; @@ -161,7 +159,6 @@ describe('on blur threshold value', () => { ]; instance.state = { - baseColor: BasicGaugeColor.Green, thresholds, }; diff --git a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx index e2717433f87..87845dedd7a 100644 --- a/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx +++ b/packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; // import tinycolor, { ColorInput } from 'tinycolor2'; -import { Threshold, BasicGaugeColor } from '../../types'; +import { Threshold } from '../../types'; import { ColorPicker } from '../ColorPicker/ColorPicker'; import { PanelOptionsGroup } from '../PanelOptionsGroup/PanelOptionsGroup'; import { colors } from '../../utils'; @@ -13,7 +13,6 @@ export interface Props { interface State { thresholds: Threshold[]; - baseColor: string; } export class ThresholdsEditor extends PureComponent { @@ -22,7 +21,7 @@ export class ThresholdsEditor extends PureComponent { const thresholds: Threshold[] = 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) => {