{adminItems.map((item) => {
if (!hasPermission(item.roles)) return null;
diff --git a/client/src/index.css b/client/src/index.css
index 9696545..3327907 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -126,30 +126,30 @@
background-color: var(--accent);
}
- /* Responsive utilities */
+ /* Responsive utilities - Optimisé pour grand écran */
.container-responsive {
- @apply w-full mx-auto px-4 sm:px-6 lg:px-8;
- max-width: 1400px;
+ @apply w-full mx-auto px-4 sm:px-6 lg:px-8 xl:px-12;
+ max-width: none; /* Utilise toute la largeur disponible */
}
.grid-responsive {
- @apply grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4;
+ @apply grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5;
}
.card-responsive {
- @apply bg-card border border-border rounded-lg shadow-sm hover:shadow-md transition-shadow p-4 sm:p-6;
+ @apply bg-card border border-border rounded-xl shadow-sm hover:shadow-lg transition-all p-6 sm:p-8;
}
.text-responsive-sm {
- @apply text-sm sm:text-base;
+ @apply text-base sm:text-lg lg:text-xl;
}
.text-responsive-lg {
- @apply text-lg sm:text-xl lg:text-2xl;
+ @apply text-xl sm:text-2xl lg:text-3xl xl:text-4xl;
}
.sidebar-width {
- @apply w-16 lg:w-64;
+ @apply w-16 lg:w-72 xl:w-80;
}
.sidebar-collapsed {
@@ -157,12 +157,25 @@
}
.main-content {
- @apply flex-1 flex flex-col overflow-hidden ml-16 lg:ml-64;
+ @apply flex-1 flex flex-col overflow-hidden ml-16 lg:ml-72 xl:ml-80;
}
.main-content-expanded {
@apply ml-16;
}
+
+ /* Utilitaires pour grand écran */
+ .desktop-padding {
+ @apply p-8 xl:p-12;
+ }
+
+ .desktop-text {
+ @apply text-lg xl:text-xl;
+ }
+
+ .desktop-spacing {
+ @apply space-y-8 xl:space-y-12;
+ }
}
/* Supprimer le contour orange de la date du jour dans le calendrier */
diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx
index 9b9dc7a..f56d0ff 100644
--- a/client/src/pages/Dashboard.tsx
+++ b/client/src/pages/Dashboard.tsx
@@ -138,7 +138,7 @@ export default function Dashboard() {
const deliveredThisMonth = Array.isArray(allDeliveries) ? allDeliveries.filter((delivery: any) => {
const deliveryDate = safeDate(delivery.deliveredDate || delivery.createdAt);
const now = new Date();
- return deliveryDate.getMonth() === now.getMonth() &&
+ return deliveryDate && deliveryDate.getMonth() === now.getMonth() &&
deliveryDate.getFullYear() === now.getFullYear() &&
delivery.status === 'delivered';
}).length : 0;
@@ -148,7 +148,7 @@ export default function Dashboard() {
if (delivery.status === 'delivered' && delivery.unit === 'palettes') {
const deliveryDate = safeDate(delivery.deliveredDate || delivery.createdAt);
const now = new Date();
- if (deliveryDate.getMonth() === now.getMonth() && deliveryDate.getFullYear() === now.getFullYear()) {
+ if (deliveryDate && deliveryDate.getMonth() === now.getMonth() && deliveryDate.getFullYear() === now.getFullYear()) {
return total + (delivery.quantity || 0);
}
}
@@ -403,7 +403,7 @@ export default function Dashboard() {
.slice(0, 3)
.map((publicity: any) => {
const participatingStores = publicity.participations || [];
- const isCurrentStoreParticipating = selectedStoreId && participatingStores.some((p: any) => p.groupId === parseInt(selectedStoreId));
+ const isCurrentStoreParticipating = selectedStoreId && participatingStores.some((p: any) => p.groupId === parseInt(selectedStoreId.toString()));
return (
@@ -436,7 +436,7 @@ export default function Dashboard() {
) : (
-
-
-
-
-
+
+
+
+
|
Fournisseur
@@ -367,8 +368,8 @@ export default function Deliveries() {
Actions
|
-
-
+
+
{paginatedDeliveries.map((delivery) => (
|
@@ -466,21 +467,20 @@ export default function Deliveries() {
|
))}
-
-
-
-
- {/* Pagination */}
-
+
+
+
+ {/* Pagination */}
+
)}
diff --git a/client/src/pages/Orders.tsx b/client/src/pages/Orders.tsx
index f4f18d4..9f45a96 100644
--- a/client/src/pages/Orders.tsx
+++ b/client/src/pages/Orders.tsx
@@ -27,6 +27,7 @@ import CreateOrderModal from "@/components/modals/CreateOrderModal";
import EditOrderModal from "@/components/modals/EditOrderModal";
import OrderDetailModal from "@/components/modals/OrderDetailModal";
import ConfirmDeleteModal from "@/components/modals/ConfirmDeleteModal";
+import { usePermissions } from "@shared/permissions";
import type { OrderWithRelations } from "@shared/schema";
export default function Orders() {
@@ -34,6 +35,7 @@ export default function Orders() {
const { selectedStoreId } = useStore();
const { toast } = useToast();
const queryClient = useQueryClient();
+ const permissions = usePermissions(user?.role);
// Redirection pour les employés
if (user?.role === 'employee') {
@@ -285,7 +287,7 @@ export default function Orders() {
- ) : (console.log('📦 Filtered orders length:', filteredOrders.length) || filteredOrders.length === 0) ? (
+ ) : filteredOrders.length === 0 ? (
Aucune commande trouvée
@@ -305,11 +307,10 @@ export default function Orders() {
)}
) : (
-
-
-
-
-
+
+
+
+
|
Fournisseur
@@ -330,8 +331,8 @@ export default function Orders() {
Actions
|
-
-
+
+
{paginatedOrders.map((order) => (
|
@@ -404,21 +405,20 @@ export default function Orders() {
|
))}
-
-
-
-
- {/* Pagination */}
-
+
+
+
+ {/* Pagination */}
+
)}