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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user