From 6916a2582210d5f9a36ba2556de3dbc2e47aba5e Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 1 Sep 2025 20:27:42 +0000 Subject: [PATCH] Limit pending orders displayed and add scrolling functionality Updates the dashboard to display only the last 4 pending orders and implements vertical scrolling for the pending orders section within `Dashboard.tsx`. 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 463854a..b4e5692 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -225,14 +225,15 @@ export default function Dashboard() { }) .slice(0, 4) : []; // Afficher les 4 dernières commandes - // Toutes les commandes en attente (peu importe la date) + // Les 4 dernières 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 const upcomingDeliveries = Array.isArray(allDeliveries) ? allDeliveries .filter((d: any) => { @@ -453,7 +454,7 @@ export default function Dashboard() { )} - + {pendingOrders.length > 0 ? pendingOrders.map((order: any) => { // Calculer le nombre de jours en attente const orderDate = safeDate(order.createdAt);