Consolidate dashboard clear-filters controls to one shared function (#76)
The sidebar's own Clear button cleared status/category/type/dates but never search/priority/assigned_to, while the page-level "Clear All Filters" button cleared a different subset. Neither control alone reliably returned the dashboard to a fully unfiltered state. The sidebar button now delegates to clearAllFilters() so both controls always clear the same complete set of params. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015nCxwFFsy8ouMWzn56rPVP
This commit is contained in:
@@ -361,14 +361,9 @@ function initSidebarFilters() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (clearFiltersBtn) {
|
if (clearFiltersBtn) {
|
||||||
clearFiltersBtn.addEventListener('click', () => {
|
// Delegate to clearAllFilters() so both controls always clear the same
|
||||||
const params = new URLSearchParams(window.location.search);
|
// complete set of filter params instead of two independently-maintained lists.
|
||||||
['status','category','type',
|
clearFiltersBtn.addEventListener('click', clearAllFilters);
|
||||||
'created_from','created_to','updated_from','updated_to','closed_from','closed_to'
|
|
||||||
].forEach(k => params.delete(k));
|
|
||||||
params.set('page', '1');
|
|
||||||
window.location.search = params.toString();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user