code fixes

This commit is contained in:
Gustavo Fuhr 2022-12-13 14:58:38 -03:00
parent c561aa305f
commit f5ef6825d1
5 changed files with 74 additions and 60 deletions

View File

@ -30,7 +30,6 @@
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-unused-vars": "error",
"react/no-unknown-property": ["error", { "ignore": ["css"] }],
"react-hooks/rules-of-hooks": "warn", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"no-restricted-imports": [

View File

@ -188,6 +188,12 @@
"forgot.email": {
"defaultMessage": "Email"
},
"forgot.oauth.back": {
"defaultMessage": "Back to login"
},
"forgot.oauth.message": {
"defaultMessage": "You dont need password, please login using Google."
},
"forgot.page-title": {
"defaultMessage": "Forgot Password | WiseMapping"
},
@ -305,6 +311,9 @@
"login.desc": {
"defaultMessage": "Log into your account"
},
"login.division": {
"defaultMessage": "or"
},
"login.email": {
"defaultMessage": "Email"
},
@ -314,6 +323,9 @@
"login.forgotpwd": {
"defaultMessage": "Forgot Password ?"
},
"login.google.button": {
"defaultMessage": "Sign in with Google"
},
"login.page-title": {
"defaultMessage": "Login | WiseMapping"
},
@ -440,18 +452,45 @@
"publish.title": {
"defaultMessage": "Publish"
},
"registation.callback.error.message": {
"defaultMessage": "An error occurred validating your identity with Google, you can try again from the login page"
},
"registation.success-title": {
"defaultMessage": "Registation Success | WiseMapping"
},
"registration.callback.back": {
"defaultMessage": "Back to login"
},
"registration.callback.confirm.description": {
"defaultMessage": "An account with the same email was previously registered. Do you want to link your google account to that WiseMapping account?"
},
"registration.callback.confirm.title": {
"defaultMessage": "Confirm"
},
"registration.callback.sync": {
"defaultMessage": "Sync account"
},
"registration.callback.waiting.description": {
"defaultMessage": "Please wait while we validate your identity"
},
"registration.callback.waiting.title": {
"defaultMessage": "Finishing..."
},
"registration.desc": {
"defaultMessage": "Signing up is free and just take a moment"
},
"registration.division": {
"defaultMessage": "or"
},
"registration.email": {
"defaultMessage": "Email"
},
"registration.firstname": {
"defaultMessage": "First Name"
},
"registration.google.button": {
"defaultMessage": "Sign up with Google"
},
"registration.lastname": {
"defaultMessage": "Last Name"
},
@ -514,42 +553,5 @@
},
"share.message": {
"defaultMessage": "Message"
},
"registration.google.button": {
"defaultMessage": "Sign up with Google"
},
"login.google.button": {
"defaultMessage": "Sign in with Google"
},
"registration.division": {
"defaultMessage": "or"
},
"registration.callback.confirm.title": {
"defaultMessage": "Confirm"
},
"registration.callback.waiting.title": {
"defaultMessage": "Finishing ..."
},
"registration.callback.confirm.description": {
"defaultMessage": "An account with the same email was previously registered. Do you want to link your google account to that WiseMapping account?"
},
"registration.callback.waiting.description": {
"defaultMessage": "Please wait while we validate your identity"
},
"registation.callback.error.message": {
"defaultMessage": "An error occurred validating your identity with Google, you can try again from the login page"
},
"registration.callback.back": {
"defaultMessage": "Back to login"
},
"registration.callback.sync": {
"defaultMessage": "Sync account"
},
"forgot.oauth.message": {
"defaultMessage": "You dont need password, please login using Google"
},
"forgot.oauth.back": {
"defaultMessage": "Back to login"
}
}

View File

@ -78,8 +78,11 @@ const Separator: React.FunctionComponent<SeparatorProps> = ({
]);
return (
// eslint-disable-next-line react/no-unknown-property
<div css={containerStyle}>
{/* eslint-disable-next-line react/no-unknown-property */}
<div css={lineStyle}></div>
{/* eslint-disable-next-line react/no-unknown-property */}
<div css={textStyle}>{text}</div>
</div>
);

View File

@ -76,26 +76,33 @@ const RegistrationCallbackPage = (): React.ReactElement => {
// if service reports that user doesnt sync accounts yet, we need to show the options
const needConfirmLinking = !callbackError && email && !googleSync;
const titleKey = needConfirmLinking
? 'registration.callback.confirm.title'
: 'registration.callback.waiting.title';
const titleDefaultValue = needConfirmLinking ? 'Confirm' : 'Finishing...';
const descriptionKey = needConfirmLinking
? 'registration.callback.confirm.description'
: 'registration.callback.waiting.description';
const descriptionDefaultValue = needConfirmLinking
? 'An account with the same email was previously registered. Do you want to link your google account to that WiseMapping account?'
: 'Please wait while we validate your identity';
return (
<div>
<Header type="none" />
<FormContainer>
<Typography variant="h4" component="h1">
<FormattedMessage id={titleKey} defaultMessage={titleDefaultValue} />
{needConfirmLinking ? (
<FormattedMessage id="registration.callback.confirm.title" defaultMessage="Confirm" />
) : (
<FormattedMessage
id="registration.callback.waiting.title"
defaultMessage="Finishing..."
/>
)}
</Typography>
<Typography paragraph>
<FormattedMessage id={descriptionKey} defaultMessage={descriptionDefaultValue} />
{needConfirmLinking ? (
<FormattedMessage
id="registration.callback.confirm.description"
defaultMessage="An account with the same email was previously registered. Do you want to link your google account to that WiseMapping account?"
/>
) : (
<FormattedMessage
id="registration.callback.waiting.description"
defaultMessage="Please wait while we validate your identity"
/>
)}
</Typography>
{callbackError && (

View File

@ -163,6 +163,8 @@ const RegistrationForm = () => {
/>
{AppConfig.isRecaptcha2Enabled() && (
<>
{/* eslint-disable-next-line react/no-unknown-property */}
<div css={recaptchaContainerStyle}>
<ReCAPTCHA
ref={(el) => setCaptcha(el)}
@ -173,6 +175,7 @@ const RegistrationForm = () => {
}}
/>
</div>
</>
)}
<div style={{ fontSize: '12px', padding: '10px 0px' }}>
<FormattedMessage