diff --git a/src/routes/my-orders/ListMyOrders.svelte b/src/routes/my-orders/ListMyOrders.svelte index 5194adbb..b0cdc4a2 100644 --- a/src/routes/my-orders/ListMyOrders.svelte +++ b/src/routes/my-orders/ListMyOrders.svelte @@ -14,7 +14,6 @@ import OrderStatus from "../../enums/OrderStatusKind"; import PageHeader from "../../components/PageHeader.svelte"; import PageBody from "../../components/PageBody.svelte"; - import Actions from "../../components/table/Actions.svelte"; const errorsHandler = new SheaftErrors(); const { query } = getContext("api"); @@ -28,7 +27,7 @@ isLoading = true; await query({ query: MY_ORDERS, - variables: { orderBy: { createdOn: OrderByDirection.DESC } }, + variables: { orderBy: { createdOn: OrderByDirection.DESC }, first: 50 }, errorsHandler, success: (res) => { items.set( @@ -38,7 +37,8 @@ p.status !== PurchaseOrderStatusKind.Cancelled.Value && p.status !== PurchaseOrderStatusKind.Withdrawned.Value && p.status !== PurchaseOrderStatusKind.Refused.Value && - p.status !== PurchaseOrderStatusKind.Delivered.Value, + p.status !== PurchaseOrderStatusKind.Delivered.Value && + p.status !== PurchaseOrderStatusKind.Expired.Value, })) ); }, @@ -93,7 +93,6 @@ }); $: hiddenNavigation = $items.filter((o) => !o.active).length < 1 || $items.filter((o) => o.active).length < 1; - diff --git a/src/routes/my-orders/MyOrderDetails.svelte b/src/routes/my-orders/MyOrderDetails.svelte index 2054f6c4..ad89f1df 100644 --- a/src/routes/my-orders/MyOrderDetails.svelte +++ b/src/routes/my-orders/MyOrderDetails.svelte @@ -33,6 +33,7 @@ case PurchaseOrderStatusKind.Waiting.Value: case PurchaseOrderStatusKind.Accepted.Value: case PurchaseOrderStatusKind.Refused.Value: + case PurchaseOrderStatusKind.Expired.Value: return 1; case PurchaseOrderStatusKind.Processing.Value: return 2; @@ -77,7 +78,8 @@ order.status != PurchaseOrderStatusKind.Delivered.Value && order.status != PurchaseOrderStatusKind.Shipping.Value && order.status != PurchaseOrderStatusKind.Processing.Value && - order.status != PurchaseOrderStatusKind.Refused.Value; + order.status != PurchaseOrderStatusKind.Refused.Value && + order.status != PurchaseOrderStatusKind.Expired.Value; @@ -87,7 +89,21 @@ {isLoading} loadingMessage="Récupération des informations de votre commande en cours... veuillez patienter." > - {#if order.status == PurchaseOrderStatusKind.Cancelled.Value || order.status == PurchaseOrderStatusKind.Withdrawned.Value} + {#if order.status === PurchaseOrderStatusKind.Expired.Value} +
+

Commande expirée

+
+

La commande est expirée, vous ne pouvez plus interagir avec.

+ {#if order.reason} +

Raison : {order.reason}

+ {/if} +
+
+ {/if} + {#if order.status === PurchaseOrderStatusKind.Cancelled.Value || order.status == PurchaseOrderStatusKind.Withdrawned.Value}
{/if} - {#if order.status == PurchaseOrderStatusKind.Refused.Value} + {#if order.status === PurchaseOrderStatusKind.Refused.Value}
{/if} - {#if order.status == PurchaseOrderStatusKind.Shipping.Value} + {#if order.status === PurchaseOrderStatusKind.Shipping.Value}
{/if} - {#if order.status == PurchaseOrderStatusKind.Delivered.Value} + {#if order.status === PurchaseOrderStatusKind.Delivered.Value}
{/if} - {#if order.status !== PurchaseOrderStatusKind.Refused.Value && order.status !== PurchaseOrderStatusKind.Cancelled.Value && order.status !== PurchaseOrderStatusKind.Withdrawned.Value && order.status !== PurchaseOrderStatusKind.Delivered.Value && order.expectedDelivery.expectedDeliveryDate} + {#if order.status !== PurchaseOrderStatusKind.Refused.Value && order.status !== PurchaseOrderStatusKind.Cancelled.Value && order.status !== PurchaseOrderStatusKind.Withdrawned.Value && order.status !== PurchaseOrderStatusKind.Delivered.Value && order.status !== PurchaseOrderStatusKind.Expired.Value && order.expectedDelivery.expectedDeliveryDate}
{/if} - {#if order.status !== PurchaseOrderStatusKind.Cancelled.Value && order.status !== PurchaseOrderStatusKind.Withdrawned.Value && order.status !== PurchaseOrderStatusKind.Refused.Value} + {#if order.status !== PurchaseOrderStatusKind.Cancelled.Value && order.status !== PurchaseOrderStatusKind.Withdrawned.Value && order.status !== PurchaseOrderStatusKind.Refused.Value && order.status !== PurchaseOrderStatusKind.Expired.Value}
- {#if order.status == PurchaseOrderStatusKind.Waiting.Value}En attente{:else}Acceptée{/if} + {order.status === PurchaseOrderStatusKind.Waiting.Value ? "En attente" : "Acceptée"}
-
-
-

Annuler la commande

-
-

Vous pouvez annuler votre commande tant que celle-ci n'est pas en cours de préparation.

- + {#if canCancelOrder} +
+
+

Annuler la commande

+
+

Vous pouvez annuler votre commande tant que celle-ci n'est pas en cours de préparation.

+ +
-
+ {/if}