From c075187088e69d30db31489d75b22f991e1972ff Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 24 Jan 2019 20:45:52 +0100 Subject: swimlane: insert the new swimlane after the one we clicked on --- models/boards.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index 99480ca7..d92bec47 100644 --- a/models/boards.js +++ b/models/boards.js @@ -351,6 +351,17 @@ Boards.helpers({ return Swimlanes.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } }); }, + nextSwimlane(swimlane) { + return Swimlanes.findOne({ + boardId: this._id, + archived: false, + sort: { $gte: swimlane.sort }, + _id: { $ne: swimlane._id }, + }, { + sort: { sort: 1 }, + }); + }, + hasOvertimeCards(){ const card = Cards.findOne({isOvertime: true, boardId: this._id, archived: false} ); return card !== undefined; -- cgit v1.2.3-1-g7c22