Explorar o código

Remove BasicGaugeColor from state

Hugo Häggmark %!s(int64=7) %!d(string=hai) anos
pai
achega
38c0e91666

+ 0 - 3
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,
     };
 

+ 2 - 3
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<Props, State> {
@@ -22,7 +21,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
 
     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) => {