Convert ITemplate types to documentcreate types
parent
28fd243fa2
commit
bc106c269a
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue