From 757cae1b85903108f5a304978af96fb3a596362f Mon Sep 17 00:00:00 2001 From: fabienSvstr Date: Wed, 4 Dec 2024 13:22:30 +0100 Subject: [PATCH 1/6] [MS] Order tracking client area --- client/src/locales/en-US.json | 23 +- client/src/locales/fr-FR.json | 23 +- client/src/services/translation.ts | 41 +++ .../src/views/client-area/ClientAreaPage.vue | 7 +- .../dashboard/CustomOrderProcessingPage.vue | 261 +++++++++++++++++- 5 files changed, 348 insertions(+), 7 deletions(-) diff --git a/client/src/locales/en-US.json b/client/src/locales/en-US.json index 7817174deb8..f858fd53c4b 100644 --- a/client/src/locales/en-US.json +++ b/client/src/locales/en-US.json @@ -1625,7 +1625,28 @@ "description": "You can change your credit card at any time.", "update": "Update" }, - "processing": "Your order is being processed." + "processing": { + "requestSent": { + "title": "Request sent", + "description": "We are processing your request. We will contact you within 4 working days." + }, + "estimateLinked": { + "title": "Estimate pending signature", + "description": "Please return the signed estimate received by e-mail to receive the invoice." + }, + "invoiceToBePaid": { + "title": "Invoice to be paid", + "description": "Awaiting receipt of bank transfer to finalize your order." + }, + "organizationAvailable": { + "title": "Organization available", + "description": "Our team sets up your organization. You'll receive an email as soon as everything is ready." + }, + "error": { + "title": "Failed to retrieve the information.", + "description": "An error occurred while processing your order. Please contact us." + } + } }, "billingDetailsPage": { "placeholders": { diff --git a/client/src/locales/fr-FR.json b/client/src/locales/fr-FR.json index c0aa513c6cc..d9fa87fa1b7 100644 --- a/client/src/locales/fr-FR.json +++ b/client/src/locales/fr-FR.json @@ -1625,7 +1625,28 @@ "description": "Vous pouvez à tout moment changer votre carte bancaire.", "update": "Modifier" }, - "processing": "Votre commande est en cours de traitement." + "processing": { + "requestSent": { + "title": "Demande envoyée", + "description": "Nous traitons votre votre demande. Nous allons vous recontacter sous 4 jours ouvrés." + }, + "estimateLinked": { + "title": "Devis signé", + "description": "Veuillez nous retourner le devis reçu par mail, signé pour recevoir la facture." + }, + "invoiceToBePaid": { + "title": "Facture à régler", + "description": "En attente de réception du virement bancaire pour finaliser votre commande." + }, + "organizationAvailable": { + "title": "Organisation disponible", + "description": "Notre équipe configure votre organisation. Vous recevrez un email dès que tout sera prêt." + }, + "error": { + "title": "Failed to retrieve the information.", + "description": "An error occurred while processing your order. Please contact us." + } + } }, "billingDetailsPage": { "placeholders": { diff --git a/client/src/services/translation.ts b/client/src/services/translation.ts index c4bc9c6e9b8..22dfe0cf0d4 100644 --- a/client/src/services/translation.ts +++ b/client/src/services/translation.ts @@ -1,6 +1,7 @@ // Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS import { InvitationStatus, UserProfile, WorkspaceRole } from '@/parsec'; +import { CustomOrderStatus } from '@/services/bms'; import { Locale, Translatable } from 'megashark-lib'; export function getProfileTranslationKey(profile: UserProfile): Translatable { @@ -53,6 +54,46 @@ export function getWorkspaceRoleTranslationKey(role: WorkspaceRole | null): Work } } +interface CustomOrderStatusTranslations { + title: Translatable; + description?: Translatable; +} + +export function getCustomOrderStatusTranslationKey(status: CustomOrderStatus | undefined): CustomOrderStatusTranslations { + switch (status) { + case undefined: { + return { + title: 'clientArea.dashboard.processing.error.title', + }; + } + case CustomOrderStatus.NothingLinked: + return { + title: 'clientArea.dashboard.processing.requestSent.title', + description: 'clientArea.dashboard.processing.requestSent.description', + }; + case CustomOrderStatus.EstimateLinked: + return { + title: 'clientArea.dashboard.processing.estimateLinked.title', + description: 'clientArea.dashboard.processing.estimateLinked.description', + }; + case CustomOrderStatus.InvoiceToBePaid: + return { + title: 'clientArea.dashboard.processing.invoiceToBePaid.title', + description: 'clientArea.dashboard.processing.invoiceToBePaid.description', + }; + case CustomOrderStatus.InvoicePaid: + return { + title: 'clientArea.dashboard.processing.organizationAvailable.title', + description: 'clientArea.dashboard.processing.organizationAvailable.description', + }; + default: + return { + title: 'clientArea.dashboard.processing.error.title', + description: 'clientArea.dashboard.processing.error.description', + }; + } +} + export function getInvitationStatusTranslationKey(status: InvitationStatus): Translatable { switch (status) { case InvitationStatus.Ready: diff --git a/client/src/views/client-area/ClientAreaPage.vue b/client/src/views/client-area/ClientAreaPage.vue index 84c2d8d48ab..c740ef5ee22 100644 --- a/client/src/views/client-area/ClientAreaPage.vue +++ b/client/src/views/client-area/ClientAreaPage.vue @@ -107,7 +107,10 @@ v-if="currentPage === ClientAreaPages.CustomOrderBillingDetails" :organization="currentOrganization" /> - + @@ -278,6 +281,8 @@ function getTitleByPage(): Translatable { return 'clientArea.header.titles.customOrderStatistics'; case ClientAreaPages.CustomOrderBillingDetails: return 'clientArea.header.titles.customOrderBillingDetails'; + case ClientAreaPages.CustomOrderProcessing: + return 'clientArea.header.titles.customOrderProcessing'; default: return ''; } diff --git a/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue b/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue index 662b169d517..742fdd4a340 100644 --- a/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue +++ b/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue @@ -2,14 +2,140 @@ From 342449039f7cd38acedce01bf84cb08990b5a5d5 Mon Sep 17 00:00:00 2001 From: fabienSvstr Date: Wed, 11 Dec 2024 12:34:42 +0100 Subject: [PATCH 2/6] [MS] Added newsfragment --- newsfragments/9111.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/9111.feature.rst diff --git a/newsfragments/9111.feature.rst b/newsfragments/9111.feature.rst new file mode 100644 index 00000000000..3d7f84fae83 --- /dev/null +++ b/newsfragments/9111.feature.rst @@ -0,0 +1 @@ +Added page for tracking order (custom order only). \ No newline at end of file From 88a3e05162b6ac77693ab606ed47e54bd0b54ce6 Mon Sep 17 00:00:00 2001 From: fabienSvstr Date: Wed, 11 Dec 2024 13:49:00 +0100 Subject: [PATCH 3/6] [MS] Update locale --- client/src/locales/en-US.json | 10 +++++----- client/src/locales/fr-FR.json | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/locales/en-US.json b/client/src/locales/en-US.json index f858fd53c4b..1f210075eae 100644 --- a/client/src/locales/en-US.json +++ b/client/src/locales/en-US.json @@ -1628,19 +1628,19 @@ "processing": { "requestSent": { "title": "Request sent", - "description": "We are processing your request. We will contact you within 4 working days." + "description": "Your request is being processed. We will contact you within 4 working days." }, "estimateLinked": { - "title": "Estimate pending signature", - "description": "Please return the signed estimate received by e-mail to receive the invoice." + "title": "Quotation signature pending", + "description": "Please sign and send back the quotation received by e-mail to get your invoice." }, "invoiceToBePaid": { "title": "Invoice to be paid", - "description": "Awaiting receipt of bank transfer to finalize your order." + "description": "Awaiting validation for your bank transfer to finalize your order." }, "organizationAvailable": { "title": "Organization available", - "description": "Our team sets up your organization. You'll receive an email as soon as everything is ready." + "description": "Our team is setting up your organization. You'll receive an email as soon as everything is ready." }, "error": { "title": "Failed to retrieve the information.", diff --git a/client/src/locales/fr-FR.json b/client/src/locales/fr-FR.json index d9fa87fa1b7..dbc04a8775a 100644 --- a/client/src/locales/fr-FR.json +++ b/client/src/locales/fr-FR.json @@ -1631,8 +1631,8 @@ "description": "Nous traitons votre votre demande. Nous allons vous recontacter sous 4 jours ouvrés." }, "estimateLinked": { - "title": "Devis signé", - "description": "Veuillez nous retourner le devis reçu par mail, signé pour recevoir la facture." + "title": "Devis à signer", + "description": "Veuillez signer puis nous retourner le devis reçu par mail afin de recevoir votre facture." }, "invoiceToBePaid": { "title": "Facture à régler", @@ -1643,8 +1643,8 @@ "description": "Notre équipe configure votre organisation. Vous recevrez un email dès que tout sera prêt." }, "error": { - "title": "Failed to retrieve the information.", - "description": "An error occurred while processing your order. Please contact us." + "title": "Erreur lors de la récupération des informations", + "description": "Une erreur est survenue. Veuillez nous contacter." } } }, From d10532ca4371423ad3e77fa25de481ab2670f30c Mon Sep 17 00:00:00 2001 From: fabienSvstr Date: Wed, 11 Dec 2024 13:52:56 +0100 Subject: [PATCH 4/6] Update newsfragment --- newsfragments/9111.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newsfragments/9111.feature.rst b/newsfragments/9111.feature.rst index 3d7f84fae83..b2c7545b231 100644 --- a/newsfragments/9111.feature.rst +++ b/newsfragments/9111.feature.rst @@ -1 +1 @@ -Added page for tracking order (custom order only). \ No newline at end of file +Added page for tracking order (custom order only). From 5964a66299e4d06ffbe615ffe63aaf2c809fd682 Mon Sep 17 00:00:00 2001 From: fabienSvstr Date: Wed, 11 Dec 2024 14:27:08 +0100 Subject: [PATCH 5/6] [MS] Added Unknow step --- .../dashboard/CustomOrderProcessingPage.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue b/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue index 742fdd4a340..e1ba143f9da 100644 --- a/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue +++ b/client/src/views/client-area/dashboard/CustomOrderProcessingPage.vue @@ -2,7 +2,7 @@