From ba583eb7384695742c493931d38c2081951e56e9 Mon Sep 17 00:00:00 2001 From: NicolasRichel Date: Mon, 7 Sep 2026 15:14:22 +0200 Subject: [PATCH 1/2] fix(invitations): fix space invitation behavior --- .../invitation-form/ProjectInvitationForm.vue | 2 +- .../invitation-form/SpaceInvitationForm.vue | 47 ++++++++++++++----- .../users/user-role-badge/UserRoleBadge.vue | 1 + src/i18n/lang/de.json | 2 +- src/i18n/lang/en.json | 6 +-- src/i18n/lang/es.json | 2 +- src/i18n/lang/fr.json | 8 ++-- 7 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/components/specific/users/invitation-form/ProjectInvitationForm.vue b/src/components/specific/users/invitation-form/ProjectInvitationForm.vue index 7b743399c..4e13521c4 100644 --- a/src/components/specific/users/invitation-form/ProjectInvitationForm.vue +++ b/src/components/specific/users/invitation-form/ProjectInvitationForm.vue @@ -30,7 +30,7 @@ const submit = async ({ emails, role }) => { const existingEmails = props.users.map(user => user.email); if (emails.some(eml => existingEmails.includes(eml))) { - errorMessage.value = t("InvitationForm.userAlreadyExistInputErrorMessage"); + errorMessage.value = t("InvitationForm.projectUserAlreadyExistError"); return; } diff --git a/src/components/specific/users/invitation-form/SpaceInvitationForm.vue b/src/components/specific/users/invitation-form/SpaceInvitationForm.vue index f28f8f958..e7c29a6d6 100644 --- a/src/components/specific/users/invitation-form/SpaceInvitationForm.vue +++ b/src/components/specific/users/invitation-form/SpaceInvitationForm.vue @@ -1,6 +1,8 @@ diff --git a/src/components/specific/users/user-role-badge/UserRoleBadge.vue b/src/components/specific/users/user-role-badge/UserRoleBadge.vue index a94a7af59..1fcd488bb 100644 --- a/src/components/specific/users/user-role-badge/UserRoleBadge.vue +++ b/src/components/specific/users/user-role-badge/UserRoleBadge.vue @@ -45,6 +45,7 @@ export default { if (props.projectRole === PROJECT_ROLE.GUEST) { return "guest"; } + return "projectUser"; }); diff --git a/src/i18n/lang/de.json b/src/i18n/lang/de.json index 56003cad9..d12b95fb7 100644 --- a/src/i18n/lang/de.json +++ b/src/i18n/lang/de.json @@ -218,7 +218,7 @@ "submitButtonText": "Einladen", "successNotifText": "Einladung versendet", "successUserToAdmin": "Der Nutzer wurde zum Administrator befördert.", - "userAlreadyExistInputErrorMessage": "Der Nutzer ist bereits in Ihren Projekt." + "projectUserAlreadyExistError": "Der Nutzer ist bereits in Ihren Projekt." }, "ModelActionsCell": { "addTagsButtonText": "Tags hinzufügen", diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index c55842a97..314b6744c 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -82,12 +82,10 @@ "folder_permissions_updated": "Folder permissions updated", "folder_renamed": "Folder renamed", "folder_moved": "Folder moved", - "cloud_invitation_sent": "Invitation sent", "cloud_invitation_canceled": "Invitation canceled", "cloud_invitation_accepted": "Invitation accepted", "cloud_invitation_denied": "Invitation denied", - "project_invitation_sent": "Project invitation sent", "project_invitation_canceled": "Project invitation canceled", "project_invitation_accepted": "Project invitation accepted", @@ -288,7 +286,7 @@ "submitButtonText": "Send invitation", "successNotifText": "Invitation sent", "successUserToAdmin": "The user has now admin role", - "userAlreadyExistInputErrorMessage": "User is already in the project" + "projectUserAlreadyExistError": "User is already in the project" }, "ModelActionsCell": { "addTagsButtonText": "Add tags", @@ -1046,4 +1044,4 @@ "title": "Delete {visasCount} visas", "message": "You are about to delete the visas on the following files:" } -} +} \ No newline at end of file diff --git a/src/i18n/lang/es.json b/src/i18n/lang/es.json index 36412d363..a17dc7201 100644 --- a/src/i18n/lang/es.json +++ b/src/i18n/lang/es.json @@ -218,7 +218,7 @@ "submitButtonText": "Invitar", "successNotifText": "Invitación enviada", "successUserToAdmin": "El usuario ha sido ascendido a administrador", - "userAlreadyExistInputErrorMessage": "El usuario ya está en su proyecto" + "projectUserAlreadyExistError": "El usuario ya está en su proyecto" }, "ModelActionsCell": { "addTagsButtonText": "Añadir etiquetas", diff --git a/src/i18n/lang/fr.json b/src/i18n/lang/fr.json index f7205986d..8ef4c05b5 100644 --- a/src/i18n/lang/fr.json +++ b/src/i18n/lang/fr.json @@ -153,12 +153,10 @@ "folder_permissions_updated": "Modification des droits d’accès", "folder_renamed": "Renommage du dossier", "folder_moved": "Déplacement du dossier", - "cloud_invitation_sent": "Invitation envoyée", "cloud_invitation_canceled": "Invitation annulée", "cloud_invitation_accepted": "Invitation acceptée", "cloud_invitation_denied": "Invitation refusée", - "project_invitation_sent": "Invitation projet envoyée", "project_invitation_canceled": "Invitation projet annulée", "project_invitation_accepted": "Invitation projet acceptée", @@ -388,7 +386,9 @@ "InvitationForm": { "emailInputPlaceholder": "Email de l'utilisateur", "emailInputErrorMessage": "Email invalide", - "userAlreadyExistInputErrorMessage": "L'utilisateur est déjà dans votre projet", + "projectUserAlreadyExistError": "L'utilisateur est déjà dans votre projet", + "spaceUserAlreadyExistError": "L'utilisateur est déjà dans votre espace", + "spaceAdminAlreadyExistError": "Cet utilisateur est déjà admin dans votre espace", "roleInputLabel": "Rôle", "roles": { "admin": "Administrateur", @@ -1071,4 +1071,4 @@ "title": "Suppression de {visasCount} visas", "message": "Vous êtes sur le point de supprimer les visas sur les fichiers suivants :" } -} +} \ No newline at end of file From f41c2a684535e0549970444dcaf01761c86bb203 Mon Sep 17 00:00:00 2001 From: NicolasRichel Date: Tue, 8 Sep 2026 10:44:21 +0200 Subject: [PATCH 2/2] fix(invitations): add en translations --- .../users/invitation-form/ProjectInvitationForm.vue | 5 +++-- .../users/invitation-form/SpaceInvitationForm.vue | 8 +++++--- src/i18n/lang/en.json | 4 +++- src/i18n/lang/fr.json | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/specific/users/invitation-form/ProjectInvitationForm.vue b/src/components/specific/users/invitation-form/ProjectInvitationForm.vue index 4e13521c4..ec795ff85 100644 --- a/src/components/specific/users/invitation-form/ProjectInvitationForm.vue +++ b/src/components/specific/users/invitation-form/ProjectInvitationForm.vue @@ -29,8 +29,9 @@ const errorMessage = ref(""); const submit = async ({ emails, role }) => { const existingEmails = props.users.map(user => user.email); - if (emails.some(eml => existingEmails.includes(eml))) { - errorMessage.value = t("InvitationForm.projectUserAlreadyExistError"); + const alreadyExistingEmail = emails.find(eml => existingEmails.includes(eml)); + if (alreadyExistingEmail) { + errorMessage.value = t("InvitationForm.projectUserAlreadyExistError", { email: alreadyExistingEmail }); return; } diff --git a/src/components/specific/users/invitation-form/SpaceInvitationForm.vue b/src/components/specific/users/invitation-form/SpaceInvitationForm.vue index e7c29a6d6..716213a34 100644 --- a/src/components/specific/users/invitation-form/SpaceInvitationForm.vue +++ b/src/components/specific/users/invitation-form/SpaceInvitationForm.vue @@ -40,7 +40,7 @@ const submit = async ({ emails }) => { if (props.admin) { if (user) { if (user.cloud_role === SPACE_ROLE.ADMIN) { - errorMessage.value = t("InvitationForm.spaceAdminAlreadyExistError"); + errorMessage.value = t("InvitationForm.spaceAdminAlreadyExistError", { email: eml }); } else { await updateSpaceUser(props.space, { ...user, cloud_role: 100 }); } @@ -51,9 +51,9 @@ const submit = async ({ emails }) => { } else { if (user) { if (user.cloud_role === SPACE_ROLE.ADMIN) { - errorMessage.value = t("InvitationForm.spaceAdminAlreadyExistError"); + errorMessage.value = t("InvitationForm.spaceAdminAlreadyExistError", { email: eml }); } else { - errorMessage.value = t("InvitationForm.spaceUserAlreadyExistError"); + errorMessage.value = t("InvitationForm.spaceUserAlreadyExistError", { email: eml }); } } else { isExistingUsersOnly = false; @@ -67,6 +67,8 @@ const submit = async ({ emails }) => { } }); + if (errorMessage.value) return; + pushNotification( { type: "success", diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 314b6744c..34c903bab 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -286,7 +286,9 @@ "submitButtonText": "Send invitation", "successNotifText": "Invitation sent", "successUserToAdmin": "The user has now admin role", - "projectUserAlreadyExistError": "User is already in the project" + "projectUserAlreadyExistError": "User {email} is already in the project", + "spaceUserAlreadyExistError": "User {email} is already in the space", + "spaceAdminAlreadyExistError": "User {email} is already an admin of the space" }, "ModelActionsCell": { "addTagsButtonText": "Add tags", diff --git a/src/i18n/lang/fr.json b/src/i18n/lang/fr.json index 8ef4c05b5..b4ee5221d 100644 --- a/src/i18n/lang/fr.json +++ b/src/i18n/lang/fr.json @@ -386,9 +386,9 @@ "InvitationForm": { "emailInputPlaceholder": "Email de l'utilisateur", "emailInputErrorMessage": "Email invalide", - "projectUserAlreadyExistError": "L'utilisateur est déjà dans votre projet", - "spaceUserAlreadyExistError": "L'utilisateur est déjà dans votre espace", - "spaceAdminAlreadyExistError": "Cet utilisateur est déjà admin dans votre espace", + "projectUserAlreadyExistError": "L'utilisateur {email} est déjà dans votre projet", + "spaceUserAlreadyExistError": "L'utilisateur {email} est déjà dans votre espace", + "spaceAdminAlreadyExistError": "L'utilisateur {email} est déjà admin dans votre espace", "roleInputLabel": "Rôle", "roles": { "admin": "Administrateur",