Przeglądaj źródła

Add card on first swimlane found

Andrés Manelli 7 lat temu
rodzic
commit
af119ff7c0
1 zmienionych plików z 8 dodań i 1 usunięć
  1. 8 1
      client/components/lists/listBody.js

+ 8 - 1
client/components/lists/listBody.js

@@ -36,7 +36,14 @@ BlazeComponent.extendComponent({
     const members = formComponent.members.get();
     const labelIds = formComponent.labels.get();
 
-    const swimlaneId = this.parentComponent().parentComponent().data()._id;
+    const boardId = this.data().board()._id;
+    const board = Boards.findOne(boardId);
+    let swimlaneId = '';
+    if (board.view === 'board-view-swimlanes')
+      swimlaneId = this.parentComponent().parentComponent().data()._id;
+    else
+      swimlaneId = Swimlanes.findOne({boardId})._id;
+
     if (title) {
       const _id = Cards.insert({
         title,