Skip to content

Commit f3931dc

Browse files
author
vikasrohit
authored
Merge pull request #4155 from appirio-tech/feature/add-phase-client-side
feat: don't reload phases after adding
2 parents d877bc3 + dec98a6 commit f3931dc

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/projects/detail/containers/ProjectAddPhaseContainer.jsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ import { renderComponent, branch, compose, withProps } from 'recompose'
1414
import spinnerWhileLoading from '../../../components/LoadingSpinner'
1515
import { createProduct } from '../../actions/project'
1616
import { getProductTemplateByKey } from '../../../helpers/templates'
17-
import { loadProjectPhasesWithProducts } from '../../actions/project'
18-
import { loadProjectDashboard } from '../../../projects/actions/projectDashboard'
19-
2017

2118
import CoderBot from '../../../components/CoderBot/CoderBot'
2219
import Wizard from '../../../components/Wizard'
@@ -91,26 +88,17 @@ class ProjectAddPhaseContainer extends React.Component {
9188
window.location = returnUrl
9289
} else {
9390
if (isLoggedIn) {
94-
this.props.history.push(`/projects/${project.id}/plan`)
91+
this.props.history.push(`/projects/${project.id}`)
9592
} else {
9693
this.props.history.push('/')
97-
// FIXME ideally we should push on router
98-
// window.location = window.location.origin
9994
}
10095
}
10196
}
10297

10398
componentWillReceiveProps(props) {
10499
const project = _.get(props, 'project', null)
105100
if (!props.processing && !props.error && project && this.state.isChosenProduct) {
106-
if (this.state.shouldReloadPhases) {
107-
// reload the project
108-
props.loadProjectPhasesWithProducts(project.id)
109-
this.setState({shouldReloadPhases: false})
110-
} else if (!props.isLoadingPhases) {
111-
// back to plan
112-
this.closeWizard()
113-
}
101+
this.closeWizard()
114102
}
115103
}
116104

@@ -165,6 +153,6 @@ const mapStateToProps = ({projectState, loadUser, templates, productsTimelines }
165153
productCategories: templates.productCategories,
166154
})
167155

168-
const actionCreators = {createProduct, loadProjectPhasesWithProducts, loadProjectDashboard}
156+
const actionCreators = {createProduct}
169157

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

0 commit comments

Comments
 (0)