From 95876f2be7e9d0dda4c164fad5e71f5042ab0239 Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Wed, 15 Apr 2020 21:33:07 +0200 Subject: [PATCH] @grafana/ui: Remove ColorPallete component (#23592) * Remove ColorPalette and its tests as it is not used anywhere * Remove obsolete snapshot test --- .../ColorPicker/ColorPalette.test.tsx | 10 - .../components/ColorPicker/ColorPalette.tsx | 44 -- .../__snapshots__/ColorPalette.test.tsx.snap | 628 ------------------ 3 files changed, 682 deletions(-) delete mode 100644 packages/grafana-ui/src/components/ColorPicker/ColorPalette.test.tsx delete mode 100644 packages/grafana-ui/src/components/ColorPicker/ColorPalette.tsx delete mode 100644 packages/grafana-ui/src/components/ColorPicker/__snapshots__/ColorPalette.test.tsx.snap diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorPalette.test.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorPalette.test.tsx deleted file mode 100644 index 0714180de54..00000000000 --- a/packages/grafana-ui/src/components/ColorPicker/ColorPalette.test.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import renderer from 'react-test-renderer'; -import { ColorPalette } from './ColorPalette'; - -describe('CollorPalette', () => { - it('renders correctly', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); - }); -}); diff --git a/packages/grafana-ui/src/components/ColorPicker/ColorPalette.tsx b/packages/grafana-ui/src/components/ColorPicker/ColorPalette.tsx deleted file mode 100644 index 03ed9949361..00000000000 --- a/packages/grafana-ui/src/components/ColorPicker/ColorPalette.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react'; -import { sortedColors } from '../../utils'; - -export interface Props { - color: string; - onColorSelect: (c: string) => void; -} - -export class ColorPalette extends React.Component { - paletteColors: string[]; - - constructor(props: Props) { - super(props); - this.paletteColors = sortedColors; - this.onColorSelect = this.onColorSelect.bind(this); - } - - onColorSelect(color: string) { - return () => { - this.props.onColorSelect(color); - }; - } - - render() { - const colorPaletteItems = this.paletteColors.map(paletteColor => { - const cssClass = paletteColor.toLowerCase() === this.props.color.toLowerCase() ? 'fa-circle-o' : 'fa-circle'; - return ( - -   - - ); - }); - return ( -
-

{colorPaletteItems}

-
- ); - } -} diff --git a/packages/grafana-ui/src/components/ColorPicker/__snapshots__/ColorPalette.test.tsx.snap b/packages/grafana-ui/src/components/ColorPicker/__snapshots__/ColorPalette.test.tsx.snap deleted file mode 100644 index 38611cab7cc..00000000000 --- a/packages/grafana-ui/src/components/ColorPicker/__snapshots__/ColorPalette.test.tsx.snap +++ /dev/null @@ -1,628 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`CollorPalette renders correctly 1`] = ` -
-

- -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - - -   - -

-
-`;