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 --- client/components/lists/listBody.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'client/components/lists/listBody.js') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 724e805b..5ae645a9 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -96,6 +96,15 @@ BlazeComponent.extendComponent({ MultiSelection.toggle(this.currentData()._id); }, + canSeeAddCard() { + return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly(); + }, + + reachedWipLimit() { + const list = Template.currentData(); + return list.wipLimit.enabled && list.wipLimit.value == list.cards().count(); + }, + events() { return [{ 'click .js-minicard': this.clickOnMiniCard, @@ -239,10 +248,3 @@ BlazeComponent.extendComponent({ }); }, }).register('addCardForm'); - - -Template.listBody.helpers({ - canSeeAddCard() { - return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly(); - }, -}); -- 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 --- client/components/lists/listBody.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client/components/lists/listBody.js') diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 5ae645a9..22ed9e57 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -102,7 +102,8 @@ BlazeComponent.extendComponent({ reachedWipLimit() { const list = Template.currentData(); - return list.wipLimit.enabled && list.wipLimit.value == list.cards().count(); + if( !list.getWipLimit() ) { return false; } + return list.getWipLimit('enabled') && list.getWipLimit('value') === list.cards().count(); }, events() { -- cgit v1.2.3-1-g7c22