@@ -10,27 +10,19 @@ import {
1010 Table ,
1111 CheckboxProps ,
1212} from 'semantic-ui-react' ;
13- import { isNil , isString } from 'lodash' ;
14- import { History } from 'history' ;
13+ import { isString } from 'lodash' ;
1514
1615import styles from '../styles/common.css' ;
17- import { EXPERIMENTS , SCREENS } from '../../constants/constants' ;
18- import {
19- ExperimentObject ,
20- ExperimentParameters ,
21- } from '../../constants/interfaces' ;
16+ import { SCREENS } from '../../constants/constants' ;
17+ import { ExperimentParameters } from '../../constants/interfaces' ;
2218import { DesignProps } from './index' ;
2319import SecondaryNavComponent from '../SecondaryNavComponent' ;
2420import PreviewExperimentComponent from '../PreviewExperimentComponent' ;
25- import StimuliDesignColumn from './StimuliDesignColumn' ;
2621import { ParamSlider } from './ParamSlider' ;
2722import PreviewButton from '../PreviewButtonComponent' ;
2823import researchQuestionImage from '../../assets/common/ResearchQuestion2.png' ;
2924import methodsImage from '../../assets/common/Methods2.png' ;
3025import hypothesisImage from '../../assets/common/Hypothesis2.png' ;
31- import { readImages } from '../../utils/filesystem/storage' ;
32- import { StimuliRow } from './StimuliRow' ;
33- import { ExperimentActions } from '../../actions/experimentActions' ;
3426
3527const CUSTOM_STEPS = {
3628 OVERVIEW : 'OVERVIEW' ,
@@ -112,6 +104,7 @@ export default class CustomDesign extends Component<DesignProps, State> {
112104 }
113105
114106 handleSetText ( text : string , section : 'hypothesis' | 'methods' | 'question' ) {
107+ // @ts -expect-error
115108 this . setState ( ( prevState ) => ( {
116109 params : {
117110 ...prevState . params ,
@@ -152,7 +145,7 @@ export default class CustomDesign extends Component<DesignProps, State> {
152145 autoHeight
153146 style = { { minHeight : 100 , maxHeight : 400 } }
154147 label = { FIELDS . QUESTION }
155- value = { this . state . params . description . question }
148+ value = { this . state . params . description ? .question }
156149 placeholder = "Explain your research question here."
157150 onChange = { ( event , data ) => {
158151 if ( ! isString ( data . value ) ) {
@@ -176,7 +169,7 @@ export default class CustomDesign extends Component<DesignProps, State> {
176169 autoHeight
177170 style = { { minHeight : 100 , maxHeight : 400 } }
178171 label = { FIELDS . HYPOTHESIS }
179- value = { this . state . params . description . hypothesis }
172+ value = { this . state . params . description ? .hypothesis }
180173 placeholder = "Describe your hypothesis here."
181174 onChange = { ( event , data ) => {
182175 if ( ! isString ( data . value ) ) {
@@ -200,7 +193,7 @@ export default class CustomDesign extends Component<DesignProps, State> {
200193 autoHeight
201194 style = { { minHeight : 100 , maxHeight : 400 } }
202195 label = { FIELDS . METHODS }
203- value = { this . state . params . description . methods }
196+ value = { this . state . params . description ? .methods }
204197 placeholder = "Explain how you will design your experiment to answer the question here."
205198 onChange = { ( event , data ) => {
206199 if ( ! isString ( data . value ) ) {
0 commit comments