summaryrefslogtreecommitdiffstats
path: root/client/components/lists
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-08-21 22:20:45 +0200
committerAndrés Manelli <andresmanelli@gmail.com>2018-08-21 22:21:23 +0200
commit3e715bbcc9e2cf3aad043dc7ab0ed76b519e80eb (patch)
treeb36727b738aeda55d0c047d5e56ae19ec2d2b82c /client/components/lists
parentb881c3b90824576ffcc75c7160a66c2314dab615 (diff)
downloadwekan-3e715bbcc9e2cf3aad043dc7ab0ed76b519e80eb.tar.gz
wekan-3e715bbcc9e2cf3aad043dc7ab0ed76b519e80eb.tar.bz2
wekan-3e715bbcc9e2cf3aad043dc7ab0ed76b519e80eb.zip
Fix and improve linked cards
Diffstat (limited to 'client/components/lists')
-rw-r--r--client/components/lists/listBody.jade2
-rw-r--r--client/components/lists/listBody.js13
2 files changed, 8 insertions, 7 deletions
diff --git a/client/components/lists/listBody.jade b/client/components/lists/listBody.jade
index 8069717e..f2b3e941 100644
--- a/client/components/lists/listBody.jade
+++ b/client/components/lists/listBody.jade
@@ -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'}}")
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 83592a64..896bf178 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -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();