Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Do not restrict params when applying new filters

Oliver Günther0f1a87de12ac
diff --git a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts
index fb3705db770..8a5dd818476 100644
--- a/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/filter/filters-form.controller.ts
@@ -44,8 +44,6 @@ interface InternalFilterValue {
}
export default class FiltersFormController extends Controller {
- static paramsToCopy = ['sortBy', 'columns', 'query_id', 'per_page'];
-
static targets = [
'filterFormToggle',
'filterForm',
@@ -318,26 +316,20 @@ export default class FiltersFormController extends Controller {
}
sendForm() {
- const params = new URLSearchParams();
- params.append('filters', this.buildFiltersParam(this.parseFilters()));
+ const params = new URLSearchParams(window.location.search);
+ const newFilters = this.buildFiltersParam(this.parseFilters());
- const currentParams = new URLSearchParams(window.location.search);
- if (params.get('filters') === currentParams.get('filters')) {
+ if (newFilters === params.get('filters')) {
// Some fields may be triggered via the input event and the change event too.
// This early return will prevent firing request when the filter params are not changed.
return;
}
+ params.set('filters', newFilters);
const ajaxIndicator = document.querySelector('#ajax-indicator') as HTMLElement;
ajaxIndicator.style.display = '';
- FiltersFormController.paramsToCopy.forEach((name) => {
- if (currentParams.has(name)) {
- params.append(name, currentParams.get(name) as string);
- }
- });
-
const url = `${window.location.pathname}?${params.toString()}`;
if (this.performTurboRequestsValue) {