Avoid setting same card as parentCard.

Avoid listing templates board in copy/move/more menus
This commit is contained in:
Andrés Manelli 2019-03-06 20:54:35 +01:00
parent 18cccd514f
commit 745f39ed20

View file

@ -430,6 +430,7 @@ BlazeComponent.extendComponent({
const boards = Boards.find({ const boards = Boards.find({
archived: false, archived: false,
'members.userId': Meteor.userId(), 'members.userId': Meteor.userId(),
_id: {$ne: Meteor.user().getTemplatesBoardId()},
}, { }, {
sort: ['title'], sort: ['title'],
}); });
@ -589,6 +590,9 @@ BlazeComponent.extendComponent({
const boards = Boards.find({ const boards = Boards.find({
archived: false, archived: false,
'members.userId': Meteor.userId(), 'members.userId': Meteor.userId(),
_id: {
$ne: Meteor.user().getTemplatesBoardId(),
},
}, { }, {
sort: ['title'], sort: ['title'],
}); });
@ -596,8 +600,12 @@ BlazeComponent.extendComponent({
}, },
cards() { cards() {
const currentId = Session.get('currentCard');
if (this.parentBoard) { if (this.parentBoard) {
return this.parentBoard.cards(); return Cards.find({
boardId: this.parentBoard,
_id: {$ne: currentId},
});
} else { } else {
return []; return [];
} }