Convert ITemplate types to documentcreate types

pull/12664/head
Deniz Kusefoglu 2019-03-15 17:01:04 -07:00
parent 28fd243fa2
commit bc106c269a
4 changed files with 10 additions and 10 deletions

View File

@ -11,10 +11,10 @@ import {dashboardToTemplate} from 'src/shared/utils/resourceToTemplate'
import {getDashboard, getView} from 'src/dashboards/apis'
// Types
import {ITemplate} from '@influxdata/influx'
import {DocumentCreate} from '@influxdata/influx'
interface State {
dashboardTemplate: ITemplate
dashboardTemplate: DocumentCreate
orgID: string
}

View File

@ -9,10 +9,10 @@ import {taskToTemplate} from 'src/shared/utils/resourceToTemplate'
// APIs
import {client} from 'src/utils/api'
import {ITemplate} from '@influxdata/influx'
import {DocumentCreate} from '@influxdata/influx'
interface State {
taskTemplate: ITemplate
taskTemplate: DocumentCreate
orgID: string
}

View File

@ -26,11 +26,11 @@ import {addOrgIDToTemplate} from 'src/shared/utils/resourceToTemplate'
import 'src/shared/components/ExportOverlay.scss'
// Types
import {ITemplate} from '@influxdata/influx'
import {DocumentCreate} from '@influxdata/influx'
interface OwnProps extends DefaultProps {
onDismissOverlay: () => void
resource: ITemplate
resource: DocumentCreate
resourceName: string
orgID: string
}

View File

@ -1,7 +1,7 @@
import _ from 'lodash'
import {getDeep} from 'src/utils/wrappers'
import {Task, Label, Dashboard, Cell, View} from 'src/types/v2'
import {ITemplate, TemplateType, DocumentCreate} from '@influxdata/influx'
import {TemplateType, DocumentCreate} from '@influxdata/influx'
const CURRENT_TEMPLATE_VERSION = '1'
@ -53,7 +53,7 @@ export const labelToIncluded = (l: Label) => {
export const taskToTemplate = (
task: Task,
baseTemplate = blankTaskTemplate()
): ITemplate => {
): DocumentCreate => {
const taskName = _.get(task, 'name', '')
const templateName = `${taskName}-Template`
@ -136,7 +136,7 @@ export const dashboardToTemplate = (
dashboard: Dashboard,
views: View[],
baseTemplate = blankDashboardTemplate()
): ITemplate => {
): DocumentCreate => {
const dashboardName = _.get(dashboard, 'name', '')
const templateName = `${dashboardName}-Template`
@ -183,7 +183,7 @@ export const dashboardToTemplate = (
}
export const addOrgIDToTemplate = (
template: ITemplate,
template: DocumentCreate,
orgID: string
): DocumentCreate => {
return {...template, orgID}