feat: add due date filter to KanbanFilters
- Introduced `showWithDueDate` option in `KanbanFilters` to filter tasks based on due dates. - Added toggle button in the UI for users to easily enable/disable this filter. - Updated `TasksContext` to handle the new filter state and applied filtering logic in task retrieval. - Ensured user preferences are saved with the new filter option in `user-preferences.ts`.
This commit is contained in:
@@ -60,6 +60,7 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
compactView: preferences.viewPreferences.compactView || false,
|
||||
swimlanesByTags: preferences.viewPreferences.swimlanesByTags || false,
|
||||
swimlanesMode: preferences.viewPreferences.swimlanesMode || 'tags',
|
||||
showWithDueDate: preferences.kanbanFilters.showWithDueDate || false,
|
||||
// Filtres Jira
|
||||
showJiraOnly: preferences.kanbanFilters.showJiraOnly || false,
|
||||
hideJiraTasks: preferences.kanbanFilters.hideJiraTasks || false,
|
||||
@@ -80,6 +81,7 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
priorities: newFilters.priorities,
|
||||
showCompleted: newFilters.showCompleted,
|
||||
sortBy: newFilters.sortBy,
|
||||
showWithDueDate: newFilters.showWithDueDate,
|
||||
// Filtres Jira
|
||||
showJiraOnly: newFilters.showJiraOnly,
|
||||
hideJiraTasks: newFilters.hideJiraTasks,
|
||||
@@ -138,6 +140,7 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
return (kanbanFilters.tags?.filter(Boolean).length || 0) +
|
||||
(kanbanFilters.priorities?.filter(Boolean).length || 0) +
|
||||
(kanbanFilters.search ? 1 : 0) +
|
||||
(kanbanFilters.showWithDueDate ? 1 : 0) +
|
||||
(kanbanFilters.jiraProjects?.filter(Boolean).length || 0) +
|
||||
(kanbanFilters.jiraTypes?.filter(Boolean).length || 0) +
|
||||
(kanbanFilters.showJiraOnly ? 1 : 0) +
|
||||
@@ -212,6 +215,11 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
);
|
||||
}
|
||||
|
||||
// Filtre par date de fin
|
||||
if (kanbanFilters.showWithDueDate) {
|
||||
filtered = filtered.filter(task => task.dueDate != null);
|
||||
}
|
||||
|
||||
// Tri des tâches
|
||||
if (kanbanFilters.sortBy) {
|
||||
const sortOption = getSortOption(kanbanFilters.sortBy);
|
||||
|
||||
Reference in New Issue
Block a user