Permalink
Browse files

Merge pull request #599 from meetfranz/fix-form-validation

Fix form validation
  • Loading branch information...
haraldox committed Jan 30, 2018
2 parents ababc86 + 3c870ae commit 7618f5197660d16d755bfa048b6031c30e6f7c79
@@ -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),
},
})],
@@ -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',
},
},
@@ -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);
@@ -82,7 +82,7 @@ export default class Signup extends Component {
fields: {
accountType: {
value: 'individual',
validate: [required],
validators: [required],
options: [{
value: 'individual',
label: 'Individual',
@@ -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),
@@ -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',
},
},
@@ -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')
@@ -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],
},
});
}
@@ -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],
},
});
}
@@ -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',
@@ -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)],
},
},
};

0 comments on commit 7618f51

Please sign in to comment.