Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MS] Order tracking client area #9111

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
},
"estimateLinked": {
"title": "Estimate pending signature",
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
"description": "Please return the signed estimate received by e-mail to receive the invoice."
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
},
"invoiceToBePaid": {
"title": "Invoice to be paid",
"description": "Awaiting receipt of bank transfer to finalize your order."
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
},
"organizationAvailable": {
"title": "Organization available",
"description": "Our team sets up your organization. You'll receive an email as soon as everything is ready."
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
},
"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
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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."
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
},
"estimateLinked": {
"title": "Devis signé",
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
"description": "Veuillez nous retourner le devis reçu par mail, signé pour recevoir la facture."
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
},
"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.",
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
"description": "An error occurred while processing your order. Please contact us."
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
}
}
},
"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 {
fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
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',
};
}
}

fabienSvtr marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page will only be displayed if the status is at NothingLinked right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can let this v-if but with the condition below. With ContractEnded, it will be display on the ContractPage later.

if (statusResp.data.status !== CustomOrderStatus.ContractEnded) {
   currentPage.value = ClientAreaPages.CustomOrderProcessing;
 }

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
Loading