From 68bab7890902a69898e2989323d674cba3124e09 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 1 Sep 2025 20:31:50 +0000 Subject: [PATCH 1/4] Display all pending orders instead of limiting to the last four Modify the Dashboard component to display all pending orders rather than a limited subset of the last four. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 98f01874-e00c-4bbe-9d71-b0b338001848 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/98f01874-e00c-4bbe-9d71-b0b338001848/XDIQsDu --- client/src/pages/Dashboard.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index b4e5692..9e1dc7b 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -225,15 +225,14 @@ export default function Dashboard() { }) .slice(0, 4) : []; // Afficher les 4 dernières commandes - // Les 4 dernières commandes en attente + // Toutes les commandes en attente const pendingOrders = Array.isArray(allOrders) ? allOrders .filter((order: any) => order.status === 'pending') .sort((a: any, b: any) => { const dateA = safeDate(a.createdAt); const dateB = safeDate(b.createdAt); return (dateB ? dateB.getTime() : 0) - (dateA ? dateA.getTime() : 0); - }) - .slice(0, 4) : []; // Afficher les 4 dernières commandes en attente + }) : []; // Afficher toutes les commandes en attente const upcomingDeliveries = Array.isArray(allDeliveries) ? allDeliveries .filter((d: any) => { From 1888b700a41c44e1b5da20a2c89c606fbf74f0d7 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 1 Sep 2025 20:32:37 +0000 Subject: [PATCH 2/4] Remove the display of pending orders from the dashboard view Removes the UI component responsible for displaying the count of pending orders on the main dashboard page. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 98f01874-e00c-4bbe-9d71-b0b338001848 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/98f01874-e00c-4bbe-9d71-b0b338001848/XDIQsDu --- client/src/pages/Dashboard.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 9e1dc7b..3890215 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -395,19 +395,6 @@ export default function Dashboard() { - - -
-
-

Commandes en attente

-

{pendingOrdersCount}

-
-
- -
-
-
-
From beed32daea353c339236e758f4443c45451a2af2 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 1 Sep 2025 20:33:47 +0000 Subject: [PATCH 3/4] Restore pending orders card and display count Restores the pending orders card to the dashboard, displaying the count of pending orders and refactors the display of individual pending orders to remove overdue status and highlight them with an orange border. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 98f01874-e00c-4bbe-9d71-b0b338001848 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/98f01874-e00c-4bbe-9d71-b0b338001848/XDIQsDu --- client/src/pages/Dashboard.tsx | 59 +++++++++++++++++----------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 3890215..50072ac 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -395,6 +395,19 @@ export default function Dashboard() { + + +
+
+

Commandes en attente

+

{pendingOrdersCount}

+
+
+ +
+
+
+
@@ -441,37 +454,25 @@ export default function Dashboard() { - {pendingOrders.length > 0 ? pendingOrders.map((order: any) => { - // Calculer le nombre de jours en attente - const orderDate = safeDate(order.createdAt); - const daysPending = orderDate ? Math.floor((new Date().getTime() - orderDate.getTime()) / (1000 * 60 * 60 * 24)) : 0; - const isOverdue = daysPending > 10; - - return ( -
-
-
-
-

{order.supplier?.name}

-

{order.group?.name}

-
-
-
- - {daysPending} jour{daysPending > 1 ? 's' : ''} - -

- {safeFormat(order.plannedDate, "d MMM")} -

+ {pendingOrders.length > 0 ? pendingOrders.map((order: any) => ( +
+
+
+
+

{order.supplier?.name}

+

{order.group?.name}

- ); - }) : ( +
+ + En attente + +

+ {safeFormat(order.plannedDate, "d MMM")} +

+
+
+ )) : (

Aucune commande en attente

)} From 38c48bd6f6bbff5721be03844b8f7a73a85ecfad Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 1 Sep 2025 20:35:37 +0000 Subject: [PATCH 4/4] Remove pending order notification and improve order alert styling Removes the top-level notification for pending orders and updates the styling for pending order alerts to use color-coded severity based on how long an order has been pending. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 98f01874-e00c-4bbe-9d71-b0b338001848 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/98f01874-e00c-4bbe-9d71-b0b338001848/XDIQsDu --- client/src/pages/Dashboard.tsx | 54 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 50072ac..040bfb3 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -351,14 +351,6 @@ export default function Dashboard() { {/* Alerts */}
- {pendingOrdersCount > 0 && ( -
- - - {pendingOrdersCount} commande(s) en attente nécessitent une planification - -
- )} {dlcStats.expiringSoon > 0 && (
@@ -454,25 +446,37 @@ export default function Dashboard() { - {pendingOrders.length > 0 ? pendingOrders.map((order: any) => ( -
-
-
-
-

{order.supplier?.name}

-

{order.group?.name}

+ {pendingOrders.length > 0 ? pendingOrders.map((order: any) => { + // Calculer le nombre de jours en attente + const orderDate = safeDate(order.createdAt); + const daysPending = orderDate ? Math.floor((new Date().getTime() - orderDate.getTime()) / (1000 * 60 * 60 * 24)) : 0; + const isOverdue = daysPending > 10; + + return ( +
+
+
+
+

{order.supplier?.name}

+

{order.group?.name}

+
+
+
+ + {daysPending} jour{daysPending > 1 ? 's' : ''} + +

+ {safeFormat(order.plannedDate, "d MMM")} +

-
- - En attente - -

- {safeFormat(order.plannedDate, "d MMM")} -

-
-
- )) : ( + ); + }) : (

Aucune commande en attente

)}