feat: add TFS filters and integration
- Introduced TFS filtering capabilities in `KanbanFilters` with options to show/hide TFS tasks and filter by TFS projects. - Integrated `TfsQuickFilter` component into `KanbanPageClient` and `MobileControls` for enhanced task management. - Updated `TasksContext` to support new TFS filter states and ensure proper task filtering based on TFS criteria. - Enhanced type definitions in `types.ts` to accommodate new TFS filter properties.
This commit is contained in:
@@ -64,7 +64,11 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
showJiraOnly: preferences.kanbanFilters.showJiraOnly || false,
|
||||
hideJiraTasks: preferences.kanbanFilters.hideJiraTasks || false,
|
||||
jiraProjects: preferences.kanbanFilters.jiraProjects || [],
|
||||
jiraTypes: preferences.kanbanFilters.jiraTypes || []
|
||||
jiraTypes: preferences.kanbanFilters.jiraTypes || [],
|
||||
// Filtres TFS
|
||||
showTfsOnly: preferences.kanbanFilters.showTfsOnly || false,
|
||||
hideTfsTasks: preferences.kanbanFilters.hideTfsTasks || false,
|
||||
tfsProjects: preferences.kanbanFilters.tfsProjects || []
|
||||
}), [preferences]);
|
||||
|
||||
// Fonction pour mettre à jour les filtres avec persistance
|
||||
@@ -80,7 +84,11 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
showJiraOnly: newFilters.showJiraOnly,
|
||||
hideJiraTasks: newFilters.hideJiraTasks,
|
||||
jiraProjects: newFilters.jiraProjects,
|
||||
jiraTypes: newFilters.jiraTypes
|
||||
jiraTypes: newFilters.jiraTypes,
|
||||
// Filtres TFS
|
||||
showTfsOnly: newFilters.showTfsOnly,
|
||||
hideTfsTasks: newFilters.hideTfsTasks,
|
||||
tfsProjects: newFilters.tfsProjects
|
||||
};
|
||||
|
||||
const viewPreferenceUpdates = {
|
||||
@@ -133,7 +141,10 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
(kanbanFilters.jiraProjects?.filter(Boolean).length || 0) +
|
||||
(kanbanFilters.jiraTypes?.filter(Boolean).length || 0) +
|
||||
(kanbanFilters.showJiraOnly ? 1 : 0) +
|
||||
(kanbanFilters.hideJiraTasks ? 1 : 0);
|
||||
(kanbanFilters.hideJiraTasks ? 1 : 0) +
|
||||
(kanbanFilters.tfsProjects?.filter(Boolean).length || 0) +
|
||||
(kanbanFilters.showTfsOnly ? 1 : 0) +
|
||||
(kanbanFilters.hideTfsTasks ? 1 : 0);
|
||||
}, [kanbanFilters]);
|
||||
|
||||
// Filtrage et tri des tâches régulières (pas les épinglées)
|
||||
@@ -187,6 +198,20 @@ export function TasksProvider({ children, initialTasks, initialTags, initialStat
|
||||
);
|
||||
}
|
||||
|
||||
// Filtres spécifiques TFS
|
||||
if (kanbanFilters.showTfsOnly) {
|
||||
filtered = filtered.filter(task => task.source === 'tfs');
|
||||
} else if (kanbanFilters.hideTfsTasks) {
|
||||
filtered = filtered.filter(task => task.source !== 'tfs');
|
||||
}
|
||||
|
||||
// Filtre par projets TFS
|
||||
if (kanbanFilters.tfsProjects?.length) {
|
||||
filtered = filtered.filter(task =>
|
||||
task.source !== 'tfs' || kanbanFilters.tfsProjects!.includes(task.tfsProject || '')
|
||||
);
|
||||
}
|
||||
|
||||
// Tri des tâches
|
||||
if (kanbanFilters.sortBy) {
|
||||
const sortOption = getSortOption(kanbanFilters.sortBy);
|
||||
|
||||
Reference in New Issue
Block a user