From 7a6afb8aea2c3398ec0fe34d664398bd94cac90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Manelli?= Date: Sat, 23 Feb 2019 15:32:44 +0100 Subject: 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 --- models/boards.js | 4 ++++ models/lists.js | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'models') 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 } }; }, -- cgit v1.2.3-1-g7c22