diff --git a/package.json b/package.json index 2b1aa08af..6c6579336 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "react": "^15.6.1", "react-addons-css-transition-group": "^15.6.0", "react-addons-pure-render-mixin": "^15.6.0", + "query-string": "^4.3.4", "react-color": "^2.13.1", "react-datetime": "2.7.1", "react-dom": "^15.6.1", diff --git a/src/config/constants.js b/src/config/constants.js index 48213103e..2257eda82 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -253,3 +253,5 @@ export const MAINTENANCE_MODE = false export const LS_INCOMPLETE_PROJECT = 'incompleteProject' export const CONNECT_MESSAGE_API_URL = process.env.CONNECT_MESSAGE_API_URL || TC_API_URL + +export const NEW_PROJECT_PATH = '/new-project' \ No newline at end of file diff --git a/src/projects/create/containers/CreateContainer.jsx b/src/projects/create/containers/CreateContainer.jsx index a042d5cbd..1cb3184a2 100644 --- a/src/projects/create/containers/CreateContainer.jsx +++ b/src/projects/create/containers/CreateContainer.jsx @@ -11,7 +11,8 @@ import { CREATE_PROJECT_FAILURE, LS_INCOMPLETE_PROJECT, PROJECT_STATUS_IN_REVIEW, - ACCOUNTS_APP_REGISTER_URL + ACCOUNTS_APP_REGISTER_URL, + NEW_PROJECT_PATH } from '../../../config/constants' const page404 = compose( @@ -141,10 +142,10 @@ class CreateConainer extends React.Component { processing={ this.state.creatingProject } onStepChange={ (wizardStep) => { if (wizardStep === ProjectWizard.Steps.WZ_STEP_INCOMP_PROJ_CONF) { - browserHistory.push('/new-project/incomplete') + browserHistory.push(NEW_PROJECT_PATH + '/incomplete') } if (wizardStep === ProjectWizard.Steps.WZ_STEP_SELECT_PROD_TYPE) { - browserHistory.push('/new-project/') + browserHistory.push(NEW_PROJECT_PATH +'' + window.location.search) } this.setState({ wizardStep @@ -157,7 +158,7 @@ class CreateConainer extends React.Component { // compares updated product with previous product to know if user has updated the product if (prevProduct !== product) { if (product) { - browserHistory.push('/new-project/' + product) + browserHistory.push(NEW_PROJECT_PATH + '/' + product + window.location.search) } } this.setState({ diff --git a/src/projects/detail/components/SpecSection.jsx b/src/projects/detail/components/SpecSection.jsx index 3ea0bf76f..3f2396a29 100644 --- a/src/projects/detail/components/SpecSection.jsx +++ b/src/projects/detail/components/SpecSection.jsx @@ -1,4 +1,5 @@ import React, { PropTypes } from 'react' +import qs from 'query-string' import { Tabs, Tab, TCFormFields } from 'appirio-tech-react-components' import _ from 'lodash' import SpecQuestions from './SpecQuestions' @@ -98,6 +99,7 @@ const SpecSection = props => { case 'project-name': { const refCodeFieldName = 'details.utm.code' const refCode = _.get(project, refCodeFieldName, undefined) + const queryParamRefCode = qs.parse(window.location.search).refCode return (