creating table data type

This commit is contained in:
Peter Holmberg
2019-01-31 09:59:21 +01:00
parent 67756c43a7
commit 88cb38adde
7 changed files with 58 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { shallow } from 'enzyme';
import { Gauge, Props } from './Gauge';
import { TimeSeriesVMs } from '../../types/series';
import { TimeSeriesVMs } from '../../types/data';
import { ValueMapping, MappingType } from '../../types';
jest.mock('jquery', () => ({

View File

@@ -52,3 +52,20 @@ export interface TimeSeriesVMs {
[index: number]: TimeSeriesVM;
length: number;
}
interface Column {
text: string;
title?: string;
type?: string;
sort?: boolean;
desc?: boolean;
filterable?: boolean;
unit?: string;
}
export interface TableData {
columns: Column[];
rows: any[];
type: string;
columnMap: any;
}

View File

@@ -1,9 +1,8 @@
import { TimeRange, RawTimeRange } from './time';
import { TimeSeries } from './series';
import { PluginMeta } from './plugin';
export interface DataQueryResponse {
data: TimeSeries[];
data: any;
}
export interface DataQuery {

View File

@@ -1,4 +1,4 @@
export * from './series';
export * from './data';
export * from './time';
export * from './panel';
export * from './plugin';

View File

@@ -1,4 +1,4 @@
import { TimeSeries, LoadingState } from './series';
import { TimeSeries, LoadingState, TableData } from './data';
import { TimeRange } from './time';
export type InterpolateFunction = (value: string, format?: string | Function) => string;
@@ -14,6 +14,11 @@ export interface PanelProps<T = any> {
onInterpolate: InterpolateFunction;
}
export interface PanelData {
timeSeries?: TimeSeries[];
tableData?: TableData;
}
export interface PanelOptionsProps<T = any> {
options: T;
onChange: (options: T) => void;