Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions src/projects/detail/containers/ProjectAddPhaseContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import { renderComponent, branch, compose, withProps } from 'recompose'
import spinnerWhileLoading from '../../../components/LoadingSpinner'
import { createProduct } from '../../actions/project'
import { getProductTemplateByKey } from '../../../helpers/templates'
import { loadProjectPhasesWithProducts } from '../../actions/project'
import { loadProjectDashboard } from '../../../projects/actions/projectDashboard'


import CoderBot from '../../../components/CoderBot/CoderBot'
import Wizard from '../../../components/Wizard'
Expand Down Expand Up @@ -91,26 +88,17 @@ class ProjectAddPhaseContainer extends React.Component {
window.location = returnUrl
} else {
if (isLoggedIn) {
this.props.history.push(`/projects/${project.id}/plan`)
this.props.history.push(`/projects/${project.id}`)
} else {
this.props.history.push('/')
// FIXME ideally we should push on router
// window.location = window.location.origin
}
}
}

componentWillReceiveProps(props) {
const project = _.get(props, 'project', null)
if (!props.processing && !props.error && project && this.state.isChosenProduct) {
if (this.state.shouldReloadPhases) {
// reload the project
props.loadProjectPhasesWithProducts(project.id)
this.setState({shouldReloadPhases: false})
} else if (!props.isLoadingPhases) {
// back to plan
this.closeWizard()
}
this.closeWizard()
}
}

Expand Down Expand Up @@ -165,6 +153,6 @@ const mapStateToProps = ({projectState, loadUser, templates, productsTimelines }
productCategories: templates.productCategories,
})

const actionCreators = {createProduct, loadProjectPhasesWithProducts, loadProjectDashboard}
const actionCreators = {createProduct}

export default withRouter(connect(mapStateToProps, actionCreators)(ProjectAddPhaseContainer))