Skip to content

Commit

Permalink
[MS] Order tracking client area
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienSvtr committed Dec 11, 2024
1 parent ac3b38c commit a6af4ee
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 7 deletions.
23 changes: 22 additions & 1 deletion client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,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": {
Expand Down
23 changes: 22 additions & 1 deletion client/src/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,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": {
Expand Down
41 changes: 41 additions & 0 deletions client/src/services/translation.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion client/src/views/client-area/ClientAreaPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@
v-if="currentPage === ClientAreaPages.CustomOrderBillingDetails"
:organization="currentOrganization"
/>
<custom-order-processing-page v-if="currentPage === ClientAreaPages.CustomOrderProcessing" />
<custom-order-processing-page
v-if="currentPage === ClientAreaPages.CustomOrderProcessing"
:organization="currentOrganization"
/>
</div>
</div>
</ion-content>
Expand Down Expand Up @@ -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 '';
}
Expand Down
Loading

0 comments on commit a6af4ee

Please sign in to comment.