diff --git a/ui/src/dashboards/components/TemplateControlBar.tsx b/ui/src/dashboards/components/TemplateControlBar.tsx index 1179f3c237..08464cd513 100644 --- a/ui/src/dashboards/components/TemplateControlBar.tsx +++ b/ui/src/dashboards/components/TemplateControlBar.tsx @@ -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 diff --git a/ui/src/dashboards/components/TemplateControlDropdown.tsx b/ui/src/dashboards/components/TemplateControlDropdown.tsx index 6bb2155cfe..0e0c34ca9a 100644 --- a/ui/src/dashboards/components/TemplateControlDropdown.tsx +++ b/ui/src/dashboards/components/TemplateControlDropdown.tsx @@ -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 diff --git a/ui/src/dashboards/utils/tempVars.ts b/ui/src/dashboards/utils/tempVars.ts index 4338216dfe..482e7c07f7 100644 --- a/ui/src/dashboards/utils/tempVars.ts +++ b/ui/src/dashboards/utils/tempVars.ts @@ -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 diff --git a/ui/src/types/dashboard.ts b/ui/src/types/dashboard.ts index 53f82750f4..aa72ff1e0d 100644 --- a/ui/src/types/dashboard.ts +++ b/ui/src/types/dashboard.ts @@ -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 diff --git a/ui/src/types/index.ts b/ui/src/types/index.ts index 72059c0c73..66d0343207 100644 --- a/ui/src/types/index.ts +++ b/ui/src/types/index.ts @@ -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, diff --git a/ui/src/types/shared.ts b/ui/src/types/shared.ts index 4af8701ca4..600cc59a7c 100644 --- a/ui/src/types/shared.ts +++ b/ui/src/types/shared.ts @@ -16,7 +16,3 @@ export interface PageSection { component: ReactNode enabled: boolean } - -export interface URLQueries { - [key: string]: string -} diff --git a/ui/src/types/tempVars.ts b/ui/src/types/tempVars.ts new file mode 100644 index 0000000000..0929501e8e --- /dev/null +++ b/ui/src/types/tempVars.ts @@ -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 +}