From a051f26685b7d4c18f40837b186078f5f0ac11fa Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 17 Mar 2017 11:12:11 +0000 Subject: Show loading icon when changing filter in add issues modal Closes #29615 --- app/assets/javascripts/boards/components/modal/filters.js | 2 +- app/assets/javascripts/boards/components/modal/index.js | 13 ++++++++++--- app/assets/javascripts/boards/stores/modal_store.js | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/boards/components/modal/filters.js b/app/assets/javascripts/boards/components/modal/filters.js index bd394a2318c..9cbb2100c9a 100644 --- a/app/assets/javascripts/boards/components/modal/filters.js +++ b/app/assets/javascripts/boards/components/modal/filters.js @@ -15,7 +15,7 @@ export default { this.filteredSearch = new FilteredSearchBoards(this.store); this.filteredSearch.removeTokens(); }, - beforeDestroy() { + destroyed() { this.filteredSearch.cleanup(); FilteredSearchContainer.container = document; this.store.path = ''; diff --git a/app/assets/javascripts/boards/components/modal/index.js b/app/assets/javascripts/boards/components/modal/index.js index 1b66c8b922d..a2a0f719601 100644 --- a/app/assets/javascripts/boards/components/modal/index.js +++ b/app/assets/javascripts/boards/components/modal/index.js @@ -64,7 +64,14 @@ require('./empty_state'); }, filter: { handler() { - this.loadIssues(true); + if (this.$el.tagName) { + this.filterLoading = true; + + this.loadIssues(true) + .then(() => { + this.filterLoading = false; + }); + } }, deep: true, }, @@ -135,14 +142,14 @@ require('./empty_state'); :image="blankStateImage" :issue-link-base="issueLinkBase" :root-path="rootPath" - v-if="!loading && showList"> + v-if="!loading && showList && !filterLoading">
+ v-if="loading || filterLoading">
diff --git a/app/assets/javascripts/boards/stores/modal_store.js b/app/assets/javascripts/boards/stores/modal_store.js index 7ee266a831f..9b009483a3c 100644 --- a/app/assets/javascripts/boards/stores/modal_store.js +++ b/app/assets/javascripts/boards/stores/modal_store.js @@ -15,6 +15,7 @@ searchTerm: '', loading: false, loadingNewPage: false, + filterLoading: false, page: 1, perPage: 50, filter: { -- cgit v1.2.1