mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Prepare to create card from template
This commit is contained in:
parent
7a6afb8aea
commit
0fec711545
7 changed files with 57 additions and 60 deletions
|
|
@ -456,6 +456,7 @@ BlazeComponent.extendComponent({
|
|||
archived: false,
|
||||
linkedId: {$nin: ownCardsIds},
|
||||
_id: {$nin: ownCardsIds},
|
||||
type: {$nin: ['template-card']},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -523,16 +524,16 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
onCreated() {
|
||||
const isTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-search-template');
|
||||
this.isTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-search-template');
|
||||
let board = {};
|
||||
if (isTemplateSearch) {
|
||||
if (this.isTemplateSearch) {
|
||||
board = Boards.findOne(Meteor.user().profile.templatesBoardId);
|
||||
} else {
|
||||
// Prefetch first non-current board id
|
||||
board = Boards.findOne({
|
||||
archived: false,
|
||||
'members.userId': Meteor.userId(),
|
||||
_id: {$ne: Session.get('currentBoard')},
|
||||
_id: {$nin: [Session.get('currentBoard'), Meteor.user().profile.templatesBoardId]},
|
||||
});
|
||||
}
|
||||
if (!board) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue