feat: enhance task filtering in EditCheckboxModal

- Updated `filteredTasks` logic to exclude tasks marked as "objectif principal" (isPinned = true) for better task management.
- Added `tagDetails` property to `Task` interface to store detailed tag information, improving task data structure.
- Adjusted `TasksService` to extract and include tag details when retrieving tasks from the database.
This commit is contained in:
Julien Froidefond
2025-09-30 08:30:57 +02:00
parent 6ef52bec85
commit f0d14e29f8
3 changed files with 23 additions and 8 deletions

View File

@@ -58,11 +58,17 @@ export function EditCheckboxModal({
}
}, [taskId, allTasks]);
// Filtrer les tâches selon la recherche
const filteredTasks = allTasks.filter(task =>
task.title.toLowerCase().includes(taskSearch.toLowerCase()) ||
(task.description && task.description.toLowerCase().includes(taskSearch.toLowerCase()))
);
// Filtrer les tâches selon la recherche et exclure les tâches avec des tags "objectif principal"
const filteredTasks = allTasks.filter(task => {
// Exclure les tâches avec des tags marqués comme "objectif principal" (isPinned = true)
if (task.tagDetails && task.tagDetails.some(tag => tag.isPinned)) {
return false;
}
// Filtrer selon la recherche
return task.title.toLowerCase().includes(taskSearch.toLowerCase()) ||
(task.description && task.description.toLowerCase().includes(taskSearch.toLowerCase()));
});
const handleTaskSelect = (task: Task) => {
setTaskId(task.id);