Fix linting errors

This commit is contained in:
ErickSkrauch 2020-06-04 19:54:33 +03:00
parent bf6a76d006
commit 747e21f0ae
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
2 changed files with 37 additions and 13 deletions

View File

@ -12,7 +12,7 @@ import { defineMessages } from 'react-intl';
import Context from '../Context'; import Context from '../Context';
import Instructions from './instructions'; import Instructions from './instructions';
import KeyForm from './keyForm'; import KeyForm from './keyForm';
import Confirmation from './confirmation'; import Confirmation from './Confirmation';
const STEPS_TOTAL = 3; const STEPS_TOTAL = 3;

View File

@ -32,7 +32,9 @@ const ResendKey: ComponentType<{ url: string }> = ({ url }) => (
const errorsMap: Record<string, (props?: Record<string, any>) => ReactElement> = { const errorsMap: Record<string, (props?: Record<string, any>) => ReactElement> = {
'error.login_required': () => <Message key="loginRequired" defaultMessage="Please enter Email or username" />, 'error.login_required': () => <Message key="loginRequired" defaultMessage="Please enter Email or username" />,
'error.login_not_exist': () => <Message key="loginNotExist" defaultMessage="Sorry, Ely doesn't recognise your login." />, 'error.login_not_exist': () => (
<Message key="loginNotExist" defaultMessage="Sorry, Ely doesn't recognise your login." />
),
'error.password_required': () => <Message key="passwordRequired" defaultMessage="Please enter password" />, 'error.password_required': () => <Message key="passwordRequired" defaultMessage="Please enter password" />,
'error.password_incorrect': (props) => ( 'error.password_incorrect': (props) => (
@ -47,12 +49,16 @@ const errorsMap: Record<string, (props?: Record<string, any>) => ReactElement> =
'error.username_invalid': () => <Message key="usernameInvalid" defaultMessage="Username is invalid" />, 'error.username_invalid': () => <Message key="usernameInvalid" defaultMessage="Username is invalid" />,
'error.username_too_short': () => <Message key="usernameTooShort" defaultMessage="Username is too short" />, 'error.username_too_short': () => <Message key="usernameTooShort" defaultMessage="Username is too short" />,
'error.username_too_long': () => <Message key="usernameTooLong" defaultMessage="Username is too long" />, 'error.username_too_long': () => <Message key="usernameTooLong" defaultMessage="Username is too long" />,
'error.username_not_available': () => <Message key="usernameUnavailable" defaultMessage="This username is already taken" />, 'error.username_not_available': () => (
<Message key="usernameUnavailable" defaultMessage="This username is already taken" />
),
'error.email_required': () => <Message key="emailRequired" defaultMessage="Email is required" />, 'error.email_required': () => <Message key="emailRequired" defaultMessage="Email is required" />,
'error.email_too_long': () => <Message key="emailToLong" defaultMessage="Email is too long" />, 'error.email_too_long': () => <Message key="emailToLong" defaultMessage="Email is too long" />,
'error.email_invalid': () => <Message key="emailInvalid" defaultMessage="Email is invalid" />, 'error.email_invalid': () => <Message key="emailInvalid" defaultMessage="Email is invalid" />,
'error.email_is_tempmail': () => <Message key="emailIsTempmail" defaultMessage="Tempmail Email addresses is not allowed" />, 'error.email_is_tempmail': () => (
<Message key="emailIsTempmail" defaultMessage="Tempmail Email addresses is not allowed" />
),
'error.email_not_available': (props) => ( 'error.email_not_available': (props) => (
// props are handled in validationErrorsHandler in components/auth/actions // props are handled in validationErrorsHandler in components/auth/actions
<> <>
@ -63,12 +69,22 @@ const errorsMap: Record<string, (props?: Record<string, any>) => ReactElement> =
'error.totp_required': () => <Message key="totpRequired" defaultMessage="Please, enter the code" />, 'error.totp_required': () => <Message key="totpRequired" defaultMessage="Please, enter the code" />,
'error.totp_incorrect': () => <Message key="totpIncorrect" defaultMessage="The code is incorrect" />, 'error.totp_incorrect': () => <Message key="totpIncorrect" defaultMessage="The code is incorrect" />,
'error.otp_already_enabled': () => <Message key="mfaAlreadyEnabled" defaultMessage="The two factor auth is already enabled" />, 'error.otp_already_enabled': () => (
<Message key="mfaAlreadyEnabled" defaultMessage="The two factor auth is already enabled" />
),
'error.rePassword_required': () => <Message key="rePasswordRequired" defaultMessage="Please retype your password" />, 'error.rePassword_required': () => (
'error.password_too_short': () => <Message key="passwordTooShort" defaultMessage="Your password should be at least 8 characters length" />, <Message key="rePasswordRequired" defaultMessage="Please retype your password" />
'error.rePassword_does_not_match': () => <Message key="passwordsDoesNotMatch" defaultMessage="The passwords does not match" />, ),
'error.rulesAgreement_required': () => <Message key="rulesAgreementRequired" defaultMessage="You must accept rules in order to create an account" />, 'error.password_too_short': () => (
<Message key="passwordTooShort" defaultMessage="Your password should be at least 8 characters length" />
),
'error.rePassword_does_not_match': () => (
<Message key="passwordsDoesNotMatch" defaultMessage="The passwords does not match" />
),
'error.rulesAgreement_required': () => (
<Message key="rulesAgreementRequired" defaultMessage="You must accept rules in order to create an account" />
),
'error.key_required': () => <Message key="keyRequired" defaultMessage="Please, enter an activation key" />, 'error.key_required': () => <Message key="keyRequired" defaultMessage="Please, enter an activation key" />,
'error.key_not_exists': (props) => ( 'error.key_not_exists': (props) => (
<> <>
@ -78,10 +94,16 @@ const errorsMap: Record<string, (props?: Record<string, any>) => ReactElement> =
), ),
'error.key_expire': (props) => errorsMap['error.key_not_exists'](props), 'error.key_expire': (props) => errorsMap['error.key_not_exists'](props),
'error.newPassword_required': () => <Message key="newPasswordRequired" defaultMessage="Please enter new password" />, 'error.newPassword_required': () => (
'error.newRePassword_required': () => <Message key="newRePasswordRequired" defaultMessage="Please repeat new password" />, <Message key="newPasswordRequired" defaultMessage="Please enter new password" />
),
'error.newRePassword_required': () => (
<Message key="newRePasswordRequired" defaultMessage="Please repeat new password" />
),
'error.account_not_activated': () => <Message key="accountNotActivated" defaultMessage="The account is not activated" />, 'error.account_not_activated': () => (
<Message key="accountNotActivated" defaultMessage="The account is not activated" />
),
'error.account_banned': () => <Message key="accountBanned" defaultMessage="Account is blocked" />, 'error.account_banned': () => <Message key="accountBanned" defaultMessage="Account is blocked" />,
'error.recently_sent_message': (props) => ( 'error.recently_sent_message': (props) => (
@ -96,7 +118,9 @@ const errorsMap: Record<string, (props?: Record<string, any>) => ReactElement> =
), ),
'error.email_not_found': () => <Message key="emailNotFound" defaultMessage="Specified Email is not found" />, 'error.email_not_found': () => <Message key="emailNotFound" defaultMessage="Specified Email is not found" />,
'error.account_already_activated': () => <Message key="accountAlreadyActivated" defaultMessage="This account is already activated" />, 'error.account_already_activated': () => (
<Message key="accountAlreadyActivated" defaultMessage="This account is already activated" />
),
'error.captcha_required': () => <Message key="captchaRequired" defaultMessage="Please, solve the captcha" />, 'error.captcha_required': () => <Message key="captchaRequired" defaultMessage="Please, solve the captcha" />,
'error.captcha_invalid': (props) => errorsMap['error.captcha_required'](props), 'error.captcha_invalid': (props) => errorsMap['error.captcha_required'](props),