diff options
author | Andrés Manelli <andresmanelli@gmail.com> | 2019-02-23 15:32:44 +0100 |
---|---|---|
committer | Andrés Manelli <andresmanelli@gmail.com> | 2019-02-24 00:05:00 +0100 |
commit | 7a6afb8aea2c3398ec0fe34d664398bd94cac90a (patch) | |
tree | 7aa6f53617370333973800605c85ed1fcf6f621e /models | |
parent | 1e72177991e3fe11a1837e3e294e4de5d728aa30 (diff) | |
download | wekan-7a6afb8aea2c3398ec0fe34d664398bd94cac90a.tar.gz wekan-7a6afb8aea2c3398ec0fe34d664398bd94cac90a.tar.bz2 wekan-7a6afb8aea2c3398ec0fe34d664398bd94cac90a.zip |
Add template search in Add Card menu
Archive all cards in list when list is archived
Remove default board in link popup
Only list non-template boards in card link and search
Diffstat (limited to 'models')
-rw-r--r-- | models/boards.js | 4 | ||||
-rw-r--r-- | models/lists.js | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js index 7328899e..c17c7351 100644 --- a/models/boards.js +++ b/models/boards.js @@ -470,6 +470,10 @@ Boards.helpers({ if (excludeLinked) { query.linkedId = null; } + if (this.isTemplatesBoard()) { + query.type = 'template-card'; + query.archived = false; + } const projection = { limit: 10, sort: { createdAt: -1 } }; if (term) { diff --git a/models/lists.js b/models/lists.js index a0b882bc..236432cc 100644 --- a/models/lists.js +++ b/models/lists.js @@ -195,10 +195,23 @@ Lists.mutations({ }, archive() { + Cards.find({ + listId: this._id, + archived: false, + }).forEach((card) => { + return card.archive(); + }); return { $set: { archived: true } }; }, restore() { + cardsToRestore = Cards.find({ + listId: this._id, + archived: true, + }); + cardsToRestore.forEach((card) => { + card.restore(); + }); return { $set: { archived: false } }; }, |