mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Merge branch 'andresmanelli-devel' into devel
This commit is contained in:
commit
3e0352c586
3 changed files with 16 additions and 7 deletions
|
@ -70,7 +70,7 @@ template(name="linkCardPopup")
|
|||
label {{_ 'cards'}}:
|
||||
select.js-select-cards
|
||||
each cards
|
||||
option(value="{{_id}}") {{title}}
|
||||
option(value="{{getId}}") {{getTitle}}
|
||||
|
||||
.edit-controls.clearfix
|
||||
input.primary.confirm.js-done(type="button" value="{{_ 'link'}}")
|
||||
|
|
|
@ -333,21 +333,22 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
cards() {
|
||||
const ownCardsIds = this.board.cards().map((card) => { return card.linkedId || card._id; });
|
||||
return Cards.find({
|
||||
boardId: this.selectedBoardId.get(),
|
||||
swimlaneId: this.selectedSwimlaneId.get(),
|
||||
listId: this.selectedListId.get(),
|
||||
archived: false,
|
||||
linkedId: null,
|
||||
_id: {$nin: this.board.cards().map((card) => { return card.linkedId || card._id; })},
|
||||
linkedId: {$nin: ownCardsIds},
|
||||
_id: {$nin: ownCardsIds},
|
||||
});
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'change .js-select-boards'(evt) {
|
||||
subManager.subscribe('board', $(evt.currentTarget).val());
|
||||
this.selectedBoardId.set($(evt.currentTarget).val());
|
||||
subManager.subscribe('board', this.selectedBoardId.get());
|
||||
},
|
||||
'change .js-select-swimlanes'(evt) {
|
||||
this.selectedSwimlaneId.set($(evt.currentTarget).val());
|
||||
|
@ -438,14 +439,14 @@ BlazeComponent.extendComponent({
|
|||
|
||||
results() {
|
||||
const board = Boards.findOne(this.selectedBoardId.get());
|
||||
return board.searchCards(this.term.get(), true);
|
||||
return board.searchCards(this.term.get(), false);
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'change .js-select-boards'(evt) {
|
||||
subManager.subscribe('board', $(evt.currentTarget).val());
|
||||
this.selectedBoardId.set($(evt.currentTarget).val());
|
||||
subManager.subscribe('board', this.selectedBoardId.get());
|
||||
},
|
||||
'submit .js-search-term-form'(evt) {
|
||||
evt.preventDefault();
|
||||
|
@ -461,7 +462,7 @@ BlazeComponent.extendComponent({
|
|||
boardId: this.boardId,
|
||||
sort: Lists.findOne(this.listId).cards().count(),
|
||||
type: 'cardType-linkedCard',
|
||||
linkedId: card._id,
|
||||
linkedId: card.linkedId || card._id,
|
||||
});
|
||||
Filter.addException(_id);
|
||||
Popup.close();
|
||||
|
|
|
@ -712,6 +712,14 @@ Cards.helpers({
|
|||
}
|
||||
},
|
||||
|
||||
getId() {
|
||||
if (this.isLinked()) {
|
||||
return this.linkedId;
|
||||
} else {
|
||||
return this._id;
|
||||
}
|
||||
},
|
||||
|
||||
getTitle() {
|
||||
if (this.isLinkedCard()) {
|
||||
const card = Cards.findOne({ _id: this.linkedId });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue