diff options
author | IgnatzHome <ignatz@maschath.de> | 2018-05-19 20:53:25 +0200 |
---|---|---|
committer | IgnatzHome <ignatz@maschath.de> | 2018-05-19 20:53:25 +0200 |
commit | ba12b53e49852e92c6ed77df07f7576a9ed2b02c (patch) | |
tree | c91d6148c3f097aa67d7efbceda933e91c21a0ad /client/lib | |
parent | b9ead144fb88eb8e02c1d9ea9144873ce926ed96 (diff) | |
download | wekan-ba12b53e49852e92c6ed77df07f7576a9ed2b02c.tar.gz wekan-ba12b53e49852e92c6ed77df07f7576a9ed2b02c.tar.bz2 wekan-ba12b53e49852e92c6ed77df07f7576a9ed2b02c.zip |
correct way, wrong idea
Diffstat (limited to 'client/lib')
-rw-r--r-- | client/lib/filter.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/lib/filter.js b/client/lib/filter.js index 4a6dd2f3..749527fb 100644 --- a/client/lib/filter.js +++ b/client/lib/filter.js @@ -143,6 +143,11 @@ class AdvancedFilter { return commands; } + _fieldNameToId(name) + { + CustomFields.find({name})._id; + } + _arrayToSelector(commands) { try { @@ -159,7 +164,7 @@ class AdvancedFilter { { const field = commands[i-1].cmd; const str = commands[i+1].cmd; - commands[i] = {[field]:str}; + commands[i] = {'customFields._id':this._fieldNameToId(field), 'customFields.value':str}; commands.splice(i-1, 1); commands.splice(i, 1); //changed = true; @@ -207,7 +212,7 @@ Filter = { isActive() { return _.any(this._fields, (fieldName) => { return this[fieldName]._isActive(); - }); + }) || this.advanced._isActive(); }, _getMongoSelector() { |