Merge branch 'card-spent-time' of https://github.com/thuanpq/wekan into thuanpq-card-spent-time

This commit is contained in:
Lauri Ojansivu 2017-11-21 10:03:02 +02:00
commit e162fe3c0f
12 changed files with 215 additions and 6 deletions

View file

@ -64,8 +64,18 @@ Cards.attachSchema(new SimpleSchema({
type: Date,
optional: true,
},
// XXX Should probably be called `authorId`. Is it even needed since we have
// the `members` field?
spentTime: {
type: Number,
decimal: true,
optional: true,
},
isOvertime: {
type: Boolean,
defaultValue: false,
optional: true,
},
// XXX Should probably be called `authorId`. Is it even needed since we have
// the `members` field?
userId: {
type: String,
autoValue() { // eslint-disable-line consistent-return
@ -273,6 +283,18 @@ Cards.mutations({
unsetDue() {
return {$unset: {dueAt: ''}};
},
setOvertime(isOvertime) {
return {$set: {isOvertime}};
},
setSpentTime(spentTime) {
return {$set: {spentTime}};
},
unsetSpentTime() {
return {$unset: {spentTime: '', isOvertime: false}};
},
});