Connect Connection Wizard to Router and connect to newly created source on wizard completion

pull/4129/head
Deniz Kusefoglu 2018-08-02 17:50:48 -07:00
parent 940ff14621
commit 5fbc99a521
1 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,6 @@
// Libraries
import React, {PureComponent} from 'react'
import {withRouter, WithRouterProps} from 'react-router'
import _ from 'lodash'
// Components
@ -13,7 +14,7 @@ import CompletionStep from 'src/sources/components/CompletionStep'
// Types
import {Kapacitor, Source} from 'src/types'
interface Props {
interface Props extends WithRouterProps {
isVisible: boolean
toggleVisibility: (isVisible: boolean) => () => void
}
@ -114,7 +115,13 @@ class ConnectionWizard extends PureComponent<Props, State> {
return false
}
private handleCompletionNext = () => {
const {router} = this.props
const {source} = this.state
this.resetWizardState()
if (source) {
router.push(`/sources/${source.id}/manage-sources`)
}
}
private handleCompletionPrev = () => {}
@ -126,4 +133,4 @@ class ConnectionWizard extends PureComponent<Props, State> {
}
}
export default ConnectionWizard
export default withRouter(ConnectionWizard)