From f5ef6825d14361d1076e34ba16bf4e225726a9ad Mon Sep 17 00:00:00 2001 From: Gustavo Fuhr Date: Tue, 13 Dec 2022 14:58:38 -0300 Subject: [PATCH] code fixes --- packages/webapp/.eslintrc.json | 1 - packages/webapp/lang/en.json | 76 ++++++++++--------- .../src/components/common/separator/index.tsx | 3 + .../registration-callback/index.tsx | 31 +++++--- .../components/registration-page/index.tsx | 23 +++--- 5 files changed, 74 insertions(+), 60 deletions(-) diff --git a/packages/webapp/.eslintrc.json b/packages/webapp/.eslintrc.json index d0246ba5..257c1652 100644 --- a/packages/webapp/.eslintrc.json +++ b/packages/webapp/.eslintrc.json @@ -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": [ diff --git a/packages/webapp/lang/en.json b/packages/webapp/lang/en.json index df243543..5ebecc78 100644 --- a/packages/webapp/lang/en.json +++ b/packages/webapp/lang/en.json @@ -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" } - } \ No newline at end of file diff --git a/packages/webapp/src/components/common/separator/index.tsx b/packages/webapp/src/components/common/separator/index.tsx index c8286a59..287ff0fc 100644 --- a/packages/webapp/src/components/common/separator/index.tsx +++ b/packages/webapp/src/components/common/separator/index.tsx @@ -78,8 +78,11 @@ const Separator: React.FunctionComponent = ({ ]); return ( + // eslint-disable-next-line react/no-unknown-property
+ {/* eslint-disable-next-line react/no-unknown-property */}
+ {/* eslint-disable-next-line react/no-unknown-property */}
{text}
); diff --git a/packages/webapp/src/components/registration-callback/index.tsx b/packages/webapp/src/components/registration-callback/index.tsx index 4b56b932..2831f4a4 100644 --- a/packages/webapp/src/components/registration-callback/index.tsx +++ b/packages/webapp/src/components/registration-callback/index.tsx @@ -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 (
- + {needConfirmLinking ? ( + + ) : ( + + )} - + {needConfirmLinking ? ( + + ) : ( + + )} {callbackError && ( diff --git a/packages/webapp/src/components/registration-page/index.tsx b/packages/webapp/src/components/registration-page/index.tsx index 12d7a641..da2b1d29 100644 --- a/packages/webapp/src/components/registration-page/index.tsx +++ b/packages/webapp/src/components/registration-page/index.tsx @@ -163,16 +163,19 @@ const RegistrationForm = () => { /> {AppConfig.isRecaptcha2Enabled() && ( -
- setCaptcha(el)} - sitekey={AppConfig.getRecaptcha2SiteKey()} - onChange={(value: string) => { - model.recaptcha = value; - setModel(model); - }} - /> -
+ <> + {/* eslint-disable-next-line react/no-unknown-property */} +
+ setCaptcha(el)} + sitekey={AppConfig.getRecaptcha2SiteKey()} + onChange={(value: string) => { + model.recaptcha = value; + setModel(model); + }} + /> +
+ )}