From dd88eb4cc191a06f7eb84213b026dfb93546f245 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 24 Jan 2019 12:09:23 +0100 Subject: swimlane-view: have the swimlane header horizontal This allows to use the header as a separator between swimlanes. This will be most useful when we can set the background color of these headers. --- client/components/boards/boardBody.jade | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client/components/boards') diff --git a/client/components/boards/boardBody.jade b/client/components/boards/boardBody.jade index 9e4b9c61..382c04f3 100644 --- a/client/components/boards/boardBody.jade +++ b/client/components/boards/boardBody.jade @@ -23,6 +23,8 @@ template(name="boardBody") if isViewSwimlanes each currentBoard.swimlanes +swimlane(this) + if currentUser.isBoardMember + +addSwimlaneForm if isViewLists +listsGroup if isViewCalendar -- cgit v1.2.3-1-g7c22 From 416b17062e57f215206e93a85b02ef9eb1ab4902 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Thu, 24 Jan 2019 15:16:13 +0100 Subject: Remove the 'Add Swimlane' entry and replace it by a plus sign Still need to create the swimlane right after the one that has been created --- client/components/boards/boardBody.jade | 2 -- 1 file changed, 2 deletions(-) (limited to 'client/components/boards') diff --git a/client/components/boards/boardBody.jade b/client/components/boards/boardBody.jade index 382c04f3..9e4b9c61 100644 --- a/client/components/boards/boardBody.jade +++ b/client/components/boards/boardBody.jade @@ -23,8 +23,6 @@ template(name="boardBody") if isViewSwimlanes each currentBoard.swimlanes +swimlane(this) - if currentUser.isBoardMember - +addSwimlaneForm if isViewLists +listsGroup if isViewCalendar -- cgit v1.2.3-1-g7c22 From 5c6a725712a443b4d03b4f86262033ddfb66bc3d Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Fri, 25 Jan 2019 10:47:36 +0100 Subject: Make sure Swimlanes and Lists have a populated sort field When moving around the swimlanes or the lists, if one element has a sort with a null value, the computation of the new sort value is aborted, meaning that there are glitches in the UI. This happens on the first swimlane created with the new board, or when a swimlane or a list gets added through the API. --- client/components/boards/boardBody.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'client/components/boards') diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index ccbd0f23..ae5b67fd 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -35,6 +35,37 @@ BlazeComponent.extendComponent({ this._isDragging = false; // Used to set the overlay this.mouseHasEnterCardDetails = false; + + // fix swimlanes sort field if there are null values + const currentBoardData = Boards.findOne(Session.get('currentBoard')); + const nullSortSwimlanes = currentBoardData.nullSortSwimlanes(); + if (nullSortSwimlanes.count() > 0) { + const swimlanes = currentBoardData.swimlanes(); + let count = 0; + swimlanes.forEach((s) => { + Swimlanes.update(s._id, { + $set: { + sort: count, + }, + }); + count += 1; + }); + } + + // fix lists sort field if there are null values + const nullSortLists = currentBoardData.nullSortLists(); + if (nullSortLists.count() > 0) { + const lists = currentBoardData.lists(); + let count = 0; + lists.forEach((l) => { + Lists.update(l._id, { + $set: { + sort: count, + }, + }); + count += 1; + }); + } }, onRendered() { const boardComponent = this; -- cgit v1.2.3-1-g7c22