diff --git a/client/src/components/ReconciliationComments.tsx b/client/src/components/ReconciliationComments.tsx index 9ed7b66..78d2c92 100644 --- a/client/src/components/ReconciliationComments.tsx +++ b/client/src/components/ReconciliationComments.tsx @@ -10,7 +10,7 @@ import { Textarea } from "@/components/ui/textarea"; import { useToast } from "@/hooks/use-toast"; import { apiRequest } from "@/lib/queryClient"; import { safeFormat } from "@/lib/dateUtils"; -import { MessageSquare, Plus, Edit2, Trash2, Save, X, AlertCircle, Info, CheckCircle, AlertTriangle } from "lucide-react"; +import { MessageSquare, Plus, Edit2, Trash2, Save, X, AlertCircle, CheckCircle, AlertTriangle } from "lucide-react"; interface ReconciliationCommentsProps { deliveryId: number; @@ -20,7 +20,7 @@ interface ReconciliationCommentsProps { interface ReconciliationComment { id: number; content: string; - type: 'info' | 'warning' | 'error' | 'success'; + type: 'warning' | 'error' | 'success'; deliveryId: number; authorId: string; groupId: number; @@ -34,21 +34,18 @@ interface ReconciliationComment { } const typeColors = { - info: "bg-blue-50 border-blue-200 text-blue-800", warning: "bg-yellow-50 border-yellow-200 text-yellow-800", error: "bg-red-50 border-red-200 text-red-800", success: "bg-green-50 border-green-200 text-green-800", }; const typeIcons = { - info: Info, warning: AlertTriangle, error: AlertCircle, success: CheckCircle, }; const typeLabels = { - info: "Information", warning: "Attention", error: "Erreur", success: "Succès", @@ -62,17 +59,17 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R const [editingId, setEditingId] = useState(null); const [newComment, setNewComment] = useState<{ content: string; - type: 'info' | 'warning' | 'error' | 'success'; + type: 'warning' | 'error' | 'success'; }>({ content: "", - type: "info", + type: "warning", }); const [editComment, setEditComment] = useState<{ content: string; - type: 'info' | 'warning' | 'error' | 'success'; + type: 'warning' | 'error' | 'success'; }>({ content: "", - type: "info", + type: "warning", }); // Récupérer les commentaires @@ -94,7 +91,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R }); queryClient.invalidateQueries({ queryKey: [`/api/deliveries/${deliveryId}/reconciliation-comments`] }); setIsAdding(false); - setNewComment({ content: "", type: "info" }); + setNewComment({ content: "", type: "warning" }); }, onError: (error: any) => { toast({ @@ -174,7 +171,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R const handleCancelEdit = () => { setEditingId(null); - setEditComment({ content: "", type: "info" }); + setEditComment({ content: "", type: "warning" }); }; const handleDeleteComment = (id: number) => { @@ -235,7 +232,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R - Information + Attention Erreur Succès @@ -261,7 +258,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R size="sm" onClick={() => { setIsAdding(false); - setNewComment({ content: "", type: "info" }); + setNewComment({ content: "", type: "warning" }); }} > @@ -308,7 +305,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R - Information + Attention Erreur Succès diff --git a/client/src/pages/BLReconciliation.tsx b/client/src/pages/BLReconciliation.tsx index bc82ee8..d23d765 100644 --- a/client/src/pages/BLReconciliation.tsx +++ b/client/src/pages/BLReconciliation.tsx @@ -148,7 +148,7 @@ export default function BLReconciliation() { mutationFn: async ({ deliveryId, content }: { deliveryId: number; content: string }) => { const response = await apiRequest(`/api/deliveries/${deliveryId}/reconciliation-comments`, 'POST', { content, - type: 'info' + type: 'warning' }); return response; }, diff --git a/shared/schema.ts b/shared/schema.ts index ce3fbdf..65ee1e1 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -183,7 +183,7 @@ export const reconciliationComments = pgTable("reconciliation_comments", { deliveryId: integer("delivery_id").notNull(), // Référence vers la livraison concernée groupId: integer("group_id").notNull(), // Magasin/groupe pour filtrage content: text("content").notNull(), // Contenu du commentaire - type: varchar("type", { length: 50 }).notNull().default("info"), // info, warning, error, success + type: varchar("type", { length: 50 }).notNull().default("warning"), // warning, error, success authorId: varchar("author_id").notNull(), // Utilisateur auteur du commentaire createdAt: timestamp("created_at").defaultNow(), updatedAt: timestamp("updated_at").defaultNow(),