Skip to content

Commit

Permalink
Merge pull request #599 from meetfranz/fix-form-validation
Browse files Browse the repository at this point in the history
Fix form validation
  • Loading branch information
haraldox authored Jan 30, 2018
2 parents ababc86 + 3c870ae commit 7618f51
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/auth/Invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class Invite extends Component {
email: {
label: this.context.intl.formatMessage(messages.emailLabel),
// value: '',
validate: [email],
validators: [email],
placeholder: this.context.intl.formatMessage(messages.emailLabel),
},
})],
Expand Down
4 changes: 2 additions & 2 deletions src/components/auth/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ export default class Login extends Component {
email: {
label: this.context.intl.formatMessage(messages.emailLabel),
value: '',
validate: [required, email],
validators: [required, email],
},
password: {
label: this.context.intl.formatMessage(messages.passwordLabel),
value: '',
validate: [required],
validators: [required],
type: 'password',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/Password.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class Password extends Component {
email: {
label: this.context.intl.formatMessage(messages.emailLabel),
value: '',
validate: [required, email],
validators: [required, email],
},
},
}, this.context.intl);
Expand Down
10 changes: 5 additions & 5 deletions src/components/auth/Signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class Signup extends Component {
fields: {
accountType: {
value: 'individual',
validate: [required],
validators: [required],
options: [{
value: 'individual',
label: 'Individual',
Expand All @@ -97,17 +97,17 @@ export default class Signup extends Component {
firstname: {
label: this.context.intl.formatMessage(messages.firstnameLabel),
value: '',
validate: [required],
validators: [required],
},
lastname: {
label: this.context.intl.formatMessage(messages.lastnameLabel),
value: '',
validate: [required],
validators: [required],
},
email: {
label: this.context.intl.formatMessage(messages.emailLabel),
value: '',
validate: [required, email],
validators: [required, email],
},
organization: {
label: this.context.intl.formatMessage(messages.companyLabel),
Expand All @@ -116,7 +116,7 @@ export default class Signup extends Component {
password: {
label: this.context.intl.formatMessage(messages.passwordLabel),
value: '',
validate: [required, minLength(6)],
validators: [required, minLength(6)],
type: 'password',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/Subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class SubscriptionForm extends Component {
fields: {
paymentTier: {
value: 'year',
validate: [required],
validators: [required],
options: [{
value: 'month',
label: `€ ${Object.hasOwnProperty.call(this.props.plan, 'month')
Expand Down
4 changes: 2 additions & 2 deletions src/containers/settings/EditServiceScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class EditServiceScreen extends Component {
label: intl.formatMessage(messages.team),
placeholder: intl.formatMessage(messages.team),
value: service.team,
validate: [required],
validators: [required],
},
});
}
Expand All @@ -132,7 +132,7 @@ export default class EditServiceScreen extends Component {
label: intl.formatMessage(messages.customUrl),
placeholder: 'https://',
value: service.customUrl,
validate: [required, url],
validators: [required, url],
},
});
}
Expand Down
12 changes: 6 additions & 6 deletions src/containers/settings/EditUserScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ export default class EditUserScreen extends Component {
label: intl.formatMessage(messages.firstname),
placeholder: intl.formatMessage(messages.firstname),
value: user.firstname,
validate: [required],
validators: [required],
},
lastname: {
label: intl.formatMessage(messages.lastname),
placeholder: intl.formatMessage(messages.lastname),
value: user.lastname,
validate: [required],
validators: [required],
},
email: {
label: intl.formatMessage(messages.email),
placeholder: intl.formatMessage(messages.email),
value: user.email,
validate: [required, email],
validators: [required, email],
},
accountType: {
value: user.accountType,
validate: [required],
validators: [required],
label: intl.formatMessage(messages.accountType.label),
options: [{
value: 'individual',
Expand All @@ -118,12 +118,12 @@ export default class EditUserScreen extends Component {
oldPassword: {
label: intl.formatMessage(messages.currentPassword),
type: 'password',
validate: [minLength(6)],
validators: [minLength(6)],
},
newPassword: {
label: intl.formatMessage(messages.newPassword),
type: 'password',
validate: [minLength(6)],
validators: [minLength(6)],
},
},
};
Expand Down

0 comments on commit 7618f51

Please sign in to comment.