Link description

This commit is contained in:
Andrés Manelli 2018-04-16 16:38:20 -03:00
parent 5644ef66af
commit 64367a01dd
7 changed files with 50 additions and 19 deletions

View file

@ -393,6 +393,39 @@ Cards.helpers({
isTopLevel() {
return this.parentId === '';
},
isImportedCard() {
return this.type === 'cardType-importedCard';
},
isImportedBoard() {
return this.type === 'cardType-importedBoard';
},
isImported() {
return this.isImportedCard() || this.isImportedBoard();
},
getDescription() {
if (this.isImportedCard()) {
const card = Cards.findOne({_id: this.importedId});
if (card && card.description)
return card.description;
else
return null;
} else if (this.isImportedBoard()) {
const board = Boards.findOne({_id: this.importedId});
if (board && board.description)
return board.description;
else
return null;
} else {
if (this.description)
return this.description;
else
return null;
}
},
});
Cards.mutations({