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/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "error", "@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-unused-vars": "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/rules-of-hooks": "warn", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies "react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"no-restricted-imports": [ "no-restricted-imports": [

View File

@ -188,6 +188,12 @@
"forgot.email": { "forgot.email": {
"defaultMessage": "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": { "forgot.page-title": {
"defaultMessage": "Forgot Password | WiseMapping" "defaultMessage": "Forgot Password | WiseMapping"
}, },
@ -305,6 +311,9 @@
"login.desc": { "login.desc": {
"defaultMessage": "Log into your account" "defaultMessage": "Log into your account"
}, },
"login.division": {
"defaultMessage": "or"
},
"login.email": { "login.email": {
"defaultMessage": "Email" "defaultMessage": "Email"
}, },
@ -314,6 +323,9 @@
"login.forgotpwd": { "login.forgotpwd": {
"defaultMessage": "Forgot Password ?" "defaultMessage": "Forgot Password ?"
}, },
"login.google.button": {
"defaultMessage": "Sign in with Google"
},
"login.page-title": { "login.page-title": {
"defaultMessage": "Login | WiseMapping" "defaultMessage": "Login | WiseMapping"
}, },
@ -440,18 +452,45 @@
"publish.title": { "publish.title": {
"defaultMessage": "Publish" "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": { "registation.success-title": {
"defaultMessage": "Registation Success | WiseMapping" "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": { "registration.desc": {
"defaultMessage": "Signing up is free and just take a moment" "defaultMessage": "Signing up is free and just take a moment"
}, },
"registration.division": {
"defaultMessage": "or"
},
"registration.email": { "registration.email": {
"defaultMessage": "Email" "defaultMessage": "Email"
}, },
"registration.firstname": { "registration.firstname": {
"defaultMessage": "First Name" "defaultMessage": "First Name"
}, },
"registration.google.button": {
"defaultMessage": "Sign up with Google"
},
"registration.lastname": { "registration.lastname": {
"defaultMessage": "Last Name" "defaultMessage": "Last Name"
}, },
@ -514,42 +553,5 @@
}, },
"share.message": { "share.message": {
"defaultMessage": "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 ( return (
// eslint-disable-next-line react/no-unknown-property
<div css={containerStyle}> <div css={containerStyle}>
{/* eslint-disable-next-line react/no-unknown-property */}
<div css={lineStyle}></div> <div css={lineStyle}></div>
{/* eslint-disable-next-line react/no-unknown-property */}
<div css={textStyle}>{text}</div> <div css={textStyle}>{text}</div>
</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 // if service reports that user doesnt sync accounts yet, we need to show the options
const needConfirmLinking = !callbackError && email && !googleSync; 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 ( return (
<div> <div>
<Header type="none" /> <Header type="none" />
<FormContainer> <FormContainer>
<Typography variant="h4" component="h1"> <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>
<Typography paragraph> <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> </Typography>
{callbackError && ( {callbackError && (

View File

@ -163,16 +163,19 @@ const RegistrationForm = () => {
/> />
{AppConfig.isRecaptcha2Enabled() && ( {AppConfig.isRecaptcha2Enabled() && (
<div css={recaptchaContainerStyle}> <>
<ReCAPTCHA {/* eslint-disable-next-line react/no-unknown-property */}
ref={(el) => setCaptcha(el)} <div css={recaptchaContainerStyle}>
sitekey={AppConfig.getRecaptcha2SiteKey()} <ReCAPTCHA
onChange={(value: string) => { ref={(el) => setCaptcha(el)}
model.recaptcha = value; sitekey={AppConfig.getRecaptcha2SiteKey()}
setModel(model); onChange={(value: string) => {
}} model.recaptcha = value;
/> setModel(model);
</div> }}
/>
</div>
</>
)} )}
<div style={{ fontSize: '12px', padding: '10px 0px' }}> <div style={{ fontSize: '12px', padding: '10px 0px' }}>
<FormattedMessage <FormattedMessage