From 302c6fcaa69e0568ccf27f6d00510354f3bdc918 Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Mon, 26 Feb 2024 17:42:05 +0100 Subject: [PATCH 1/4] translate: my profile view --- frontend/messages/en.json | 8 +++++- frontend/messages/fr.json | 8 +++++- .../components/SideBar/SideBarFooter.svelte | 2 +- frontend/src/lib/utils/locales.ts | 2 ++ .../{profile => my-profile}/+page.svelte | 20 +++++++------ .../change-password/+page.server.ts | 2 +- .../change-password/+page.svelte | 28 +++++++++++++------ frontend/tests/functional/nav.test.ts | 4 +-- 8 files changed, 51 insertions(+), 23 deletions(-) rename frontend/src/routes/(app)/{profile => my-profile}/+page.svelte (67%) rename frontend/src/routes/(app)/{profile => my-profile}/change-password/+page.server.ts (97%) rename frontend/src/routes/(app)/{profile => my-profile}/change-password/+page.svelte (70%) diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 1c2c88325..521bdacba 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -28,6 +28,7 @@ "associatedUsers": "Associated users", "home": "Home", "edit": "Edit", + "changePassword": "Change password", "overview": "Overview", "context": "Context", "governance": "Governance", @@ -230,5 +231,10 @@ "probability": "Probability", "riskLevels": "Risk levels", "cancel": "Cancel", - "save": "Save" + "save": "Save", + "myUserGroups": "My user groups", + "changePasswordText": "You can change your password here. You'll need to log in with your new password after this operation", + "oldPassword": "Old password", + "newPassword": "New password", + "confirmNewPassword": "Confirm new password" } diff --git a/frontend/messages/fr.json b/frontend/messages/fr.json index d8cf2c16d..3d50cce29 100644 --- a/frontend/messages/fr.json +++ b/frontend/messages/fr.json @@ -28,6 +28,7 @@ "associatedUsers": "Utilisateurs associés", "home": "Accueil", "edit": "Modifier", + "changePassword": "Changer le mot de passe", "overview": "Vue d'ensemble", "context": "Contexte", "governance": "Gouvernance", @@ -230,5 +231,10 @@ "probability": "Probabilité", "riskLevels": "Niveaux de risque", "cancel": "Annuler", - "save": "Enregistrer" + "save": "Enregistrer", + "myUserGroups": "Mes groupes d'utilisateurs", + "changePasswordText": "Vous pouvez changer votre mot de passe ici. Vous devrez vous reconnecter avec le nouveau mot de passe après cette opération", + "oldPassword": "Ancien mot de passe", + "newPassword": "Nouveau mot de passe", + "confirmNewPassword": "Confirmer le nouveau mot de passe" } diff --git a/frontend/src/lib/components/SideBar/SideBarFooter.svelte b/frontend/src/lib/components/SideBar/SideBarFooter.svelte index 0da8615c8..f2d3777d5 100644 --- a/frontend/src/lib/components/SideBar/SideBarFooter.svelte +++ b/frontend/src/lib/components/SideBar/SideBarFooter.svelte @@ -66,7 +66,7 @@ data-popup="popupUser" > {m.myProfile()} diff --git a/frontend/src/lib/utils/locales.ts b/frontend/src/lib/utils/locales.ts index 195c3d353..116050012 100644 --- a/frontend/src/lib/utils/locales.ts +++ b/frontend/src/lib/utils/locales.ts @@ -1,3 +1,4 @@ +import { changePassword } from '$paraglide/messages/en'; import * as m from '../../paraglide/messages'; export const LOCALE_MAP = { @@ -167,6 +168,7 @@ export function localItems(languageTag: string): LocalItems { associatedDomains: m.associatedDomains({ languageTag: languageTag }), associatedProjects: m.associatedProjects({ languageTag: languageTag }), associatedUsers: m.associatedUsers({ languageTag: languageTag }), + changePassword: m.changePassword({ languageTag: languageTag }), }; return LOCAL_ITEMS; } diff --git a/frontend/src/routes/(app)/profile/+page.svelte b/frontend/src/routes/(app)/my-profile/+page.svelte similarity index 67% rename from frontend/src/routes/(app)/profile/+page.svelte rename to frontend/src/routes/(app)/my-profile/+page.svelte index f8de6b968..3754f9c2e 100644 --- a/frontend/src/routes/(app)/profile/+page.svelte +++ b/frontend/src/routes/(app)/my-profile/+page.svelte @@ -1,5 +1,9 @@ @@ -13,8 +14,7 @@

- You can change your password here.
- You'll need to log in with your new password after this operation. + {m.changePasswordText()}.

@@ -25,19 +25,29 @@ let:form validators={ChangePasswordSchema} > - - + + -

- + + {m.cancel()} + + +

diff --git a/frontend/tests/functional/nav.test.ts b/frontend/tests/functional/nav.test.ts index 284443e6d..2dd007a42 100644 --- a/frontend/tests/functional/nav.test.ts +++ b/frontend/tests/functional/nav.test.ts @@ -48,8 +48,8 @@ test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, pag await expect(sideBar.profileButton).toBeVisible(); await sideBar.profileButton.click(); await expect(sideBar.morePanel).toHaveAttribute('inert'); - await expect(page).toHaveURL('/profile'); - await expect.soft(logedPage.pageTitle).toHaveText('Profile'); + await expect(page).toHaveURL('/my-profile'); + await expect.soft(logedPage.pageTitle).toHaveText('My Profile'); await sideBar.moreButton.click(); await expect(sideBar.morePanel).not.toHaveAttribute('inert'); From b4c6e70cfd8bf679aea60983953502664d1ef501 Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Mon, 26 Feb 2024 17:51:32 +0100 Subject: [PATCH 2/4] fix: add missing translation for label --- frontend/messages/en.json | 3 ++- frontend/messages/fr.json | 3 ++- frontend/src/lib/utils/locales.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 521bdacba..44639bbad 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -236,5 +236,6 @@ "changePasswordText": "You can change your password here. You'll need to log in with your new password after this operation", "oldPassword": "Old password", "newPassword": "New password", - "confirmNewPassword": "Confirm new password" + "confirmNewPassword": "Confirm new password", + "label": "Label" } diff --git a/frontend/messages/fr.json b/frontend/messages/fr.json index 3d50cce29..cf57ebcbb 100644 --- a/frontend/messages/fr.json +++ b/frontend/messages/fr.json @@ -236,5 +236,6 @@ "changePasswordText": "Vous pouvez changer votre mot de passe ici. Vous devrez vous reconnecter avec le nouveau mot de passe après cette opération", "oldPassword": "Ancien mot de passe", "newPassword": "Nouveau mot de passe", - "confirmNewPassword": "Confirmer le nouveau mot de passe" + "confirmNewPassword": "Confirmer le nouveau mot de passe", + "label": "Label" } diff --git a/frontend/src/lib/utils/locales.ts b/frontend/src/lib/utils/locales.ts index 116050012..530d7c7a8 100644 --- a/frontend/src/lib/utils/locales.ts +++ b/frontend/src/lib/utils/locales.ts @@ -169,6 +169,7 @@ export function localItems(languageTag: string): LocalItems { associatedProjects: m.associatedProjects({ languageTag: languageTag }), associatedUsers: m.associatedUsers({ languageTag: languageTag }), changePassword: m.changePassword({ languageTag: languageTag }), + label: m.label({ languageTag: languageTag }), }; return LOCAL_ITEMS; } From 1a708e3b82e5d628d65fd8d4c512da9f9851c841 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Mon, 26 Feb 2024 20:21:54 +0100 Subject: [PATCH 3/4] Update fr.json Est actif -> Actif --- frontend/messages/fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/messages/fr.json b/frontend/messages/fr.json index cf57ebcbb..944c22fcb 100644 --- a/frontend/messages/fr.json +++ b/frontend/messages/fr.json @@ -129,7 +129,7 @@ "type": "Type", "lcStatus": "Statut", "internalReference": "Référence interne", - "isActive": "Est actif", + "isActive": "Actif", "dateJoined": "Date d'adhésion", "version": "Version", "treatment": "Traitement", From 02043967d5b47b435085023762edeb9a64d04bc2 Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Tue, 27 Feb 2024 14:02:56 +0100 Subject: [PATCH 4/4] fix: typo in nav.test --- frontend/tests/functional/nav.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/tests/functional/nav.test.ts b/frontend/tests/functional/nav.test.ts index 602d45290..40915cbc7 100644 --- a/frontend/tests/functional/nav.test.ts +++ b/frontend/tests/functional/nav.test.ts @@ -51,7 +51,7 @@ test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, pag await sideBar.profileButton.click(); await expect(sideBar.morePanel).toHaveAttribute('inert'); await expect(page).toHaveURL('/my-profile'); - await expect.soft(logedPage.pageTitle).toHaveText('My Profile'); + await expect.soft(logedPage.pageTitle).toHaveText('My profile'); await sideBar.moreButton.click(); await expect(sideBar.morePanel).not.toHaveAttribute('inert');