From c5d7353d68da5fa8a36c50693c7b03d0b4eedb39 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 29 Apr 2024 15:26:08 +0200 Subject: [PATCH] Fix filters modal [SCI-10656] --- .../vue/global_search/filters_modal.vue | 2 +- .../vue/global_search/groups/search_mixin.js | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/javascript/vue/global_search/filters_modal.vue b/app/javascript/vue/global_search/filters_modal.vue index 454ceb2aa..420e8bf00 100644 --- a/app/javascript/vue/global_search/filters_modal.vue +++ b/app/javascript/vue/global_search/filters_modal.vue @@ -21,7 +21,7 @@ :filters="filters" :currentTeam="currentTeam" @search="(newFilters) => { this.$emit('search', newFilters); }" - @close="close" /> + @cancel="close" /> diff --git a/app/javascript/vue/global_search/groups/search_mixin.js b/app/javascript/vue/global_search/groups/search_mixin.js index 59c6be24a..fd3eca6a6 100644 --- a/app/javascript/vue/global_search/groups/search_mixin.js +++ b/app/javascript/vue/global_search/groups/search_mixin.js @@ -36,6 +36,9 @@ export default { }; }, watch: { + filters() { + this.reloadData(); + }, selected() { if (this.selected) { if (!this.fullDataLoaded) { @@ -46,13 +49,7 @@ export default { } }, query() { - if (this.query.length > 1) { - this.results = []; - this.page = 1; - this.total = 0; - this.fullDataLoaded = false; - this.loadData(); - } + this.reloadData(); } }, mounted() { @@ -105,6 +102,15 @@ export default { this.page = 1; this.loadData(); }, + reloadData() { + if (this.query.length > 1) { + this.results = []; + this.page = 1; + this.total = 0; + this.fullDataLoaded = false; + this.loadData(); + } + }, loadData() { if (this.query.length < 2) return;