From 903a0e15af5042b84c4fa153393c4afdf58f5fef Mon Sep 17 00:00:00 2001 From: yelinz Date: Thu, 28 Dec 2023 10:59:53 +0100 Subject: [PATCH 1/4] fix: reset query params --- addon/routes/application.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/addon/routes/application.js b/addon/routes/application.js index 03e23708..ee57de5e 100644 --- a/addon/routes/application.js +++ b/addon/routes/application.js @@ -8,6 +8,7 @@ export default class ApplicationRoute extends Route { queryParams = { category: PARAM_OPTIONS, tags: PARAM_OPTIONS, + marks: PARAM_OPTIONS, search: PARAM_OPTIONS, document: PARAM_OPTIONS, activeGroup: PARAM_OPTIONS, @@ -30,4 +31,19 @@ export default class ApplicationRoute extends Route { this.config.alexandriaQueryParams = transition.to.parent.params; this.config.activeGroup = transition.to.queryParams.activeGroup; } + + resetController(controller, isExiting) { + // isExiting would be false if only the route's model was changing + if (isExiting) { + controller.setProperties({ + category: undefined, + tags: [], + marks: [], + search: undefined, + document: undefined, + activeGroup: undefined, + sort: undefined, + }); + } + } } From 435076877f56014059bdf0d7115e830c7e61311a Mon Sep 17 00:00:00 2001 From: yelinz Date: Thu, 28 Dec 2023 11:02:58 +0100 Subject: [PATCH 2/4] fix(tag-filter): only show active marks --- addon/components/tag-filter.hbs | 2 +- addon/components/tag-filter.js | 20 +++++++++++++++++++ .../integration/components/tag-filter-test.js | 12 ++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/addon/components/tag-filter.hbs b/addon/components/tag-filter.hbs index d6af0afe..3e600554 100644 --- a/addon/components/tag-filter.hbs +++ b/addon/components/tag-filter.hbs @@ -2,7 +2,7 @@ class="uk-border uk-padding-small uk-width-expand uk-flex uk-flex-wrap uk-flex-middle" ...attributes > - {{#each this.marks.marks.records as |mark|}} + {{#each this.activeMarks.value as |mark|}} - {{/each}} - {{#if (and this.searchTags.isFinished (not this.searchTags.value))}} - {{t "alexandria.tag-filter.empty"}} + {{#if this.marks.marks.hasRan}} + {{#each this.availableMarks.value as |mark|}} + + {{/each}} + {{/if}} + {{#if (and this.availableTags.isFinished (not this.availableTags.value))}} + {{t + "alexandria.tag-filter.empty" + }} {{else}} - {{#each this.tags.fetchSearchTags.lastSuccessful.value as |tag|}} + {{#each this.availableTags.value as |tag|}}