From c865bfe49785181d97b25cb683c0ed37d82c1a69 Mon Sep 17 00:00:00 2001 From: amadilsons Date: Wed, 4 Oct 2017 17:48:37 +0200 Subject: most work concluded, code needs clean up, further testing required --- models/cards.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'models/cards.js') diff --git a/models/cards.js b/models/cards.js index 0a440697..7d66bf8b 100644 --- a/models/cards.js +++ b/models/cards.js @@ -179,6 +179,14 @@ Cards.helpers({ cardId: this._id, }); }, + + canBeRestored() { + const list = Lists.findOne({_id: this.listId}); + if(list.wipLimit.enabled && list.wipLimit.value == list.cards().count()){ + return false; + } + return true; + }, }); Cards.mutations({ -- cgit v1.2.3-1-g7c22 From 214fe6a61f60513d3ddfc9eee423c1b932ff8463 Mon Sep 17 00:00:00 2001 From: amadilsons Date: Thu, 5 Oct 2017 16:46:55 +0200 Subject: feature implemented, known bugs fixed --- models/cards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models/cards.js') diff --git a/models/cards.js b/models/cards.js index 7d66bf8b..5b752ec3 100644 --- a/models/cards.js +++ b/models/cards.js @@ -182,7 +182,7 @@ Cards.helpers({ canBeRestored() { const list = Lists.findOne({_id: this.listId}); - if(list.wipLimit.enabled && list.wipLimit.value == list.cards().count()){ + if(list.getWipLimit() && list.getWipLimit('enabled') && list.getWipLimit('value') === list.cards().count()){ return false; } return true; -- cgit v1.2.3-1-g7c22