From ccc6f2c55475a5e55ffbd40ab702723e9fa2cb50 Mon Sep 17 00:00:00 2001 From: Axel Barbosa Date: Fri, 5 Oct 2018 13:06:04 +0200 Subject: [PATCH] Fixing the key warnings --- src/components/HRInfoFilesAccessibility.js | 13 +++++-------- src/containers/AssessmentForm.js | 7 +++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/components/HRInfoFilesAccessibility.js b/src/components/HRInfoFilesAccessibility.js index c425eea..d806d7f 100644 --- a/src/components/HRInfoFilesAccessibility.js +++ b/src/components/HRInfoFilesAccessibility.js @@ -63,22 +63,19 @@ class HRInfoFilesAccessibility extends React.Component { }); } else if (type === 'instructions') { - let instructions = this.state.instructions; - instructions = v.target.value; + let instructions = v.target.value; this.setState({ instructions: instructions }); } else if (type === 'url') { - let url = this.state.url; - url = v.target.value; + let url = v.target.value; this.setState({ url: url }); } else { - let accessibility = this.state.accessibility; - accessibility = v; + let accessibility = v; this.changeState({ accessibility: accessibility }); @@ -160,7 +157,7 @@ class HRInfoFilesAccessibility extends React.Component { multiline = {true} rowsMax = "4" fullWidth = {true} - value = {this.state.instructions} + value = {this.state.instructions || ''} onChange = { (s) => this.handleChange('instructions', s)}/> : '' } @@ -171,7 +168,7 @@ class HRInfoFilesAccessibility extends React.Component { name = "url" id = "url" fullWidth = {true} - value = {this.state.url} + value = {this.state.url || ''} onChange = { (s) => this.handleChange('url', s)}/> : '' } diff --git a/src/containers/AssessmentForm.js b/src/containers/AssessmentForm.js index 1812a20..f796872 100644 --- a/src/containers/AssessmentForm.js +++ b/src/containers/AssessmentForm.js @@ -255,7 +255,7 @@ class AssessmentForm extends React.Component { name = "subject" multiline = {true} rowsMax = "4" - value = {this.props.doc.subject} + value = {this.props.doc.subject || ''} onChange = {this.props.handleInputChange}/> {t('assessment.helpers.subject')} @@ -270,7 +270,7 @@ class AssessmentForm extends React.Component { name = "methodology" multiline = {true} rowsMax = "4" - value = {this.props.doc.methodology} + value = {this.props.doc.methodology || ''} onChange = {this.props.handleInputChange}/> {t('assessment.helpers.methodology')} @@ -285,7 +285,7 @@ class AssessmentForm extends React.Component { name = "key_findings" multiline = {true} rowsMax = "4" - value = {this.props.doc.key_findings} + value = {this.props.doc.key_findings || ''} onChange = {this.props.handleInputChange}/> {t('assessment.helpers.key_findings')} @@ -362,7 +362,6 @@ class AssessmentForm extends React.Component { {t('files.assessment_report')} this.props.handleSelectChange('report', s)} - onInputChange={this.props.handleInputChange} value={this.props.doc.report} /> Upload the assessment report file, stored on your computer