mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-16 19:56:32 +02:00
Improve task feedback and show scheduled tasks to directors
Replace alerts with toast notifications for task operations and grant directors visibility into scheduled tasks, previously only visible to admins. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/IUKNI3f
This commit is contained in:
1 parent
90480201ee
commit
f407cdceb7
2 files changed
+38
-7
No files matched your search
@@ -40,6 +40,7 @@ type TaskWithRelations = Task & {
|
||||
|
||||
// Composant TaskForm inline - Version production ultra-simple
|
||||
function TaskFormInline({ task, onClose }: any) {
|
||||
const { toast } = useToast();
|
||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -53,12 +54,20 @@ function TaskFormInline({ task, onClose }: any) {
|
||||
const dueDate = formData.get('dueDate') as string;
|
||||
|
||||
if (!title?.trim()) {
|
||||
alert("Le titre est requis");
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: "Le titre est requis",
|
||||
variant: "destructive",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!assignedTo?.trim()) {
|
||||
alert("L'assignation est requise");
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: "L'assignation est requise",
|
||||
variant: "destructive",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,12 +110,19 @@ function TaskFormInline({ task, onClose }: any) {
|
||||
throw new Error(`Erreur ${response.status}: ${errorText}`);
|
||||
}
|
||||
|
||||
alert(task ? "Tâche modifiée avec succès" : "Tâche créée avec succès");
|
||||
toast({
|
||||
title: "Succès",
|
||||
description: 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");
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: "Erreur lors de l'opération",
|
||||
variant: "destructive",
|
||||
});
|
||||
submitBtn.disabled = false;
|
||||
submitBtn.textContent = task ? "Modifier" : "Créer";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user