summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authoramadilsons <joao.amado.95@gmail.com>2017-10-04 17:48:37 +0200
committeramadilsons <joao.amado.95@gmail.com>2017-10-04 17:48:37 +0200
commitc865bfe49785181d97b25cb683c0ed37d82c1a69 (patch)
tree5d796c8602f9001c3e91f9edbc73a83315750ad1 /models
parent089dbf0cf6a3e144d0271a8666d58e689f8c8dba (diff)
downloadwekan-c865bfe49785181d97b25cb683c0ed37d82c1a69.tar.gz
wekan-c865bfe49785181d97b25cb683c0ed37d82c1a69.tar.bz2
wekan-c865bfe49785181d97b25cb683c0ed37d82c1a69.zip
most work concluded, code needs clean up, further testing required
Diffstat (limited to 'models')
-rw-r--r--models/cards.js8
-rw-r--r--models/lists.js11
2 files changed, 9 insertions, 10 deletions
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({
diff --git a/models/lists.js b/models/lists.js
index 29dd28fb..442b9ee1 100644
--- a/models/lists.js
+++ b/models/lists.js
@@ -105,16 +105,7 @@ Lists.mutations({
},
toggleWipLimit(toggle) {
- console.log("toggle " + this.wipLimit.enabled)
- return { $set: { "wipLimit.enabled": !this.wipLimit.enabled } };
- },
-
- setWipLimitEnabled() {
- return { $set: { "wipLimit.enabled": true } };
- },
-
- setWipLimitDisabled() {
- return { $set: { "wipLimit.enabled": false } };
+ return { $set: { "wipLimit.enabled": toggle } };
},
setWipLimit(limit) {