Add function to get protoboards to wizard dashboards step

pull/4264/head
Deniz Kusefoglu 2018-08-23 11:01:56 -07:00
parent 5fbb9a2688
commit 3bb3d7c9a2
2 changed files with 17 additions and 0 deletions

View File

@ -8,3 +8,9 @@ export const getSourceHealth = async (url: string) => {
throw error
}
}
export const getProtoBoards = () =>
AJAX({
method: 'GET',
resource: 'protoboards',
})

View File

@ -3,6 +3,9 @@ import React, {PureComponent} from 'react'
import {withRouter, WithRouterProps} from 'react-router'
import _ from 'lodash'
// APIs
import {getProtoBoards} from 'src/sources/apis'
// Components
import {ErrorHandling} from 'src/shared/decorators/errors'
import WizardOverlay from 'src/reusable_ui/components/wizard/WizardOverlay'
@ -60,6 +63,14 @@ class ConnectionWizard extends PureComponent<Props & WithRouterProps, State> {
}
}
public componentDidMount = async () => {
const {
data: {protoboards},
} = await getProtoBoards()
this.setState({dashboards: protoboards})
}
public render() {
const {isVisible, toggleVisibility, jumpStep, showNewKapacitor} = this.props
const {