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

AFE: Validate email in second step #35531

Merged
merged 1 commit into from
Jun 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default class AmazonFutureEngineerEligibilityForm extends React.Component

submit = () => {
const requiredFormData = _.pick(this.state, [
'email',
'firstName',
'lastName',
'inspirationKit',
Expand Down Expand Up @@ -136,7 +137,7 @@ export default class AmazonFutureEngineerEligibilityForm extends React.Component
};

getMissingRequiredFields() {
const requiredFields = ['firstName', 'lastName', 'consentAFE'];
const requiredFields = ['email', 'firstName', 'lastName', 'consentAFE'];

if (this.state.csta) {
requiredFields.push('consentCSTA');
Expand Down Expand Up @@ -172,6 +173,12 @@ export default class AmazonFutureEngineerEligibilityForm extends React.Component
required={true}
onChange={this.handleChange}
defaultValue={this.props.email}
validationState={
this.state.errors.hasOwnProperty('email')
? VALIDATION_STATE_ERROR
: null
}
errorMessage={this.state.errors.email}
/>
<SchoolAutocompleteDropdownWithLabel
value={this.props.schoolId}
Expand Down