From 6319f8c12d3dc18d842f40288be5ee038c75c627 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Thu, 17 Feb 2022 15:24:23 +0000 Subject: [PATCH 1/3] comment out name inputs --- .../Modules/Settings/ProfileTab/index.tsx | 83 +++++++++---------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/packages/files-ui/src/Components/Modules/Settings/ProfileTab/index.tsx b/packages/files-ui/src/Components/Modules/Settings/ProfileTab/index.tsx index f43e4e969b..9cfab0e3b3 100644 --- a/packages/files-ui/src/Components/Modules/Settings/ProfileTab/index.tsx +++ b/packages/files-ui/src/Components/Modules/Settings/ProfileTab/index.tsx @@ -1,7 +1,5 @@ import React, { useState, useCallback, useMemo } from "react" -import * as yup from "yup" import { - FormikTextInput, Grid, Button, Typography, @@ -13,13 +11,14 @@ import { } from "@chainsafe/common-components" import { makeStyles, createStyles, debounce } from "@chainsafe/common-theme" import { CopyIcon } from "@chainsafe/common-components" -import { Form, useFormik, FormikProvider } from "formik" import { useUser } from "../../../../Contexts/UserContext" import { t, Trans } from "@lingui/macro" import { centerEllipsis } from "../../../../Utils/Helpers" import { CSFTheme } from "../../../../Themes/types" import { useThresholdKey } from "../../../../Contexts/ThresholdKeyContext" import EthCrypto from "eth-crypto" +// import { Form, useFormik, FormikProvider } from "formik" +// import * as yup from "yup" const useStyles = makeStyles(({ constants, breakpoints, palette }: CSFTheme) => createStyles({ @@ -139,48 +138,48 @@ const useStyles = makeStyles(({ constants, breakpoints, palette }: CSFTheme) => }) ) -const profileValidation = yup.object().shape({ - // email: yup.string().email("Email is invalid").required("Email is required"), - firstName: yup.string(), - lastName: yup.string(), - username: yup.string() -}) +// const profileValidation = yup.object().shape({ +// email: yup.string().email("Email is invalid").required("Email is required"), +// firstName: yup.string(), +// lastName: yup.string(), +// username: yup.string() +// }) const ProfileView = () => { const { addToast } = useToasts() - const { profile, updateProfile, addUsername, lookupOnUsername, toggleLookupConsent } = useUser() + const { profile, addUsername, lookupOnUsername, toggleLookupConsent } = useUser() const { publicKey } = useThresholdKey() - const [updatingProfile, setUpdatingProfile] = useState(false) const [showUsernameForm, setShowUsernameForm] = useState(false) const [username, setUsername] = useState("") const [usernameData, setUsernameData] = useState({ error: "", loading: false }) - const formik = useFormik({ - initialValues: { - firstName: profile?.firstName || "", - lastName: profile?.lastName || "" - // email: profile?.email || "" - }, - onSubmit: (values) => { - onUpdateProfile( - values.firstName || "", - values.lastName || "" - // values.email || "" - ) - }, - validationSchema: profileValidation, - validateOnChange: false - }) - const onUpdateProfile = async (firstName: string, lastName: string) => { - try { - setUpdatingProfile(true) - await updateProfile(firstName, lastName) - addToast({ title: t`Profile updated`, type: "success", testId: "profile-update-success" }) - setUpdatingProfile(false) - } catch (error) { - error instanceof Error && addToast({ title: error.message, type: "error" }) - setUpdatingProfile(false) - } - } + // const [updatingProfile, setUpdatingProfile] = useState(false) + // const formik = useFormik({ + // initialValues: { + // firstName: profile?.firstName || "", + // lastName: profile?.lastName || "" + // email: profile?.email || "" + // }, + // onSubmit: (values) => { + // onUpdateProfile( + // values.firstName || "", + // values.lastName || "" + // values.email || "" + // ) + // }, + // validationSchema: profileValidation, + // validateOnChange: false + // }) + // const onUpdateProfile = async (firstName: string, lastName: string) => { + // try { + // setUpdatingProfile(true) + // await updateProfile(firstName, lastName) + // addToast({ title: t`Profile updated`, type: "success", testId: "profile-update-success" }) + // setUpdatingProfile(false) + // } catch (error) { + // error instanceof Error && addToast({ title: error.message, type: "error" }) + // setUpdatingProfile(false) + // } + // } const classes = useStyles() @@ -451,7 +450,7 @@ const ProfileView = () => { value={profile?.lookupConsent || false} onChange={toggleLookupConsent} /> - + {/*
{ data-cy="input-profile-lastname" />
- {/*
+
{ label="Email" disabled={!profile?.publicAddress} /> -
*/} +
-
+
*/} {/*
From 8fafb62360b89464852de1a55d017e822f8da012 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 17 Feb 2022 15:29:01 +0000 Subject: [PATCH 2/3] lingui extract --- packages/files-ui/src/locales/de/messages.po | 15 --------------- packages/files-ui/src/locales/en/messages.po | 15 --------------- packages/files-ui/src/locales/es/messages.po | 15 --------------- packages/files-ui/src/locales/fr/messages.po | 15 --------------- packages/files-ui/src/locales/no/messages.po | 15 --------------- 5 files changed, 75 deletions(-) diff --git a/packages/files-ui/src/locales/de/messages.po b/packages/files-ui/src/locales/de/messages.po index 79724d8ea9..39db01a587 100644 --- a/packages/files-ui/src/locales/de/messages.po +++ b/packages/files-ui/src/locales/de/messages.po @@ -406,9 +406,6 @@ msgstr "Dateien" msgid "Files sharing key" msgstr "Dateifreigabeschlüssel" -msgid "First name" -msgstr "Vorname" - msgid "Folder name is already in use" msgstr "" @@ -496,9 +493,6 @@ msgstr "" msgid "Language" msgstr "Sprache" -msgid "Last name" -msgstr "Nachname" - msgid "Learn more" msgstr "Mehr erfahren" @@ -616,9 +610,6 @@ msgstr "" msgid "Only send the exact amount of {0} to this address" msgstr "" -msgid "Only you can see this." -msgstr "Nur Sie können dies sehen." - msgid "Oops! You need to pay for this month to upload more content." msgstr "" @@ -718,9 +709,6 @@ msgstr "" msgid "Profile" msgstr "" -msgid "Profile updated" -msgstr "Profil aktualisiert" - msgid "Recover" msgstr "Wiederherstellen" @@ -772,9 +760,6 @@ msgstr "Ressourcen" msgid "Restore with backup secret phrase" msgstr "Mit Sicherungsgeheimsatz wiederherstellen" -msgid "Save changes" -msgstr "Änderungen speichern" - msgid "Save this browser for next time?" msgstr "Diesen Browser für das nächste Mal speichern?" diff --git a/packages/files-ui/src/locales/en/messages.po b/packages/files-ui/src/locales/en/messages.po index dc36328e52..21effd4454 100644 --- a/packages/files-ui/src/locales/en/messages.po +++ b/packages/files-ui/src/locales/en/messages.po @@ -409,9 +409,6 @@ msgstr "Files" msgid "Files sharing key" msgstr "Files sharing key" -msgid "First name" -msgstr "First name" - msgid "Folder name is already in use" msgstr "Folder name is already in use" @@ -499,9 +496,6 @@ msgstr "Keep original files" msgid "Language" msgstr "Language" -msgid "Last name" -msgstr "Last name" - msgid "Learn more" msgstr "Learn more" @@ -619,9 +613,6 @@ msgstr "One sec, getting files ready…" msgid "Only send the exact amount of {0} to this address" msgstr "Only send the exact amount of {0} to this address" -msgid "Only you can see this." -msgstr "Only you can see this." - msgid "Oops! You need to pay for this month to upload more content." msgstr "Oops! You need to pay for this month to upload more content." @@ -721,9 +712,6 @@ msgstr "Proceed to payment" msgid "Profile" msgstr "Profile" -msgid "Profile updated" -msgstr "Profile updated" - msgid "Recover" msgstr "Recover" @@ -775,9 +763,6 @@ msgstr "Resources" msgid "Restore with backup secret phrase" msgstr "Restore with backup secret phrase" -msgid "Save changes" -msgstr "Save changes" - msgid "Save this browser for next time?" msgstr "Save this browser for next time?" diff --git a/packages/files-ui/src/locales/es/messages.po b/packages/files-ui/src/locales/es/messages.po index 800d526988..a1ff91b0cc 100644 --- a/packages/files-ui/src/locales/es/messages.po +++ b/packages/files-ui/src/locales/es/messages.po @@ -410,9 +410,6 @@ msgstr "Archivos" msgid "Files sharing key" msgstr "" -msgid "First name" -msgstr "Primer Nombre" - msgid "Folder name is already in use" msgstr "" @@ -500,9 +497,6 @@ msgstr "" msgid "Language" msgstr "Idioma" -msgid "Last name" -msgstr "Apellido" - msgid "Learn more" msgstr "Aprende Mas" @@ -620,9 +614,6 @@ msgstr "" msgid "Only send the exact amount of {0} to this address" msgstr "" -msgid "Only you can see this." -msgstr "" - msgid "Oops! You need to pay for this month to upload more content." msgstr "" @@ -722,9 +713,6 @@ msgstr "" msgid "Profile" msgstr "" -msgid "Profile updated" -msgstr "Perfil actualizado" - msgid "Recover" msgstr "Recuperar" @@ -776,9 +764,6 @@ msgstr "Recursos" msgid "Restore with backup secret phrase" msgstr "" -msgid "Save changes" -msgstr "Guardar cambios" - msgid "Save this browser for next time?" msgstr "Guardar este navegador para la próxima vez?" diff --git a/packages/files-ui/src/locales/fr/messages.po b/packages/files-ui/src/locales/fr/messages.po index 246e5d1189..6ba532eaae 100644 --- a/packages/files-ui/src/locales/fr/messages.po +++ b/packages/files-ui/src/locales/fr/messages.po @@ -410,9 +410,6 @@ msgstr "Fichiers" msgid "Files sharing key" msgstr "Clé de partage des fichiers" -msgid "First name" -msgstr "Prénom" - msgid "Folder name is already in use" msgstr "Le nom du dossier est déjà utilisé" @@ -500,9 +497,6 @@ msgstr "Conserver les fichiers originaux" msgid "Language" msgstr "Langue" -msgid "Last name" -msgstr "Nom" - msgid "Learn more" msgstr "En savoir plus" @@ -620,9 +614,6 @@ msgstr "Les fichiers sont presque prêts…" msgid "Only send the exact amount of {0} to this address" msgstr "N'envoyez que la somme exacte de {0} à cette adresse" -msgid "Only you can see this." -msgstr "Vous seul(e) pouvez voir ceci." - msgid "Oops! You need to pay for this month to upload more content." msgstr "Oups ! Vous devez payer pour ce mois-ci pour ajouter plus de contenu." @@ -722,9 +713,6 @@ msgstr "Procéder au paiement" msgid "Profile" msgstr "Profil" -msgid "Profile updated" -msgstr "Profile mis à jour" - msgid "Recover" msgstr "Récupérer" @@ -776,9 +764,6 @@ msgstr "Ressources" msgid "Restore with backup secret phrase" msgstr "Récupérer avec la phrase de sauvegarde secrète" -msgid "Save changes" -msgstr "Enregistrer" - msgid "Save this browser for next time?" msgstr "Enregistrer ce navigateur ?" diff --git a/packages/files-ui/src/locales/no/messages.po b/packages/files-ui/src/locales/no/messages.po index 3a94d4df68..439d8c4717 100644 --- a/packages/files-ui/src/locales/no/messages.po +++ b/packages/files-ui/src/locales/no/messages.po @@ -406,9 +406,6 @@ msgstr "Filer" msgid "Files sharing key" msgstr "" -msgid "First name" -msgstr "Fornavn" - msgid "Folder name is already in use" msgstr "" @@ -496,9 +493,6 @@ msgstr "" msgid "Language" msgstr "Språk" -msgid "Last name" -msgstr "Etternavn" - msgid "Learn more" msgstr "Lær mer" @@ -616,9 +610,6 @@ msgstr "" msgid "Only send the exact amount of {0} to this address" msgstr "" -msgid "Only you can see this." -msgstr "Kun du kan se dette." - msgid "Oops! You need to pay for this month to upload more content." msgstr "" @@ -718,9 +709,6 @@ msgstr "" msgid "Profile" msgstr "" -msgid "Profile updated" -msgstr "Profil oppdatert" - msgid "Recover" msgstr "Gjenopprett" @@ -772,9 +760,6 @@ msgstr "Ressurser" msgid "Restore with backup secret phrase" msgstr "" -msgid "Save changes" -msgstr "Lagre endringer" - msgid "Save this browser for next time?" msgstr "" From 5845613c9c46e41665a8887e3c69acec2cb7b15d Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Thu, 17 Feb 2022 15:50:12 +0000 Subject: [PATCH 3/3] comment out tests --- .../files-ui/cypress/tests/settings-spec.ts | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/files-ui/cypress/tests/settings-spec.ts b/packages/files-ui/cypress/tests/settings-spec.ts index fea9779268..6491f166de 100644 --- a/packages/files-ui/cypress/tests/settings-spec.ts +++ b/packages/files-ui/cypress/tests/settings-spec.ts @@ -1,7 +1,7 @@ import { navigationMenu } from "../support/page-objects/navigationMenu" import { settingsPage } from "../support/page-objects/settingsPage" import { homePage } from "../support/page-objects/homePage" -import { profileUpdateSuccessToast } from "../support/page-objects/toasts/profileUpdateSuccessToast" +// import { profileUpdateSuccessToast } from "../support/page-objects/toasts/profileUpdateSuccessToast" describe("Settings", () => { context("desktop", () => { @@ -18,26 +18,26 @@ describe("Settings", () => { settingsPage.profileTabHeader().should("be.visible") }) - it("save changes button should be disabled without first and last name", () => { - settingsPage.signOutDropdown().should("be.visible") - settingsPage.firstNameInput().clear() - settingsPage.lastNameInput().clear() + // it("save changes button should be disabled without first and last name", () => { + // settingsPage.signOutDropdown().should("be.visible") + // settingsPage.firstNameInput().clear() + // settingsPage.lastNameInput().clear() - settingsPage.saveChangesButton().should("be.disabled") - }) + // settingsPage.saveChangesButton().should("be.disabled") + // }) - it("can add/edit firstname and lastname", () => { - settingsPage.signOutDropdown().should("be.visible") - const newFirstName = "test first name" - const newLastName = "test last name" + // it("can add/edit firstname and lastname", () => { + // settingsPage.signOutDropdown().should("be.visible") + // const newFirstName = "test first name" + // const newLastName = "test last name" - settingsPage.firstNameInput().type(newFirstName) - settingsPage.lastNameInput().type(`${newLastName}{enter}`) + // settingsPage.firstNameInput().type(newFirstName) + // settingsPage.lastNameInput().type(`${newLastName}{enter}`) - profileUpdateSuccessToast.body().should("be.visible") - settingsPage.firstNameInput().should("have.value", newFirstName) - settingsPage.lastNameInput().should("have.value", newLastName) - }) + // profileUpdateSuccessToast.body().should("be.visible") + // settingsPage.firstNameInput().should("have.value", newFirstName) + // settingsPage.lastNameInput().should("have.value", newLastName) + // }) // username from date const newUserName = Date.now().toString()