summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorIgnatzHome <ignatz@maschath.de>2018-05-19 14:51:01 +0200
committerIgnatzHome <ignatz@maschath.de>2018-05-19 14:51:01 +0200
commit78317ef792c0de7435bbb8a0d3f6b413b2af9ab1 (patch)
treeae0dda702157f779c981ffda031e5e69e8999f96 /client
parent1ab4f5b9134f77e24d88c7f09d274f37cfb2a994 (diff)
downloadwekan-78317ef792c0de7435bbb8a0d3f6b413b2af9ab1.tar.gz
wekan-78317ef792c0de7435bbb8a0d3f6b413b2af9ab1.tar.bz2
wekan-78317ef792c0de7435bbb8a0d3f6b413b2af9ab1.zip
Filter on custom fields presence
Diffstat (limited to 'client')
-rw-r--r--client/components/sidebar/sidebarFilters.jade5
-rw-r--r--client/components/sidebar/sidebarFilters.js5
-rw-r--r--client/lib/filter.js11
3 files changed, 18 insertions, 3 deletions
diff --git a/client/components/sidebar/sidebarFilters.jade b/client/components/sidebar/sidebarFilters.jade
index ef7b39a2..d1fdf824 100644
--- a/client/components/sidebar/sidebarFilters.jade
+++ b/client/components/sidebar/sidebarFilters.jade
@@ -40,12 +40,15 @@ template(name="filterSidebar")
| (<span class="username">{{ username }}</span>)
if Filter.members.isSelected _id
i.fa.fa-check
+ hr
ul.sidebar-list
each currentBoard.customFields
li
- a.name.js-toggle-label-filter
+ a.name.js-toggle-custom-fields-filter
span.sidebar-list-item-description
{{ name }}
+ if Filter.customFields.isSelected _id
+ i.fa.fa-check
if Filter.isActive
hr
a.sidebar-btn.js-clear-all
diff --git a/client/components/sidebar/sidebarFilters.js b/client/components/sidebar/sidebarFilters.js
index f02d3a4a..ba2633de 100644
--- a/client/components/sidebar/sidebarFilters.js
+++ b/client/components/sidebar/sidebarFilters.js
@@ -11,6 +11,11 @@ BlazeComponent.extendComponent({
Filter.members.toggle(this.currentData()._id);
Filter.resetExceptions();
},
+ 'click .js-toggle-custom-fields-filter'(evt) {
+ evt.preventDefault();
+ Filter.customFields.toggle(this.currentData()._id);
+ Filter.resetExceptions();
+ },
'click .js-clear-all'(evt) {
evt.preventDefault();
Filter.reset();
diff --git a/client/lib/filter.js b/client/lib/filter.js
index 8129776b..27492125 100644
--- a/client/lib/filter.js
+++ b/client/lib/filter.js
@@ -86,8 +86,9 @@ Filter = {
// before changing the schema.
labelIds: new SetFilter(),
members: new SetFilter(),
+ customFields: new SetFilter(),
- _fields: ['labelIds', 'members'],
+ _fields: ['labelIds', 'members', 'customFields'],
// We don't filter cards that have been added after the last filter change. To
// implement this we keep the id of these cards in this `_exceptions` fields
@@ -111,7 +112,13 @@ Filter = {
this._fields.forEach((fieldName) => {
const filter = this[fieldName];
if (filter._isActive()) {
- filterSelector[fieldName] = filter._getMongoSelector();
+ if (fieldName === 'customFields'){
+ filterSelector[fieldName] = {_id: filter._getMongoSelector()};
+ }
+ else
+ {
+ filterSelector[fieldName] = filter._getMongoSelector();
+ }
emptySelector[fieldName] = filter._getEmptySelector();
if (emptySelector[fieldName] !== null) {
includeEmptySelectors = true;