Moved Thresholds and styles to grafana/ui/components

This commit is contained in:
Hugo Häggmark 2019-01-10 09:37:32 +01:00
parent dc9b83030f
commit 1581662a6c
10 changed files with 19 additions and 18 deletions

View File

@ -1,10 +1,10 @@
import React from 'react';
import { shallow } from 'enzyme';
import Thresholds from './Thresholds';
import { defaultProps } from './GaugePanelOptions';
import { BasicGaugeColor } from 'app/types';
import { PanelOptionsProps } from '@grafana/ui';
import { Options } from './types';
import { defaultProps } from 'app/plugins/panel/gauge/GaugePanelOptions';
import { Options } from 'app/plugins/panel/gauge/types';
import { BasicGaugeColor } from 'app/types';
import { Thresholds } from './Thresholds';
const setup = (propOverrides?: object) => {
const props: PanelOptionsProps<Options> = {

View File

@ -1,16 +1,16 @@
import React, { PureComponent } from 'react';
import tinycolor from 'tinycolor2';
import { ColorPicker } from '@grafana/ui';
import { BasicGaugeColor, Threshold } from 'app/types';
import { PanelOptionsProps } from '@grafana/ui';
import { Options } from './types';
import { BasicGaugeColor } from 'app/types';
import { PanelOptionsProps, Threshold } from '@grafana/ui';
import { Options } from 'app/plugins/panel/gauge/types';
interface State {
thresholds: Threshold[];
baseColor: string;
}
export default class Thresholds extends PureComponent<PanelOptionsProps<Options>, State> {
export class Thresholds extends PureComponent<PanelOptionsProps<Options>, State> {
constructor(props) {
super(props);

View File

@ -1,3 +1,4 @@
@import 'CustomScrollbar/CustomScrollbar';
@import 'DeleteButton/DeleteButton';
@import 'Thresholds/Thresholds';
@import 'Tooltip/Tooltip';

View File

@ -5,3 +5,4 @@ export { CustomScrollbar } from './CustomScrollbar/CustomScrollbar';
export { ColorPicker } from './ColorPicker/ColorPicker';
export { SeriesColorPickerPopover } from './ColorPicker/SeriesColorPickerPopover';
export { SeriesColorPicker } from './ColorPicker/SeriesColorPicker';
export { Thresholds } from './Thresholds/Thresholds';

View File

@ -29,3 +29,9 @@ export interface PanelMenuItem {
shortcut?: string;
subMenu?: PanelMenuItem[];
}
export interface Threshold {
index: number;
value: number;
color?: string;
}

View File

@ -1,8 +1,7 @@
import React, { PureComponent } from 'react';
import ValueOptions from 'app/plugins/panel/gauge/ValueOptions';
import Thresholds from 'app/plugins/panel/gauge/Thresholds';
import { BasicGaugeColor } from 'app/types';
import { PanelOptionsProps } from '@grafana/ui';
import { PanelOptionsProps, Thresholds } from '@grafana/ui';
import ValueMappings from 'app/plugins/panel/gauge/ValueMappings';
import { Options } from './types';
import GaugeOptions from './GaugeOptions';

View File

@ -9,7 +9,7 @@ import { ApiKey, ApiKeysState, NewApiKey } from './apiKeys';
import { Invitee, OrgUser, User, UsersState, UserState } from './user';
import { DataSource, DataSourceSelectItem, DataSourcesState } from './datasources';
import { DataQuery, DataQueryResponse, DataQueryOptions } from './series';
import { BasicGaugeColor, MappingType, RangeMap, Threshold, ValueMap } from './panel';
import { BasicGaugeColor, MappingType, RangeMap, ValueMap } from './panel';
import { PluginDashboard, PluginMeta, Plugin, PanelPlugin, PluginsState } from './plugins';
import { Organization, OrganizationState } from './organization';
import {
@ -20,6 +20,7 @@ import {
} from './appNotifications';
import { DashboardSearchHit } from './search';
import { ValidationEvents, ValidationRule } from './form';
import { Threshold } from '@grafana/ui';
export {
Team,
TeamsState,

View File

@ -1,9 +1,3 @@
export interface Threshold {
index: number;
value: number;
color?: string;
}
export enum MappingType {
ValueToText = 1,
RangeToText = 2,

View File

@ -102,7 +102,6 @@
@import 'components/toolbar';
@import 'components/add_data_source.scss';
@import 'components/page_loader';
@import 'components/thresholds';
@import 'components/toggle_button_group';
@import 'components/value-mappings';
@import 'components/popover-box';