File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/projects/create/components Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11import _ from 'lodash'
22import React , { Component } from 'react'
33import PropTypes from 'prop-types'
4+ import qs from 'query-string'
45import cn from 'classnames'
56import FormsyForm from 'appirio-tech-react-components/components/Formsy'
67const Formsy = FormsyForm . Formsy
@@ -107,11 +108,20 @@ class ProjectBasicDetailsForm extends Component {
107108 }
108109
109110 if ( hasDependantFields && ! _ . isEqual ( nextProps . dirtyProject , this . props . dirtyProject ) ) {
111+ // get URL query params as an object
112+ const indexOfQueryStart = window . location . href . indexOf ( '?' )
113+ const queryParams = indexOfQueryStart > - 1 ? qs . parse ( window . location . href . substring ( indexOfQueryStart + 1 ) ) : { }
114+ // use values from query params during conditions evaluations
115+ // so we can control for by the URL params
116+ const evaluationData = {
117+ ...queryParams ,
118+ ...nextProps . dirtyProject
119+ }
110120 const {
111121 updatedTemplate,
112122 hidedSomeNodes,
113123 updatedSomeNodes,
114- } = updateNodesByConditions ( template , nextProps . dirtyProject , nextProps . productTemplates )
124+ } = updateNodesByConditions ( template , evaluationData , nextProps . productTemplates )
115125
116126 if ( updatedSomeNodes ) {
117127 this . setState ( {
You can’t perform that action at this time.
0 commit comments