diff options
-rw-r--r-- | client/components/cards/cardTime.jade | 2 | ||||
-rw-r--r-- | client/components/cards/cardTime.js | 3 | ||||
-rw-r--r-- | client/components/cards/checklists.js | 4 | ||||
-rw-r--r-- | models/cards.js | 41 |
4 files changed, 37 insertions, 13 deletions
diff --git a/client/components/cards/cardTime.jade b/client/components/cards/cardTime.jade index 041af65a..8af8c414 100644 --- a/client/components/cards/cardTime.jade +++ b/client/components/cards/cardTime.jade @@ -6,7 +6,7 @@ template(name="editCardSpentTime") input.js-time-field#time(type="number" step="0.01" name="time" value="{{card.getSpentTime}}" placeholder=timeFormat autofocus) label(for="overtime") {{_ 'overtime'}} a.js-toggle-overtime - .materialCheckBox#overtime(class="{{#if card.getIsOvertime}}is-checked{{/if}}" name="overtime") + .materialCheckBox#overtime(class="{{#if getIsOvertime}}is-checked{{/if}}" name="overtime") if error.get .warning {{_ error.get}} diff --git a/client/components/cards/cardTime.js b/client/components/cards/cardTime.js index 9bab8e72..80b7fc84 100644 --- a/client/components/cards/cardTime.js +++ b/client/components/cards/cardTime.js @@ -64,9 +64,6 @@ BlazeComponent.extendComponent({ showTime() { return this.data().getSpentTime(); }, - isOvertime() { - return this.data().getIsOvertime(); - }, events() { return [{ 'click .js-edit-time': Popup.open('editCardSpentTime'), diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js index e014abba..5a612a51 100644 --- a/client/components/cards/checklists.js +++ b/client/components/cards/checklists.js @@ -74,8 +74,10 @@ BlazeComponent.extendComponent({ event.preventDefault(); const textarea = this.find('textarea.js-add-checklist-item'); const title = textarea.value.trim(); - const cardId = this.currentData().cardId; + let cardId = this.currentData().cardId; const card = Cards.findOne(cardId); + if (card.isImported()) + cardId = card.importedId; if (title) { Checklists.insert({ diff --git a/models/cards.js b/models/cards.js index 710b9d85..9a715ca3 100644 --- a/models/cards.js +++ b/models/cards.js @@ -204,7 +204,11 @@ Cards.helpers({ }, checklists() { - return Checklists.find({cardId: this._id}, {sort: { sort: 1 } }); + if (this.isImportedCard()) { + return Checklists.find({cardId: this.importedId}, {sort: { sort: 1 } }); + } else { + return Checklists.find({cardId: this._id}, {sort: { sort: 1 } }); + } }, checklistItemCount() { @@ -414,7 +418,10 @@ Cards.helpers({ const board = Boards.findOne({_id: this.importedId}); return Boards.update({_id: this.importedId}, {$set: {description}}); } else { - return {$set: {description}}; + return Cards.update( + {_id: this._id}, + {$set: {description}} + ); } }, @@ -511,7 +518,10 @@ Cards.helpers({ {$set: {receivedAt}} ); } else { - return {$set: {receivedAt}}; + return Cards.update( + {_id: this._id}, + {$set: {receivedAt}} + ); } }, @@ -539,7 +549,10 @@ Cards.helpers({ {$set: {startAt}} ); } else { - return {$set: {startAt}}; + return Cards.update( + {_id: this._id}, + {$set: {startAt}} + ); } }, @@ -567,7 +580,10 @@ Cards.helpers({ {$set: {dueAt}} ); } else { - return {$set: {dueAt}}; + return Cards.update( + {_id: this._id}, + {$set: {dueAt}} + ); } }, @@ -595,7 +611,10 @@ Cards.helpers({ {$set: {endAt}} ); } else { - return {$set: {endAt}}; + return Cards.update( + {_id: this._id}, + {$set: {endAt}} + ); } }, @@ -623,7 +642,10 @@ Cards.helpers({ {$set: {isOvertime}} ); } else { - return {$set: {isOvertime}}; + return Cards.update( + {_id: this._id}, + {$set: {isOvertime}} + ); } }, @@ -651,7 +673,10 @@ Cards.helpers({ {$set: {spentTime}} ); } else { - return {$set: {spentTime}}; + return Cards.update( + {_id: this._id}, + {$set: {spentTime}} + ); } }, }); |