mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
ContactDetailsForm min password length to enable submit only when enough characters are typed
This commit is contained in:
parent
d6e4882dbd
commit
52b420662a
2 changed files with 16 additions and 1 deletions
|
|
@ -159,6 +159,20 @@ class ContactDetailsFormComponent extends Component {
|
|||
|
||||
const passwordRequired = validators.required(passwordRequiredMessage);
|
||||
|
||||
const passwordMinLengthMessage = intl.formatMessage(
|
||||
{
|
||||
id: 'ContactDetailsForm.passwordTooShort',
|
||||
},
|
||||
{
|
||||
minLength: validators.PASSWORD_MIN_LENGTH,
|
||||
}
|
||||
);
|
||||
|
||||
const passwordMinLength = validators.minLength(
|
||||
passwordMinLengthMessage,
|
||||
validators.PASSWORD_MIN_LENGTH
|
||||
);
|
||||
|
||||
const passwordFailedMessage = intl.formatMessage({
|
||||
id: 'ContactDetailsForm.passwordFailed',
|
||||
});
|
||||
|
|
@ -199,7 +213,7 @@ class ContactDetailsFormComponent extends Component {
|
|||
id={`${form}.currentPassword`}
|
||||
label={passwordLabel}
|
||||
placeholder={passwordPlaceholder}
|
||||
validate={passwordRequired}
|
||||
validate={[passwordRequired, passwordMinLength]}
|
||||
customErrorText={passwordErrorText}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
"ContactDetailsForm.passwordLabel": "Current password",
|
||||
"ContactDetailsForm.passwordPlaceholder": "Enter your current password…",
|
||||
"ContactDetailsForm.passwordRequired": "Password is required",
|
||||
"ContactDetailsForm.passwordTooShort": "Password should be at least {minLength} characters",
|
||||
"ContactDetailsForm.pendingEmailCheckInbox": "Check your inbox to verify {pendingEmail} now.",
|
||||
"ContactDetailsForm.pendingEmailUnverified": "You have changed your email address but haven’t verified the new address yet. {pendingEmailCheckInbox} {resendEmailMessage}",
|
||||
"ContactDetailsForm.resendEmailVerificationText": "Resend verification email.",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue