Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix(statistics): except ordering and type from qp reset
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabauke committed Oct 31, 2023
1 parent e850fa8 commit 20df93c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/qpcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default class ControllersQPControllerController extends Controller {
});
}

resetQueryParams({ except = [] }) {
resetQueryParams(options = { except: [] }) {
this.queryParams.forEach((qp) => {
if (!except.includes(qp)) {
if (!options.except.includes(qp)) {
this[qp] = this.#defaults[qp];
}
});
Expand Down
7 changes: 5 additions & 2 deletions app/statistics/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export default class StatisticsController extends QPController {

get appliedFilters() {
return Object.keys(queryParamsState(this)).filter((key) => {
return queryParamsState(this)[key]?.changed && key !== "type";
return (
queryParamsState(this)[key]?.changed &&
!["type", "ordering"].includes(key)
);
});
}

Expand Down Expand Up @@ -187,6 +190,6 @@ export default class StatisticsController extends QPController {

@action
reset() {
this.resetQueryParams({ except: ["type"] });
this.resetQueryParams({ except: ["ordering", "type"] });
}
}

0 comments on commit 20df93c

Please sign in to comment.