Remove informational comment types from the reconciliation system

Remove the 'info' comment type and its associated UI elements, icons, and default values across the client and shared schema.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 95e8aab4-f39f-4b48-aa57-a759ec15ba3d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/95e8aab4-f39f-4b48-aa57-a759ec15ba3d/i5ZCBt1
This commit is contained in:
michaelschal committed 2025-09-10 09:26:57 +00:00
1 parent dd0a8ca702
commit edbf082c8d
3 files changed
+13 -16

No files matched your search

@@ -10,7 +10,7 @@ import { Textarea } from "@/components/ui/textarea";
import { useToast } from "@/hooks/use-toast"; import { useToast } from "@/hooks/use-toast";
import { apiRequest } from "@/lib/queryClient"; import { apiRequest } from "@/lib/queryClient";
import { safeFormat } from "@/lib/dateUtils"; 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 { interface ReconciliationCommentsProps {
deliveryId: number; deliveryId: number;
@@ -20,7 +20,7 @@ interface ReconciliationCommentsProps {
interface ReconciliationComment { interface ReconciliationComment {
id: number; id: number;
content: string; content: string;
type: 'info' | 'warning' | 'error' | 'success'; type: 'warning' | 'error' | 'success';
deliveryId: number; deliveryId: number;
authorId: string; authorId: string;
groupId: number; groupId: number;
@@ -34,21 +34,18 @@ interface ReconciliationComment {
} }
const typeColors = { const typeColors = {
info: "bg-blue-50 border-blue-200 text-blue-800",
warning: "bg-yellow-50 border-yellow-200 text-yellow-800", warning: "bg-yellow-50 border-yellow-200 text-yellow-800",
error: "bg-red-50 border-red-200 text-red-800", error: "bg-red-50 border-red-200 text-red-800",
success: "bg-green-50 border-green-200 text-green-800", success: "bg-green-50 border-green-200 text-green-800",
}; };
const typeIcons = { const typeIcons = {
info: Info,
warning: AlertTriangle, warning: AlertTriangle,
error: AlertCircle, error: AlertCircle,
success: CheckCircle, success: CheckCircle,
}; };
const typeLabels = { const typeLabels = {
info: "Information",
warning: "Attention", warning: "Attention",
error: "Erreur", error: "Erreur",
success: "Succès", success: "Succès",
@@ -62,17 +59,17 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
const [editingId, setEditingId] = useState<number | null>(null); const [editingId, setEditingId] = useState<number | null>(null);
const [newComment, setNewComment] = useState<{ const [newComment, setNewComment] = useState<{
content: string; content: string;
type: 'info' | 'warning' | 'error' | 'success'; type: 'warning' | 'error' | 'success';
}>({ }>({
content: "", content: "",
type: "info", type: "warning",
}); });
const [editComment, setEditComment] = useState<{ const [editComment, setEditComment] = useState<{
content: string; content: string;
type: 'info' | 'warning' | 'error' | 'success'; type: 'warning' | 'error' | 'success';
}>({ }>({
content: "", content: "",
type: "info", type: "warning",
}); });
// Récupérer les commentaires // Récupérer les commentaires
@@ -94,7 +91,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
}); });
queryClient.invalidateQueries({ queryKey: [`/api/deliveries/${deliveryId}/reconciliation-comments`] }); queryClient.invalidateQueries({ queryKey: [`/api/deliveries/${deliveryId}/reconciliation-comments`] });
setIsAdding(false); setIsAdding(false);
setNewComment({ content: "", type: "info" }); setNewComment({ content: "", type: "warning" });
}, },
onError: (error: any) => { onError: (error: any) => {
toast({ toast({
@@ -174,7 +171,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
const handleCancelEdit = () => { const handleCancelEdit = () => {
setEditingId(null); setEditingId(null);
setEditComment({ content: "", type: "info" }); setEditComment({ content: "", type: "warning" });
}; };
const handleDeleteComment = (id: number) => { const handleDeleteComment = (id: number) => {
@@ -235,7 +232,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="info">Information</SelectItem>
<SelectItem value="warning">Attention</SelectItem> <SelectItem value="warning">Attention</SelectItem>
<SelectItem value="error">Erreur</SelectItem> <SelectItem value="error">Erreur</SelectItem>
<SelectItem value="success">Succès</SelectItem> <SelectItem value="success">Succès</SelectItem>
@@ -261,7 +258,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
size="sm" size="sm"
onClick={() => { onClick={() => {
setIsAdding(false); setIsAdding(false);
setNewComment({ content: "", type: "info" }); setNewComment({ content: "", type: "warning" });
}} }}
> >
<X className="w-4 h-4 mr-1" /> <X className="w-4 h-4 mr-1" />
@@ -308,7 +305,7 @@ export default function ReconciliationComments({ deliveryId, className = "" }: R
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
<SelectItem value="info">Information</SelectItem>
<SelectItem value="warning">Attention</SelectItem> <SelectItem value="warning">Attention</SelectItem>
<SelectItem value="error">Erreur</SelectItem> <SelectItem value="error">Erreur</SelectItem>
<SelectItem value="success">Succès</SelectItem> <SelectItem value="success">Succès</SelectItem>
+1 -1
View File
@@ -148,7 +148,7 @@ export default function BLReconciliation() {
mutationFn: async ({ deliveryId, content }: { deliveryId: number; content: string }) => { mutationFn: async ({ deliveryId, content }: { deliveryId: number; content: string }) => {
const response = await apiRequest(`/api/deliveries/${deliveryId}/reconciliation-comments`, 'POST', { const response = await apiRequest(`/api/deliveries/${deliveryId}/reconciliation-comments`, 'POST', {
content, content,
type: 'info' type: 'warning'
}); });
return response; return response;
}, },
+1 -1
View File
@@ -183,7 +183,7 @@ export const reconciliationComments = pgTable("reconciliation_comments", {
deliveryId: integer("delivery_id").notNull(), // Référence vers la livraison concernée deliveryId: integer("delivery_id").notNull(), // Référence vers la livraison concernée
groupId: integer("group_id").notNull(), // Magasin/groupe pour filtrage groupId: integer("group_id").notNull(), // Magasin/groupe pour filtrage
content: text("content").notNull(), // Contenu du commentaire 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 authorId: varchar("author_id").notNull(), // Utilisateur auteur du commentaire
createdAt: timestamp("created_at").defaultNow(), createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(), updatedAt: timestamp("updated_at").defaultNow(),