From 6f114499fe1fac53404709fd2d728a5de41e128a Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Thu, 11 Sep 2025 12:34:41 +0000 Subject: [PATCH] Remove client call notifications from the main orders page Removes the client call notification component and related data fetching from the Orders page, addressing a bug where these notifications were incorrectly displayed. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 818c4995-85cc-4d53-8067-b67dcee52c2d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/818c4995-85cc-4d53-8067-b67dcee52c2d/ac4X8UH --- .replit | 8 +++---- client/src/pages/Orders.tsx | 43 +------------------------------------ 2 files changed, 5 insertions(+), 46 deletions(-) diff --git a/.replit b/.replit index a9cbb23..ff19827 100644 --- a/.replit +++ b/.replit @@ -15,10 +15,6 @@ run = ["npm", "run", "start"] localPort = 5000 externalPort = 80 -[[ports]] -localPort = 34895 -externalPort = 3000 - [[ports]] localPort = 38451 externalPort = 3002 @@ -27,6 +23,10 @@ externalPort = 3002 localPort = 41343 externalPort = 3001 +[[ports]] +localPort = 45571 +externalPort = 3000 + [workflows] runButton = "Project" diff --git a/client/src/pages/Orders.tsx b/client/src/pages/Orders.tsx index 734423a..1311322 100644 --- a/client/src/pages/Orders.tsx +++ b/client/src/pages/Orders.tsx @@ -3,7 +3,6 @@ import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; -import { Alert, AlertDescription } from "@/components/ui/alert"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Pagination, usePagination } from "@/components/ui/pagination"; import { useAuthUnified } from "@/hooks/useAuthUnified"; @@ -23,15 +22,13 @@ import { Trash2, Building, User, - Phone } from "lucide-react"; import { safeFormat } from "@/lib/dateUtils"; 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 ClientCallsModal from "@/components/modals/ClientCallsModal"; -import type { OrderWithRelations, CustomerOrderWithRelations } from "@shared/schema"; +import type { OrderWithRelations } from "@shared/schema"; export default function Orders() { const { user } = useAuthUnified(); @@ -68,7 +65,6 @@ export default function Orders() { const [showEditModal, setShowEditModal] = useState(false); const [showDetailModal, setShowDetailModal] = useState(false); const [showDeleteModal, setShowDeleteModal] = useState(false); - const [showClientCallsModal, setShowClientCallsModal] = useState(false); const [selectedOrder, setSelectedOrder] = useState(null); const [orderToDelete, setOrderToDelete] = useState(null); @@ -76,21 +72,6 @@ export default function Orders() { // CRITICAL FIX: Appliquer le filtrage par storeId pour TOUS les rôles, pas seulement admin const ordersUrl = `/api/orders${selectedStoreId ? `?storeId=${selectedStoreId}` : ''}`; - // Query pour les appels clients en attente - const pendingCallsUrl = `/api/customer-orders/pending-calls${selectedStoreId ? `?storeId=${selectedStoreId}` : ''}`; - const { data: pendingCalls = [], isLoading: isPendingCallsLoading } = useQuery({ - queryKey: [pendingCallsUrl, selectedStoreId], - queryFn: async () => { - const response = await fetch(pendingCallsUrl, { credentials: 'include' }); - if (!response.ok) { - throw new Error('Failed to fetch pending calls'); - } - const data = await response.json(); - console.log('📞 Pending calls received:', Array.isArray(data) ? data.length : 'NOT_ARRAY', 'items'); - return data; - }, - refetchInterval: 30000, // Refetch every 30 seconds - }); const { data: ordersData = [], isLoading } = useQuery({ queryKey: [ordersUrl, selectedStoreId], @@ -272,22 +253,6 @@ export default function Orders() { - {/* Alerte pour les appels clients en attente */} - {!isPendingCallsLoading && pendingCalls.length > 0 && ( - setShowClientCallsModal(true)} - data-testid="alert-client-calls" - > - - - 📞 {pendingCalls.length} client{pendingCalls.length > 1 ? 's' : ''} à appeler - - Produits disponibles - Cliquez pour voir la liste des clients à contacter - - - - )} {/* Filters */}
@@ -503,12 +468,6 @@ export default function Orders() { isLoading={deleteMutation.isPending} /> - {/* Modal pour les appels clients */} - setShowClientCallsModal(false)} - pendingCalls={pendingCalls} - />
); }