Create file for tempVars types, move tempVar types there, and update imports

pull/10616/head
Jared Scheib 2018-06-08 18:38:22 -07:00
parent 93d09f5c12
commit a15a950992
7 changed files with 36 additions and 36 deletions

View File

@ -6,7 +6,7 @@ import uuid from 'uuid'
import Authorized, {EDITOR_ROLE} from 'src/auth/Authorized'
import TemplateControlDropdown from 'src/dashboards/components/TemplateControlDropdown'
import {Template} from 'src/types/dashboard'
import {Template} from 'src/types/tempVars'
interface Props {
meRole: string

View File

@ -3,7 +3,7 @@ import React, {SFC} from 'react'
import Dropdown from 'src/shared/components/Dropdown'
import {calculateDropdownWidth} from 'src/dashboards/constants/templateControlBar'
import {isUserAuthorized, EDITOR_ROLE} from 'src/auth/Authorized'
import {Template} from 'src/types/dashboard'
import {Template} from 'src/types/tempVars'
interface Props {
template: Template

View File

@ -1,8 +1,7 @@
import _ from 'lodash'
import {TEMPLATE_VARIABLE_QUERIES} from 'src/dashboards/constants'
import {Template, TemplateQuery} from 'src/types/dashboard'
import {URLQueries} from 'src/types'
import {Template, TemplateQuery, URLQueries} from 'src/types/tempVars'
interface PartialTemplateWithQuery {
query: string

View File

@ -1,5 +1,6 @@
import {QueryConfig} from 'src/types'
import {ColorString} from 'src/types/colors'
import {Template} from 'src/types/tempVars'
interface Axis {
bounds: [string, string]
@ -96,32 +97,6 @@ export enum CellType {
Guide = 'guide',
}
export interface TemplateValue {
value: string
type: string
selected: boolean
}
export interface TemplateQuery {
command: string
db: string
database?: string
rp?: string
measurement: string
tagKey: string
fieldKey: string
influxql: string
}
export interface Template {
id: string
tempVar: string
values: TemplateValue[]
type: string
label: string
query?: TemplateQuery
}
interface DashboardLinks {
self: string
cells: string

View File

@ -1,7 +1,8 @@
import {LayoutCell, LayoutQuery} from './layouts'
import {Service, NewService} from './services'
import {AuthLinks, Organization, Role, User, Me} from './auth'
import {Template, Cell, CellQuery, Legend, Axes, Dashboard} from './dashboard'
import {Cell, CellQuery, Legend, Axes, Dashboard} from './dashboard'
import {Template, URLQueries} from './tempVars'
import {
GroupBy,
Query,
@ -20,7 +21,7 @@ import {
} from './query'
import {AlertRule, Kapacitor, Task} from './kapacitor'
import {Source, SourceLinks} from './sources'
import {DropdownAction, DropdownItem, URLQueries} from './shared'
import {DropdownAction, DropdownItem} from './shared'
import {
Notification,
NotificationFunc,

View File

@ -16,7 +16,3 @@ export interface PageSection {
component: ReactNode
enabled: boolean
}
export interface URLQueries {
[key: string]: string
}

29
ui/src/types/tempVars.ts Normal file
View File

@ -0,0 +1,29 @@
export interface TemplateValue {
value: string
type: string
selected: boolean
}
export interface TemplateQuery {
command: string
db: string
database?: string
rp?: string
measurement: string
tagKey: string
fieldKey: string
influxql: string
}
export interface Template {
id: string
tempVar: string
values: TemplateValue[]
type: string
label: string
query?: TemplateQuery
}
export interface URLQueries {
[key: string]: string
}