From 5e55b087405f5593d09e078ee68d99dedc0ab9e6 Mon Sep 17 00:00:00 2001
From: michaelschal <35957947-michaelschal@users.noreply.replit.com>
Date: Mon, 18 Aug 2025 14:48:02 +0000
Subject: [PATCH] Make daily order and delivery cards larger and more readable
Expand the size and improve the visual clarity of order and delivery cards in the calendar view, and update the delivery order modal to eliminate scrollbars for better usability.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/o69iJI6
---
client/src/components/CalendarGrid.tsx | 147 ++++++++++++++++---------
1 file changed, 94 insertions(+), 53 deletions(-)
diff --git a/client/src/components/CalendarGrid.tsx b/client/src/components/CalendarGrid.tsx
index c688cb6..4a34c45 100644
--- a/client/src/components/CalendarGrid.tsx
+++ b/client/src/components/CalendarGrid.tsx
@@ -38,20 +38,20 @@ function CalendarItem({ item, type, onItemClick }: { item: any, type: 'order' |
return (
{
e.stopPropagation();
onItemClick(item, 'order');
}}
- style={{marginBottom: '2px', display: 'block', width: '100%'}}
+ style={{marginBottom: '3px', display: 'block', width: '100%', minHeight: '24px'}}
>
-
+
{item.supplier?.name || 'Commande'}
-
+
{item.status === 'planned' && (
-
+
)}
{item.status === 'delivered' && (
@@ -76,20 +76,20 @@ function CalendarItem({ item, type, onItemClick }: { item: any, type: 'order' |
return (
{
e.stopPropagation();
onItemClick(item, 'delivery');
}}
- style={{marginBottom: '2px', display: 'block', width: '100%'}}
+ style={{marginBottom: '3px', display: 'block', width: '100%', minHeight: '24px'}}
>
-
+
{item.supplier?.name || 'Livraison'} - {formatQuantity(item.quantity, item.unit)}
-
+
{item.status === 'pending' && (
-
+
)}
{item.status === 'delivered' && (
@@ -118,7 +118,7 @@ function DayItemsContainer({ dayOrders, dayDeliveries, onItemClick }: { dayOrder
const hiddenCount = Math.max(0, totalItems - MAX_VISIBLE_ITEMS);
return (
-
+
{/* Éléments visibles - IDENTIQUE DEV/PROD */}
{visibleItems.map((item, index) => (
{
e.preventDefault();
@@ -150,51 +150,92 @@ function DayItemsContainer({ dayOrders, dayDeliveries, onItemClick }: { dayOrder
+{hiddenCount} autres
-
-
-
-
- Éléments du jour ({totalItems})
+
+
+
+
+ Éléments du jour - {totalItems} élément{totalItems > 1 ? 's' : ''}
-
-
- {allItems.map((item, index) => (
-
{
- e.preventDefault();
- e.stopPropagation();
- onItemClick(item, item.itemType);
- setIsOpen(false);
- }}
- >
-
-
- {item.supplier?.name || (item.itemType === 'order' ? 'Commande' : 'Livraison')}
-
- {item.itemType === 'delivery' && (
-
- Quantité: {item.quantity}{item.unit === 'palettes' ? 'P' : 'C'}
+
+
+
+ {allItems.map((item, index) => {
+ const isOrder = item.itemType === 'order';
+ const statusColor = item.status === 'delivered'
+ ? 'bg-gray-100 border-gray-300'
+ : item.status === 'planned'
+ ? 'bg-yellow-50 border-yellow-300'
+ : isOrder
+ ? 'bg-blue-50 border-blue-300'
+ : 'bg-green-50 border-green-300';
+
+ const statusText = item.status === 'delivered' ? 'Livré' :
+ item.status === 'planned' ? 'Planifié' : 'En attente';
+
+ const statusIcon = item.status === 'delivered'
+ ?
+ : item.status === 'planned'
+ ?
+ : isOrder
+ ?
+ :
;
+
+ return (
+
{
+ e.preventDefault();
+ e.stopPropagation();
+ onItemClick(item, item.itemType);
+ setIsOpen(false);
+ }}
+ >
+
+
+
+ {statusIcon}
+
+ {isOrder ? 'Commande' : 'Livraison'}
+
+
+ {statusText}
+
+
+
+
+ {item.supplier?.name || (isOrder ? 'Commande sans fournisseur' : 'Livraison sans fournisseur')}
+
+
+ {!isOrder && (
+
+ Quantité: {item.quantity} {item.unit === 'palettes' ? 'palette(s)' : 'colis'}
+
+ )}
+
+
+ Date: {
+ item.scheduledDate ? new Date(item.scheduledDate).toLocaleDateString('fr-FR') :
+ item.deliveredDate ? new Date(item.deliveredDate).toLocaleDateString('fr-FR') :
+ new Date(item.createdAt).toLocaleDateString('fr-FR')
+ }
+
+
+ {item.notes && (
+
+ Notes: {item.notes}
+
+ )}
- )}
-
- Statut: {item.status === 'delivered' ? 'Livré' : item.status === 'planned' ? 'Planifié' : 'En attente'}
-
- ))}
+ );
+ })}
@@ -474,7 +515,7 @@ export default function CalendarGrid({
{/* Orders and Deliveries - DEV = PRODUCTION */}
-