Skip to content

Commit 199d2c5

Browse files
committed
disable current implementation of 'read-optimized' mode for scope/specificaiton tab
1 parent 056c86d commit 199d2c5

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/helpers/wizardHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ export const removeValuesOfHiddenSteps = (template, project) => {
872872
switch(level) {
873873
// if some question is hidden, we remove it's value from the project data
874874
case LEVEL.QUESTION:
875-
if (stepObject.__wizard.hiddenByCondition && _.get(updatedProject, stepObject.fieldName)) {
875+
if (_.get(stepObject, '__wizard.hiddenByCondition') && _.get(updatedProject, stepObject.fieldName)) {
876876
updatedProject = update(updatedProject, unflatten({
877877
[stepObject.fieldName]: { $set: undefined }
878878
}))
@@ -881,7 +881,7 @@ export const removeValuesOfHiddenSteps = (template, project) => {
881881

882882
// if some option is hidden, we remove it's value from the list of values of the parent question
883883
case LEVEL.OPTION: {
884-
if (stepObject.__wizard.hiddenByCondition) {
884+
if (_.get(stepObject, 'stepObject.__wizard.hiddenByCondition')) {
885885
const questionStep = {...step, optionIndex: -1}
886886
const questionStepObject = getStepObject(template, questionStep)
887887
const questionValue = _.get(updatedProject, questionStepObject.fieldName)

src/projects/detail/components/EditProjectForm/EditProjectForm.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import XMarkIcon from '../../../../assets/icons/icon-x-mark.svg'
1616
import SpecSection from '../SpecSection'
1717
import { HOC as hoc } from 'formsy-react'
1818
import {
19-
initWizard,
19+
// initWizard,
2020
updateStepsByConditions,
2121
makeStepEditable,
2222
makeStepReadonly,
@@ -78,10 +78,16 @@ class EditProjectForm extends Component {
7878
this.stopEditReadOnly = this.stopEditReadOnly.bind(this)
7979
this.cancelEditReadOnly = this.cancelEditReadOnly.bind(this)
8080

81-
const {
82-
template,
83-
hasDependantFields,
84-
} = initWizard(props.template, props.project, null, true)
81+
// const {
82+
// template,
83+
// hasDependantFields,
84+
// } = initWizard(props.template, props.project, null, true)
85+
// This is a quick fix to disable read-optimized mode for scope/specification page as we wouldn't use it
86+
// I didn't remove the code to not make a big change the day before release,
87+
// also, at the same time there is a challenge run where this code should be removed
88+
// so I don't make a lot of changes now, so after we can easily merge result of the challenge with the dev branch
89+
const hasDependantFields = false
90+
const template = props.template
8591

8692
this.state = {
8793
template,

0 commit comments

Comments
 (0)