summaryrefslogtreecommitdiffstats
path: root/models/lists.js
diff options
context:
space:
mode:
authoramadilsons <joao.amado.95@gmail.com>2017-10-04 11:12:52 +0200
committeramadilsons <joao.amado.95@gmail.com>2017-10-04 11:12:52 +0200
commit089dbf0cf6a3e144d0271a8666d58e689f8c8dba (patch)
treec77d1063e881065f5faf70fe397fd14bbfc8f368 /models/lists.js
parenta918d36533bd61765f954f60c0e3af78b014907a (diff)
downloadwekan-089dbf0cf6a3e144d0271a8666d58e689f8c8dba.tar.gz
wekan-089dbf0cf6a3e144d0271a8666d58e689f8c8dba.tar.bz2
wekan-089dbf0cf6a3e144d0271a8666d58e689f8c8dba.zip
on its way
Diffstat (limited to 'models/lists.js')
-rw-r--r--models/lists.js28
1 files changed, 27 insertions, 1 deletions
diff --git a/models/lists.js b/models/lists.js
index 837af73c..29dd28fb 100644
--- a/models/lists.js
+++ b/models/lists.js
@@ -43,9 +43,22 @@ Lists.attachSchema(new SimpleSchema({
},
},
wipLimit: {
+ type: Object,
+ optional: true,
+ },
+ "wipLimit.value": {
type: SimpleSchema.Integer,
optional: true,
},
+ "wipLimit.enabled":{
+ type: Boolean,
+ autoValue() {
+ if(this.isInsert){
+ return false;
+ }
+ },
+ optional: true,
+ },
}));
Lists.allow({
@@ -91,8 +104,21 @@ Lists.mutations({
return { $set: { archived: false } };
},
+ 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 } };
+ },
+
setWipLimit(limit) {
- return { $set: { wipLimit: limit } };
+ return { $set: { "wipLimit.value": limit } };
},
});