diff options
author | Phil Hughes <me@iamphill.com> | 2017-02-02 17:34:28 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-02-03 21:03:40 +0300 |
commit | c3339b332bb2ed95c2a7b09ce258ecbb23b0cfc5 (patch) | |
tree | be0ea97d4b71823cb8e01df6e4b1b4c5a2a56a8f /app/assets/javascripts/boards | |
parent | 7e253790623895ba0e91f637e64e9e3306999951 (diff) |
Resets modal filters when closing
Diffstat (limited to 'app/assets/javascripts/boards')
3 files changed, 16 insertions, 6 deletions
diff --git a/app/assets/javascripts/boards/components/modal/filters.js.es6 b/app/assets/javascripts/boards/components/modal/filters.js.es6 index 8f923f65306..f1828781c5a 100644 --- a/app/assets/javascripts/boards/components/modal/filters.js.es6 +++ b/app/assets/javascripts/boards/components/modal/filters.js.es6 @@ -18,6 +18,9 @@ required: true, }, }, + destroyed() { + ModalStore.setDefaultFilter(); + }, components: { 'user-filter': gl.issueBoards.ModalFilterUser, 'milestone-filter': gl.issueBoards.ModalFilterMilestone, diff --git a/app/assets/javascripts/boards/components/modal/index.js.es6 b/app/assets/javascripts/boards/components/modal/index.js.es6 index c0871d74565..71f7f7eeb20 100644 --- a/app/assets/javascripts/boards/components/modal/index.js.es6 +++ b/app/assets/javascripts/boards/components/modal/index.js.es6 @@ -74,6 +74,8 @@ this.loadIssues(true); }, 500), loadIssues(clearIssues = false) { + if (!this.showAddIssuesModal) return; + const data = Object.assign({}, this.filter, { search: this.searchTerm, page: this.page, diff --git a/app/assets/javascripts/boards/stores/modal_store.js.es6 b/app/assets/javascripts/boards/stores/modal_store.js.es6 index ed42af301cd..15fc6c79e8d 100644 --- a/app/assets/javascripts/boards/stores/modal_store.js.es6 +++ b/app/assets/javascripts/boards/stores/modal_store.js.es6 @@ -17,12 +17,17 @@ loadingNewPage: false, page: 1, perPage: 50, - filter: { - author_id: '', - assignee_id: '', - milestone_title: '', - label_name: [], - }, + }; + + this.setDefaultFilter(); + } + + setDefaultFilter() { + this.store.filter = { + author_id: '', + assignee_id: '', + milestone_title: '', + label_name: [], }; } |