Skip to content

Commit 2194af0

Browse files
author
Vikas Agarwal
committed
Github issue#1104, "Create a new project" action should consider the product from the URL
— Added logic to direct user directly to the form details page when the deep link is for the same product as of the save one
1 parent d0339d2 commit 2194af0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/projects/create/components/ProjectWizard.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,21 @@ class ProjectWizard extends Component {
4848
const incompleteProjectStr = window.localStorage.getItem(LS_INCOMPLETE_PROJECT)
4949
if(incompleteProjectStr) {
5050
const incompleteProject = JSON.parse(incompleteProjectStr)
51+
// const incompleteProjectType = _.get(incompleteProject, 'type')
52+
const incompleteProduct = _.get(incompleteProject, 'details.products[0]')
53+
let wizardStep = WZ_STEP_INCOMP_PROJ_CONF
54+
if (incompleteProduct && params && params.product) {
55+
// assumes the params.product to be id of a product because incomplete project is set only
56+
// after user selects a particular product
57+
const product = findProduct(params.product, true)
58+
if (product && product.id === incompleteProduct) {
59+
wizardStep = WZ_STEP_FILL_PROJ_DETAILS
60+
}
61+
}
5162
this.setState({
5263
project: update(this.state.project, {$merge : incompleteProject}),
5364
dirtyProject: update(this.state.dirtyProject, {$merge : incompleteProject}),
54-
wizardStep: WZ_STEP_INCOMP_PROJ_CONF,
65+
wizardStep: wizardStep,
5566
isProjectDirty: false
5667
}, () => {
5768
typeof onStepChange === 'function' && onStepChange(this.state.wizardStep)

0 commit comments

Comments
 (0)