Updated table tests to new behavior for colors (values are always rendered as hex/rgb)

This commit is contained in:
Dominik Prokop
2019-01-21 15:16:07 +01:00
parent 84caf0bc9d
commit ed48ecfe1d
6 changed files with 24 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ import Popper, { RenderPopperArrowFn } from '../Tooltip/Popper';
import { ColorPickerPopover } from './ColorPickerPopover';
import { Themeable, GrafanaTheme } from '../../types';
import { getColorFromHexRgbOrName } from '../../utils/colorsPalette';
import { SeriesColorPickerPopover } from './SeriesColorPickerPopover';
export interface ColorPickerProps extends Themeable {
color: string;
@@ -78,4 +79,5 @@ export const colorPickerFactory = <T extends ColorPickerProps>(
};
};
export default colorPickerFactory(ColorPickerPopover, 'ColorPicker');
export const ColorPicker = colorPickerFactory(ColorPickerPopover, 'ColorPicker');
export const SeriesColorPicker = colorPickerFactory(SeriesColorPickerPopover, 'SeriesColorPicker');

View File

@@ -1,11 +0,0 @@
import { SeriesColorPickerPopover } from './SeriesColorPickerPopover';
import { ColorPickerProps, colorPickerFactory } from './ColorPicker';
export interface SeriesColorPickerProps extends ColorPickerProps {
yaxis?: number;
optionalClass?: string;
onToggleAxis?: () => void;
children: JSX.Element;
}
export default colorPickerFactory(SeriesColorPickerPopover ,'SeriesColorPicker')

View File

@@ -1,8 +1,6 @@
import React, { PureComponent } from 'react';
// import tinycolor, { ColorInput } from 'tinycolor2';
import { Threshold } from '../../types';
import ColorPicker from '../ColorPicker/ColorPicker';
import { ColorPicker } from '../ColorPicker/ColorPicker';
import { PanelOptionsGroup } from '../PanelOptionsGroup/PanelOptionsGroup';
import { colors } from '../../utils';

View File

@@ -14,9 +14,8 @@ export { FormLabel } from './FormLabel/FormLabel';
export { FormField } from './FormField/FormField';
export { LoadingPlaceholder } from './LoadingPlaceholder/LoadingPlaceholder';
export { default as ColorPicker } from './ColorPicker/ColorPicker';
export { ColorPicker, SeriesColorPicker } from './ColorPicker/ColorPicker';
export { SeriesColorPickerPopover } from './ColorPicker/SeriesColorPickerPopover';
export { default as SeriesColorPicker } from './ColorPicker/SeriesColorPicker';
export { ThresholdsEditor } from './ThresholdsEditor/ThresholdsEditor';
export { Graph } from './Graph/Graph';
export { PanelOptionsGroup } from './PanelOptionsGroup/PanelOptionsGroup';