Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the key warnings for the assessmentForm #8

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/components/HRInfoFilesAccessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down Expand Up @@ -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)}/>
</CardContent> : ''
}
Expand All @@ -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)}/>
</CardContent> : ''
}
Expand Down
7 changes: 3 additions & 4 deletions src/containers/AssessmentForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}/>
<FormHelperText id = "subject-text">
{t('assessment.helpers.subject')}
Expand All @@ -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}/>
<FormHelperText id = "methodology-text">
{t('assessment.helpers.methodology')}
Expand All @@ -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}/>
<FormHelperText id = "key_findings-text">
{t('assessment.helpers.key_findings')}
Expand Down Expand Up @@ -362,7 +362,6 @@ class AssessmentForm extends React.Component {
<FormControl required fullWidth margin = "normal">
<FormLabel focused error ={this.props.status === 'was-validated' && !this.props.isValid(this.props.doc.report)}>{t('files.assessment_report')}</FormLabel>
<HRInfoFilesAccessibility onChange={(s) => this.props.handleSelectChange('report', s)}
onInputChange={this.props.handleInputChange}
value={this.props.doc.report} />
<FormHelperText id = "report-text">
<Trans i18nKey='assessment.helpers.assessment_report'>Upload the assessment report file, stored on your computer
Expand Down