// Rôle : regroupe les panneaux secondaires d'une tâche du task planner. import { Icon } from "../../../components/Icon.jsx"; import { InlineNotice } from "../../../components/AppOverlays.jsx"; import { Tooltip } from "../../../components/Tooltip.jsx"; import { useInlineEdit } from "../../../hooks/useInlineEdit.js"; import { TaskPlannerQuantityTarget } from "./TaskPlannerQuantity.jsx"; import { WEEK_DAYS, getEffectiveTaskCategory, getTaskById, getTaskTitle } from "./taskPlannerUtils.js"; export function MissingPrerequisitesTooltip({ missingPrerequisites, tasks, textContent }) { return ( {textContent.missingPrerequisiteTitle || "Pré requis non effectué"} {missingPrerequisites.map((relation) => ( {getTaskTitle(tasks, relation.toTaskId)} ))} )} position="top-start" > {textContent.missingPrerequisiteBadge || "Pré requis"} ); } export function TaskPlannerItemDetails({ task, tasks, data, parentMap, parentId, textContent, descriptionOpen, settingsOpen, noticeMessage, relations, relationTargets, onUpdateTask, onAddLinkTarget, onRemoveLinkTarget, onSetPrerequisite, onSetTaskCategory }) { return ( <> {descriptionOpen && ( )} {settingsOpen && (
)} ); } function TaskDescriptionPanel({ task, tasks, parentMap, parentId, textContent, onUpdateTask, onSetTaskCategory }) { const parentTask = parentId ? getTaskById(tasks, parentId) : null; const inheritedCategory = parentTask ? getEffectiveTaskCategory(parentTask, tasks, parentMap) : ""; const categoryValue = parentTask ? inheritedCategory : task.category || ""; const categoryEditable = !parentTask; const categoryEdit = useInlineEdit({ value: categoryValue, onCommit: (category) => { if (categoryEditable) onSetTaskCategory(task.id, category); } }); const descriptionEdit = useInlineEdit({ value: task.description, onCommit: (description) => onUpdateTask(task.id, (current) => ({ ...current, description })), commitOnEnter: false }); return (