Add template search in Add Card menu

Archive all cards in list when list is archived
Remove default board in link popup
Only list non-template boards in card link and search
This commit is contained in:
Andrés Manelli 2019-02-23 15:32:44 +01:00
parent 1e72177991
commit 7a6afb8aea
5 changed files with 57 additions and 31 deletions

View file

@ -470,6 +470,10 @@ Boards.helpers({
if (excludeLinked) {
query.linkedId = null;
}
if (this.isTemplatesBoard()) {
query.type = 'template-card';
query.archived = false;
}
const projection = { limit: 10, sort: { createdAt: -1 } };
if (term) {

View file

@ -195,10 +195,23 @@ Lists.mutations({
},
archive() {
Cards.find({
listId: this._id,
archived: false,
}).forEach((card) => {
return card.archive();
});
return { $set: { archived: true } };
},
restore() {
cardsToRestore = Cards.find({
listId: this._id,
archived: true,
});
cardsToRestore.forEach((card) => {
card.restore();
});
return { $set: { archived: false } };
},