diff --git a/components/forms/EditTaskForm.tsx b/components/forms/EditTaskForm.tsx index 0ad1b89..5e2066b 100644 --- a/components/forms/EditTaskForm.tsx +++ b/components/forms/EditTaskForm.tsx @@ -6,7 +6,9 @@ import { Button } from '@/components/ui/Button'; import { Input } from '@/components/ui/Input'; import { TagInput } from '@/components/ui/TagInput'; import { RelatedTodos } from '@/components/forms/RelatedTodos'; +import { Badge } from '@/components/ui/Badge'; import { Task, TaskPriority, TaskStatus } from '@/lib/types'; +import { useUserPreferences } from '@/contexts/UserPreferencesContext'; // UpdateTaskData removed - using Server Actions directly import { getAllStatuses, getAllPriorities } from '@/lib/status-config'; @@ -19,6 +21,7 @@ interface EditTaskFormProps { } export function EditTaskForm({ isOpen, onClose, onSubmit, task, loading = false }: EditTaskFormProps) { + const { preferences } = useUserPreferences(); const [formData, setFormData] = useState<{ title: string; description: string; @@ -37,6 +40,13 @@ export function EditTaskForm({ isOpen, onClose, onSubmit, task, loading = false const [errors, setErrors] = useState>({}); + // Helper pour construire l'URL Jira + const getJiraTicketUrl = (jiraKey: string): string => { + const baseUrl = preferences.jiraConfig.baseUrl; + if (!baseUrl || !jiraKey) return ''; + return `${baseUrl}/browse/${jiraKey}`; + }; + // Pré-remplir le formulaire quand la tâche change useEffect(() => { if (task) { @@ -179,6 +189,50 @@ export function EditTaskForm({ isOpen, onClose, onSubmit, task, loading = false disabled={loading} /> + {/* Informations Jira */} + {task.source === 'jira' && task.jiraKey && ( +
+ + +
+ {preferences.jiraConfig.baseUrl ? ( + + + {task.jiraKey} + + + ) : ( + + {task.jiraKey} + + )} + + {task.jiraProject && ( + + {task.jiraProject} + + )} + + {task.jiraType && ( + + {task.jiraType} + + )} +
+
+ )} + {/* Tags */}