Added ability to change card's parent.

This commit is contained in:
Nicu Tofan 2018-06-26 17:39:31 +03:00
parent 439d7c3dbc
commit b7d508e8c4
No known key found for this signature in database
GPG key ID: 7EE66E95E64FD0B7
5 changed files with 157 additions and 31 deletions

View file

@ -220,6 +220,10 @@ Boards.helpers({
return Swimlanes.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } });
},
cards() {
return Cards.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } });
},
hasOvertimeCards(){
const card = Cards.findOne({isOvertime: true, boardId: this._id, archived: false} );
return card !== undefined;

View file

@ -327,10 +327,14 @@ Cards.helpers({
},
parentCardName() {
if (this.parentId === '') {
return '';
let result = '';
if (this.parentId !== '') {
const card = Cards.findOne(this.parentId);
if (card) {
result = card.title;
}
}
return Cards.findOne(this.parentId).title;
return result;
},
parentListId() {
@ -541,6 +545,11 @@ Cards.mutations({
unsetSpentTime() {
return {$unset: {spentTime: '', isOvertime: false}};
},
setParentId(parentId) {
return {$set: {parentId}};
},
});