From b1894dd53f8e6fe2b7623bb214736e3f26a7e6ae Mon Sep 17 00:00:00 2001 From: Rafael Rubim Cabral Date: Tue, 26 Oct 2021 16:11:49 -0300 Subject: [PATCH 1/7] Remove all unused messages from project --- messages/context.json | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/messages/context.json b/messages/context.json index 78d305ae..ccd59052 100644 --- a/messages/context.json +++ b/messages/context.json @@ -5,16 +5,13 @@ "vtex.store-messages@0.x::pages.addressEdit": "Edit address", "vtex.store-messages@0.x::pages.profile": "Profile", "vtex.store-messages@0.x::pages.profileEdit": "Edit Profile", - "vtex.store-messages@0.x::pages.myAccount": "My account", "vtex.store-messages@0.x::pages.logout": "Logout", "vtex.store-messages@0.x::logoutModal.cancel": "Cancel", "vtex.store-messages@0.x::logoutModal.title": "Do you really want to logout?", "vtex.store-messages@0.x::personalData.redefinePassword": "Redefine password", - "vtex.store-messages@0.x::personalData.saveData": "Save changes", "vtex.store-messages@0.x::personalData.password": "Password", "vtex.store-messages@0.x::personalData.currentPassword": "Current password", "vtex.store-messages@0.x::personalData.newPassword": "New password", - "vtex.store-messages@0.x::personalData.confirmPassword": "Confirm new password", "vtex.store-messages@0.x::personalData.savePassword": "Save password", "vtex.store-messages@0.x::personalData.yourPasswordMust": "Your password must have at least:", "vtex.store-messages@0.x::personalData.8chars": "8 characters", @@ -23,23 +20,13 @@ "vtex.store-messages@0.x::personalData.1lowLetter": "1 lowercase letter", "vtex.store-messages@0.x::personalData.sendAccessCode.title": "Send access code to your email", "vtex.store-messages@0.x::personalData.sendCode": "Send code", - "vtex.store-messages@0.x::personalData.confirmCode": "Confirm code", "vtex.store-messages@0.x::personalData.code": "Code", "vtex.store-messages@0.x::personalData.definePassword": "Set password", "vtex.store-messages@0.x::personalData.noPassword": "You do not have a password defined yet.", - "vtex.store-messages@0.x::personalData.definePassword.title": "Set Password", - "vtex.store-messages@0.x::personalData.editPassword.title": "Edit Password", "vtex.store-messages@0.x::personalData.resendCode": "Resend code", "vtex.store-messages@0.x::personalData.newsletterOptIn": "I want to receive the newsletter.", "vtex.store-messages@0.x::personalData.newsletter": "Newsletter", "vtex.store-messages@0.x::personalData.newsletterQuestion": "Do you want to receive promotional emails?", - "vtex.store-messages@0.x::upload.loading": "Loading…", - "vtex.store-messages@0.x::upload.choosePhoto": "Choose a Picture", - "vtex.store-messages@0.x::upload.chooseAgain": "Choose another Picture", - "vtex.store-messages@0.x::upload.save": "Save", - "vtex.store-messages@0.x::upload.dragYourPhoto": "Drag your new profile picture here", - "vtex.store-messages@0.x::upload.photoUpdated": "Your profile picture was successfully updated.", - "vtex.store-messages@0.x::upload.or": "or", "vtex.store-messages@0.x::addresses.addAddress": "Add address", "vtex.store-messages@0.x::addresses.saveAddress": "Save address", "vtex.store-messages@0.x::addresses.deleteAddress": "Delete address", @@ -48,8 +35,6 @@ "vtex.store-messages@0.x::commons.edit": "Edit", "vtex.store-messages@0.x::alert.addressNotFound": "The selected address was not found.", "vtex.store-messages@0.x::alert.success": "Your information was successfully saved.", - "vtex.store-messages@0.x::alert.fileTooBig": "This image is above the 4MB limit, choose a smaller one.", - "vtex.store-messages@0.x::alert.passwordMismatch": "Passwords do not match.", "vtex.store-messages@0.x::alert.wrongPassword": "Current password is wrong.", "vtex.store-messages@0.x::alert.wrongAndAboutToBlock": "Current password is wrong. One more invalid attempt will block your account for one hour.", "vtex.store-messages@0.x::alert.blockedUser": "You have been blocked, try again later.", From 072d7d7e61cd334b077d99e5f780ae50c1858af7 Mon Sep 17 00:00:00 2001 From: Rafael Rubim Cabral Date: Tue, 26 Oct 2021 15:28:37 -0300 Subject: [PATCH 2/7] Remove "hideMyAuthentication" setting from app --- graphql/schema.graphql | 1 - node/resolvers/settings.ts | 2 -- react/components/Menu/index.tsx | 14 ++------------ react/components/shared/withSettings.tsx | 1 - react/graphql/settings.gql | 1 - 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/graphql/schema.graphql b/graphql/schema.graphql index 27b1218a..fb8185f9 100644 --- a/graphql/schema.graphql +++ b/graphql/schema.graphql @@ -8,5 +8,4 @@ type AppSettings { showGenders: Boolean showMyCards: Boolean showMyOrders: Boolean - hideMyAuthentication: Boolean } diff --git a/node/resolvers/settings.ts b/node/resolvers/settings.ts index cb4bdae4..bb176b60 100644 --- a/node/resolvers/settings.ts +++ b/node/resolvers/settings.ts @@ -16,7 +16,6 @@ async function settings(_: unknown, __: unknown, ctx: ServiceContext) { showGenders: result.profile && result.profile.showGenders, showMyCards: result.cards && result.cards.showMyCards, showMyOrders: result.orders && result.orders.showMyOrders, - hideMyAuthentication: (result.authentication && result.authentication.hideMyAuthentication) || false, } } @@ -25,7 +24,6 @@ interface Settings { profile?: { showGenders: boolean } cards?: { showMyCards: boolean } orders?: { showMyOrders: boolean } - authentication?: { hideMyAuthentication: boolean } } export default settings diff --git a/react/components/Menu/index.tsx b/react/components/Menu/index.tsx index 4d322598..5379002d 100644 --- a/react/components/Menu/index.tsx +++ b/react/components/Menu/index.tsx @@ -19,12 +19,11 @@ const CSS_HANDLES = ['css', 'menu', 'menuLinks', 'menuLink'] as const interface RenderLinksOptions { showMyCards: boolean | null showMyOrders: boolean | null - hideMyAuthentication?: boolean | null } function renderLinks( links: Link[], - { showMyCards, showMyOrders, hideMyAuthentication }: RenderLinksOptions + { showMyCards, showMyOrders }: RenderLinksOptions ) { const linksToDisplay = links.filter(link => { if (showMyCards === false && link.path === '/cards') { @@ -35,10 +34,6 @@ function renderLinks( return false } - if (hideMyAuthentication === true && link.path === '/authentication') { - return false - } - return true }) @@ -56,11 +51,7 @@ class Menu extends Component { public render() { const { cssHandles, intl, settings } = this.props - const { - showMyCards = false, - showMyOrders = false, - hideMyAuthentication = false, - } = settings || {} + const { showMyCards = false, showMyOrders = false } = settings || {} return (