feat(task-filters): implement comprehensive filter clearing functionality
- Added logic to clear label, assignee, and priority filters in ImprovedTaskFilters, enhancing user experience by allowing users to reset all filters at once. - Updated the dependency array in the useEffect hook to include currentTaskLabels and currentTaskAssignees, ensuring proper updates on filter changes. - Modified task management slice to change the delimiter for selected labels, assignees, and priorities from commas to spaces for improved readability.
This commit is contained in:
@@ -748,6 +748,23 @@ const ImprovedTaskFilters: React.FC<ImprovedTaskFiltersProps> = ({
|
||||
dispatch(setBoardSearch(''));
|
||||
}
|
||||
|
||||
// Clear label filters
|
||||
const clearedLabels = currentTaskLabels.map(label => ({
|
||||
...label,
|
||||
selected: false
|
||||
}));
|
||||
dispatch(setLabels(clearedLabels));
|
||||
|
||||
// Clear assignee filters
|
||||
const clearedAssignees = currentTaskAssignees.map(member => ({
|
||||
...member,
|
||||
selected: false
|
||||
}));
|
||||
dispatch(setMembers(clearedAssignees));
|
||||
|
||||
// Clear priority filters
|
||||
dispatch(setSelectedPriorities([]));
|
||||
|
||||
// Clear other filters
|
||||
setShowArchived(false);
|
||||
|
||||
@@ -755,7 +772,7 @@ const ImprovedTaskFilters: React.FC<ImprovedTaskFiltersProps> = ({
|
||||
dispatch(fetchTasksV3(projectId));
|
||||
|
||||
console.log('Clear all filters');
|
||||
}, [projectId, projectView, dispatch]);
|
||||
}, [projectId, projectView, dispatch, currentTaskLabels, currentTaskAssignees]);
|
||||
|
||||
const toggleArchived = useCallback(() => {
|
||||
setShowArchived(!showArchived);
|
||||
|
||||
Reference in New Issue
Block a user