diff --git a/attached_assets/{65A983CD-16E6-46F2-8B11-458B0C27D0A1}_1755597404312.png b/attached_assets/{65A983CD-16E6-46F2-8B11-458B0C27D0A1}_1755597404312.png new file mode 100644 index 0000000..169ee75 Binary files /dev/null and b/attached_assets/{65A983CD-16E6-46F2-8B11-458B0C27D0A1}_1755597404312.png differ diff --git a/client/src/components/tasks/TaskForm.tsx b/client/src/components/tasks/TaskForm.tsx index 7c37f16..f89ebed 100644 --- a/client/src/components/tasks/TaskForm.tsx +++ b/client/src/components/tasks/TaskForm.tsx @@ -1,2 +1,2 @@ -// Version ULTRA PROPRE pour production - ZÉRO dépendance externe -export { default } from "./TaskFormProduction"; \ No newline at end of file +// Version ULTRA SIMPLE - HTML pur sans dépendances UI +export { default } from "./TaskFormUltraSimple"; \ No newline at end of file diff --git a/client/src/components/tasks/TaskFormUltraSimple.tsx b/client/src/components/tasks/TaskFormUltraSimple.tsx new file mode 100644 index 0000000..3ae2ee4 --- /dev/null +++ b/client/src/components/tasks/TaskFormUltraSimple.tsx @@ -0,0 +1,264 @@ +// VERSION ULTRA SIMPLE - HTML pur sans dépendances UI +export default function TaskFormUltraSimple({ task, onClose }: any) { + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + const formData = new FormData(e.currentTarget); + const title = formData.get('title') as string; + const description = formData.get('description') as string; + const priority = formData.get('priority') as string; + const status = formData.get('status') as string; + const assignedTo = formData.get('assignedTo') as string; + const startDate = formData.get('startDate') as string; + const dueDate = formData.get('dueDate') as string; + + if (!title?.trim()) { + alert("Le titre est requis"); + return; + } + + if (!assignedTo?.trim()) { + alert("L'assignation est requise"); + return; + } + + const submitBtn = e.currentTarget.querySelector('button[type="submit"]') as HTMLButtonElement; + submitBtn.disabled = true; + submitBtn.textContent = "..."; + + try { + const taskData = { + title: title.trim(), + description: description?.trim() || "", + priority: priority || "medium", + status: status || "pending", + assignedTo: assignedTo.trim(), + startDate: startDate || null, + dueDate: dueDate || null, + }; + + const url = task ? `/api/tasks/${task.id}` : '/api/tasks'; + const method = task ? 'PATCH' : 'POST'; + + if (!task) { + (taskData as any).groupId = 1; + (taskData as any).createdBy = 'admin'; + } + + const response = await fetch(url, { + method, + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(taskData), + }); + + if (!response.ok) throw new Error(`Erreur ${response.status}`); + + alert(task ? "Tâche modifiée avec succès" : "Tâche créée avec succès"); + window.location.reload(); + + } catch (error) { + console.error('Erreur:', error); + alert("Erreur lors de l'opération"); + submitBtn.disabled = false; + submitBtn.textContent = task ? "Modifier" : "Créer"; + } + }; + + return ( +
+
+

+ 📅 Date de début = Quand la tâche devient visible
+ ⏰ Date d'échéance = Quand la tâche doit être terminée +

+ +
+ +
+
+ + +
+ +
+ +