summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-05-19 18:40:03 +0300
committerLauri Ojansivu <x@xet7.org>2018-05-19 18:40:03 +0300
commit38ab2b766d8924ab9049b54a0778eb9273241c9b (patch)
tree12cee0e524cc087dcebba7248484fe82759bd704
parent8101d7ade85dbdf6dad95d96a937bf9718630373 (diff)
parent410e5aa28d065508558fdc46fa82bd540d21b97a (diff)
downloadwekan-38ab2b766d8924ab9049b54a0778eb9273241c9b.tar.gz
wekan-38ab2b766d8924ab9049b54a0778eb9273241c9b.tar.bz2
wekan-38ab2b766d8924ab9049b54a0778eb9273241c9b.zip
Merge branch 'feuerball11-feature-custom-fields-filter' into devel
-rw-r--r--CHANGELOG.md9
-rw-r--r--Dockerfile2
-rw-r--r--client/components/sidebar/sidebarFilters.jade15
-rw-r--r--client/components/sidebar/sidebarFilters.js5
-rw-r--r--client/lib/filter.js17
-rw-r--r--i18n/en-GB.i18n.json1
-rw-r--r--i18n/en.i18n.json1
-rw-r--r--i18n/fi.i18n.json1
-rw-r--r--snapcraft.yaml2
9 files changed, 48 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index adecd17e..7e48154b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+# Upcoming Wekan release
+
+This release adds the following new features:
+
+* [Filtering by Custom Field](https://github.com/wekan/wekan/pull/1645);
+* Update to NPM 6.0.1 and MongoDB 3.2.20.
+
+Thanks to GitHub users feuerball11 and xet7 for their contributions.
+
# v0.97 2018-05-19 Wekan release
Updated translations.
diff --git a/Dockerfile b/Dockerfile
index c794f6dc..121d6adc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,7 +19,7 @@ ENV NODE_VERSION ${NODE_VERSION:-v8.11.1}
ENV METEOR_RELEASE ${METEOR_RELEASE:-1.6.0.1}
ENV USE_EDGE ${USE_EDGE:-false}
ENV METEOR_EDGE ${METEOR_EDGE:-1.5-beta.17}
-ENV NPM_VERSION ${NPM_VERSION:-5.5.1}
+ENV NPM_VERSION ${NPM_VERSION:-6.0.1}
ENV FIBERS_VERSION ${FIBERS_VERSION:-2.0.0}
ENV ARCHITECTURE ${ARCHITECTURE:-linux-x64}
ENV SRC_PATH ${SRC_PATH:-./}
diff --git a/client/components/sidebar/sidebarFilters.jade b/client/components/sidebar/sidebarFilters.jade
index 273df8c2..5f9fcf72 100644
--- a/client/components/sidebar/sidebarFilters.jade
+++ b/client/components/sidebar/sidebarFilters.jade
@@ -40,6 +40,21 @@ template(name="filterSidebar")
| (<span class="username">{{ username }}</span>)
if Filter.members.isSelected _id
i.fa.fa-check
+ hr
+ ul.sidebar-list
+ li(class="{{#if Filter.customFields.isSelected undefined}}active{{/if}}")
+ a.name.js-toggle-custom-fields-filter
+ span.sidebar-list-item-description
+ | {{_ 'filter-no-custom-fields'}}
+ if Filter.customFields.isSelected undefined
+ i.fa.fa-check
+ each currentBoard.customFields
+ li(class="{{#if Filter.customFields.isSelected _id}}active{{/if}}")
+ 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..f68c9711 100644
--- a/client/lib/filter.js
+++ b/client/lib/filter.js
@@ -10,10 +10,13 @@ function showFilterSidebar() {
// Use a "set" filter for a field that is a set of documents uniquely
// identified. For instance `{ labels: ['labelA', 'labelC', 'labelD'] }`.
+// use "subField" for searching inside object Fields.
+// For instance '{ 'customFields._id': ['field1','field2']} (subField would be: _id)
class SetFilter {
- constructor() {
+ constructor(subField = '') {
this._dep = new Tracker.Dependency();
this._selectedElements = [];
+ this.subField = subField;
}
isSelected(val) {
@@ -86,8 +89,9 @@ Filter = {
// before changing the schema.
labelIds: new SetFilter(),
members: new SetFilter(),
+ customFields: new SetFilter('_id'),
- _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 +115,14 @@ Filter = {
this._fields.forEach((fieldName) => {
const filter = this[fieldName];
if (filter._isActive()) {
- filterSelector[fieldName] = filter._getMongoSelector();
+ if (filter.subField !== '')
+ {
+ filterSelector[`${fieldName}.${filter.subField}`] = filter._getMongoSelector();
+ }
+ else
+ {
+ filterSelector[fieldName] = filter._getMongoSelector();
+ }
emptySelector[fieldName] = filter._getEmptySelector();
if (emptySelector[fieldName] !== null) {
includeEmptySelectors = true;
diff --git a/i18n/en-GB.i18n.json b/i18n/en-GB.i18n.json
index 8f8f5c4e..1182677d 100644
--- a/i18n/en-GB.i18n.json
+++ b/i18n/en-GB.i18n.json
@@ -242,6 +242,7 @@
"filter-clear": "Clear filter",
"filter-no-label": "No label",
"filter-no-member": "No member",
+ "filter-no-custom-fields": "No Custom Fields",
"filter-on": "Filter is on",
"filter-on-desc": "You are filtering cards on this board. Click here to edit filter.",
"filter-to-selection": "Filter to selection",
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index 6006a078..e2d6ddce 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -242,6 +242,7 @@
"filter-clear": "Clear filter",
"filter-no-label": "No label",
"filter-no-member": "No member",
+ "filter-no-custom-fields": "No Custom Fields",
"filter-on": "Filter is on",
"filter-on-desc": "You are filtering cards on this board. Click here to edit filter.",
"filter-to-selection": "Filter to selection",
diff --git a/i18n/fi.i18n.json b/i18n/fi.i18n.json
index 2876c75e..935f760c 100644
--- a/i18n/fi.i18n.json
+++ b/i18n/fi.i18n.json
@@ -242,6 +242,7 @@
"filter-clear": "Poista suodatin",
"filter-no-label": "Ei tunnistetta",
"filter-no-member": "Ei jäseniä",
+ "filter-no-custom-fields": "Ei mukautettuja kenttiä",
"filter-on": "Suodatus on päällä",
"filter-on-desc": "Suodatat kortteja tällä taululla. Klikkaa tästä muokataksesi suodatinta.",
"filter-to-selection": "Suodata valintaan",
diff --git a/snapcraft.yaml b/snapcraft.yaml
index 535150b3..d9250392 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -83,7 +83,7 @@ parts:
plugin: nodejs
node-engine: 8.11.1
node-packages:
- - npm@5.5.1
+ - npm@6.0.1
- node-gyp
- node-pre-gyp
- fibers@2.0.0