mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Make task assignment optional and improve task creation flow
Update task forms to remove the required field for assignment, allowing tasks to be created without an assignee and setting a default "Non assigné" value. This addresses an issue where task creation was blocked due to a mandatory assignment field. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6 Replit-Commit-Checkpoint-Type: full_checkpoint
This commit is contained in:
1 parent
e95723fd5c
commit
f2013cd616
4 files changed
+7
-22
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 176 KiB |
@@ -18,10 +18,6 @@ export default function TaskFormUltraSimple({ task, onClose }: any) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!assignedTo?.trim()) {
|
||||
alert("L'assignation est requise");
|
||||
return;
|
||||
}
|
||||
|
||||
const submitBtn = e.currentTarget.querySelector('button[type="submit"]') as HTMLButtonElement;
|
||||
submitBtn.disabled = true;
|
||||
@@ -33,7 +29,7 @@ export default function TaskFormUltraSimple({ task, onClose }: any) {
|
||||
description: description?.trim() || "",
|
||||
priority: priority || "medium",
|
||||
status: status || "pending",
|
||||
assignedTo: assignedTo.trim(),
|
||||
assignedTo: assignedTo?.trim() || "Non assigné",
|
||||
startDate: startDate || null,
|
||||
dueDate: dueDate || null,
|
||||
};
|
||||
@@ -212,14 +208,13 @@ export default function TaskFormUltraSimple({ task, onClose }: any) {
|
||||
|
||||
<div>
|
||||
<label style={{ display: 'block', fontSize: '14px', fontWeight: '500', marginBottom: '8px' }}>
|
||||
Assigné à *
|
||||
Assigné à <span style={{ fontSize: '12px', color: '#6b7280' }}>(optionnel)</span>
|
||||
</label>
|
||||
<input
|
||||
name="assignedTo"
|
||||
type="text"
|
||||
defaultValue={task?.assignedTo || "admin"}
|
||||
placeholder="Nom de la personne assignée"
|
||||
required
|
||||
style={{
|
||||
width: '100%',
|
||||
padding: '8px 12px',
|
||||
|
||||
@@ -62,14 +62,6 @@ function TaskFormInline({ task, onClose, selectedStoreId, user }: any) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!assignedTo?.trim()) {
|
||||
toast({
|
||||
title: "Erreur",
|
||||
description: "L'assignation est requise",
|
||||
variant: "destructive",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const submitBtn = e.currentTarget.querySelector('button[type="submit"]') as HTMLButtonElement;
|
||||
submitBtn.disabled = true;
|
||||
@@ -81,7 +73,7 @@ function TaskFormInline({ task, onClose, selectedStoreId, user }: any) {
|
||||
description: description?.trim() || "",
|
||||
priority: priority || "medium",
|
||||
status: status || "pending",
|
||||
assignedTo: assignedTo.trim(),
|
||||
assignedTo: assignedTo?.trim() || "Non assigné",
|
||||
startDate: startDate || null,
|
||||
dueDate: dueDate || null,
|
||||
};
|
||||
@@ -263,14 +255,13 @@ function TaskFormInline({ task, onClose, selectedStoreId, user }: any) {
|
||||
|
||||
<div>
|
||||
<label style={{ display: 'block', fontSize: '14px', fontWeight: '500', marginBottom: '8px' }}>
|
||||
Assigné à *
|
||||
Assigné à <span style={{ fontSize: '12px', color: '#6b7280' }}>(optionnel)</span>
|
||||
</label>
|
||||
<input
|
||||
name="assignedTo"
|
||||
type="text"
|
||||
defaultValue={task?.assignedTo || ""}
|
||||
placeholder="Nom de la personne assignée"
|
||||
required
|
||||
style={{
|
||||
width: '100%',
|
||||
padding: '8px 12px',
|
||||
|
||||
@@ -399,14 +399,14 @@ function TaskForm({ onSubmit, initialData, isEditing = false }: {
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (!title.trim() || !assignedTo.trim()) {
|
||||
if (!title.trim()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const taskData = {
|
||||
title: title.trim(),
|
||||
description: description.trim() || undefined,
|
||||
assignedTo: assignedTo.trim(),
|
||||
assignedTo: assignedTo?.trim() || "Non assigné",
|
||||
priority,
|
||||
dueDate: dueDate ? new Date(dueDate).toISOString() : undefined,
|
||||
};
|
||||
@@ -445,14 +445,13 @@ function TaskForm({ onSubmit, initialData, isEditing = false }: {
|
||||
|
||||
<div>
|
||||
<label htmlFor="assignedTo" className="block text-sm font-medium mb-1">
|
||||
Assigné à *
|
||||
Assigné à <span className="text-xs text-gray-500">(optionnel)</span>
|
||||
</label>
|
||||
<Input
|
||||
id="assignedTo"
|
||||
value={assignedTo}
|
||||
onChange={(e) => setAssignedTo(e.target.value)}
|
||||
placeholder="Nom de la personne responsable"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user