diff options
author | Romulus Urakagi Tsai <urakagi@gmail.com> | 2019-08-07 07:58:05 +0000 |
---|---|---|
committer | Romulus Urakagi Tsai <urakagi@gmail.com> | 2019-08-07 07:58:05 +0000 |
commit | 4f4e0a21f80019048aad6b7a679899c048cb3865 (patch) | |
tree | b891aa2e6a7dfaa84fc9ceefde15f6b44fa9efcf /client/components/sidebar | |
parent | cf9ad221f8654f070a2a7bb1de4522e4b01762dd (diff) | |
download | wekan-4f4e0a21f80019048aad6b7a679899c048cb3865.tar.gz wekan-4f4e0a21f80019048aad6b7a679899c048cb3865.tar.bz2 wekan-4f4e0a21f80019048aad6b7a679899c048cb3865.zip |
Add 'show archive' and 'hide empty lists' in filter feature.
Diffstat (limited to 'client/components/sidebar')
-rw-r--r-- | client/components/sidebar/sidebarArchives.js | 2 | ||||
-rw-r--r-- | client/components/sidebar/sidebarFilters.jade | 16 | ||||
-rw-r--r-- | client/components/sidebar/sidebarFilters.js | 19 |
3 files changed, 37 insertions, 0 deletions
diff --git a/client/components/sidebar/sidebarArchives.js b/client/components/sidebar/sidebarArchives.js index 53fc29b9..a4846561 100644 --- a/client/components/sidebar/sidebarArchives.js +++ b/client/components/sidebar/sidebarArchives.js @@ -1,3 +1,4 @@ +archivedRequested = false; const subManager = new SubsManager(); BlazeComponent.extendComponent({ @@ -12,6 +13,7 @@ BlazeComponent.extendComponent({ const currentBoardId = Session.get('currentBoard'); if (!currentBoardId) return; const handle = subManager.subscribe('board', currentBoardId, true); + archivedRequested = true; Tracker.nonreactive(() => { Tracker.autorun(() => { this.isArchiveReady.set(handle.ready()); diff --git a/client/components/sidebar/sidebarFilters.jade b/client/components/sidebar/sidebarFilters.jade index f11528b1..55ab213a 100644 --- a/client/components/sidebar/sidebarFilters.jade +++ b/client/components/sidebar/sidebarFilters.jade @@ -56,6 +56,22 @@ template(name="filterSidebar") if Filter.customFields.isSelected _id i.fa.fa-check hr + ul.sidebar-list + li(class="{{#if Filter.archive.isSelected _id}}active{{/if}}") + a.name.js-toggle-archive-filter + span.sidebar-list-item-description + | {{_ 'filter-show-archive'}} + if Filter.archive.isSelected _id + i.fa.fa-check + hr + ul.sidebar-list + li(class="{{#if Filter.hideEmpty.isSelected _id}}active{{/if}}") + a.name.js-toggle-hideEmpty-filter + span.sidebar-list-item-description + | {{_ 'filter-hide-empty'}} + if Filter.hideEmpty.isSelected _id + i.fa.fa-check + hr span {{_ 'advanced-filter-label'}} input.js-field-advanced-filter(type="text") span {{_ 'advanced-filter-description'}} diff --git a/client/components/sidebar/sidebarFilters.js b/client/components/sidebar/sidebarFilters.js index 88438a7a..3483d00c 100644 --- a/client/components/sidebar/sidebarFilters.js +++ b/client/components/sidebar/sidebarFilters.js @@ -1,3 +1,5 @@ +const subManager = new SubsManager(); + BlazeComponent.extendComponent({ events() { return [ @@ -12,6 +14,23 @@ BlazeComponent.extendComponent({ Filter.members.toggle(this.currentData()._id); Filter.resetExceptions(); }, + 'click .js-toggle-archive-filter'(evt) { + evt.preventDefault(); + Filter.archive.toggle(this.currentData()._id); + Filter.resetExceptions(); + const currentBoardId = Session.get('currentBoard'); + if (!currentBoardId) return; + subManager.subscribe( + 'board', + currentBoardId, + Filter.archive.isSelected(), + ); + }, + 'click .js-toggle-hideEmpty-filter'(evt) { + evt.preventDefault(); + Filter.hideEmpty.toggle(this.currentData()._id); + Filter.resetExceptions(); + }, 'click .js-toggle-custom-fields-filter'(evt) { evt.preventDefault(); Filter.customFields.toggle(this.currentData()._id); |