Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1761 from 18F/ch-3830-85p-section-1-5
Browse files Browse the repository at this point in the history
[EN-3830] [SF85P] Sections 1-5
  • Loading branch information
christopherhuii authored Aug 5, 2019
2 parents 26a5acf + b4fda09 commit d9065f2
Show file tree
Hide file tree
Showing 64 changed files with 2,063 additions and 967 deletions.
83 changes: 47 additions & 36 deletions src/components/Form/ForeignBornDocuments/ForeignBornDocuments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,58 @@ export default class ForeignBornDocuments extends ValidationElement {
DocumentExpiration: this.props.DocumentExpiration,
DocumentExpirationNotApplicable: this.props
.DocumentExpirationNotApplicable,
...queue
...queue,
})
}

updateDocumentType(values) {
this.update({
DocumentType: values
DocumentType: values,
})
}

updateOtherExplanation(values) {
this.update({
OtherExplanation: values
OtherExplanation: values,
})
}

updateDocumentNumber(values) {
this.update({
DocumentNumber: values
DocumentNumber: values,
})
}

updateDocumentExpiration(values) {
this.update({
DocumentExpiration: values
DocumentExpiration: values,
})
}

updateDocumentExpirationNotApplicable(values) {
this.update({
DocumentExpirationNotApplicable: values
DocumentExpirationNotApplicable: values,
})
}

render() {
const { requireExpirationDate } = this.props
return (
<div className="foreign-born-documents">
<Field
help="relationships.civilUnion.help.foreignBornDocument"
title={i18n.t('relationships.civilUnion.heading.foreignBornDocument')}
scrollIntoView={this.props.scrollIntoView}
adjustFor="p">
adjustFor="p"
>
<label>{i18n.t('foreignBornDocuments.para.bornToUSParents')}</label>
<RadioGroup
name="born"
className="option-list option-list-vertical"
selectedValue={(this.props.DocumentType || {}).value}
required={this.props.required}
onError={this.props.onError}>
onError={this.props.onError}
>
<Radio
className="born"
label={i18n.m('foreignBornDocuments.bornToUSParents.label.fs240')}
Expand Down Expand Up @@ -109,7 +112,8 @@ export default class ForeignBornDocuments extends ValidationElement {
className="option-list option-list-vertical"
selectedValue={(this.props.DocumentType || {}).value}
required={this.props.required}
onError={this.props.onError}>
onError={this.props.onError}
>
<Radio
className="naturalized alien"
label={i18n.m('foreignBornDocuments.naturalized.label.alien')}
Expand Down Expand Up @@ -149,7 +153,8 @@ export default class ForeignBornDocuments extends ValidationElement {
className="option-list option-list-vertical"
selectedValue={(this.props.DocumentType || {}).value}
required={this.props.required}
onError={this.props.onError}>
onError={this.props.onError}
>
<Radio
className="derived alien"
label={i18n.m('foreignBornDocuments.derived.label.alien')}
Expand Down Expand Up @@ -189,7 +194,8 @@ export default class ForeignBornDocuments extends ValidationElement {
className="option-list option-list-vertical"
selectedValue={(this.props.DocumentType || {}).value}
required={this.props.required}
onError={this.props.onError}>
onError={this.props.onError}
>
<Radio
className="notcitizen permanent"
label={i18n.m(
Expand Down Expand Up @@ -262,7 +268,8 @@ export default class ForeignBornDocuments extends ValidationElement {
className="option-list option-list-vertical"
selectedValue={(this.props.DocumentType || {}).value}
required={this.props.required}
onError={this.props.onError}>
onError={this.props.onError}
>
<Radio
className="other"
label={i18n.m('foreignBornDocuments.other.label.other')}
Expand Down Expand Up @@ -290,7 +297,8 @@ export default class ForeignBornDocuments extends ValidationElement {
<Field
title={i18n.t('foreignBornDocuments.heading.documentNumber')}
scrollIntoView={this.props.scrollIntoView}
adjustFor="labels">
adjustFor="labels"
>
<Text
name="documentNumber"
label="Document Number"
Expand All @@ -305,25 +313,29 @@ export default class ForeignBornDocuments extends ValidationElement {
/>
</Field>

<Field
title={i18n.t('foreignBornDocuments.heading.documentExpiration')}
scrollIntoView={this.props.scrollIntoView}
adjustFor="labels">
<NotApplicable
name="DocumentExpirationNotApplicable"
{...this.props.DocumentExpirationNotApplicable}
label={i18n.t('reference.label.idk')}
or={i18n.m('reference.para.or')}
onUpdate={this.updateDocumentExpirationNotApplicable}>
<DateControl
name="documentExpiration"
{...this.props.DocumentExpiration}
onUpdate={this.updateDocumentExpiration}
onError={this.props.onError}
required={this.props.required}
/>
</NotApplicable>
</Field>
{requireExpirationDate && (
<Field
title={i18n.t('foreignBornDocuments.heading.documentExpiration')}
scrollIntoView={this.props.scrollIntoView}
adjustFor="labels"
>
<NotApplicable
name="DocumentExpirationNotApplicable"
{...this.props.DocumentExpirationNotApplicable}
label={i18n.t('reference.label.idk')}
or={i18n.m('reference.para.or')}
onUpdate={this.updateDocumentExpirationNotApplicable}
>
<DateControl
name="documentExpiration"
{...this.props.DocumentExpiration}
onUpdate={this.updateDocumentExpiration}
onError={this.props.onError}
required={this.props.required}
/>
</NotApplicable>
</Field>
)}
</div>
)
}
Expand All @@ -335,8 +347,7 @@ ForeignBornDocuments.defaultProps = {
DocumentNumber: {},
DocumentExpiration: {},
DocumentExpirationNotApplicable: { applicable: true },
onUpdate: queue => {},
onError: (value, arr) => {
return arr
}
onUpdate: () => {},
onError: (value, arr) => arr,
requireExpirationDate: true,
}
5 changes: 5 additions & 0 deletions src/components/Form/Introduction/Introduction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export class Introduction extends React.Component {
acceptancePara = i18n.m('introduction.acceptance.para85')
break
}
case formTypes.SF85P: {
introductionContent = i18n.m('introduction.contents85p')
acceptancePara = i18n.m('introduction.acceptance.para85p')
break
}
default: {
introductionContent = i18n.m('introduction.contents')
acceptancePara = i18n.m('introduction.acceptance.para')
Expand Down
Loading

0 comments on commit d9065f2

Please sign in to comment.