summaryrefslogtreecommitdiffstats
path: root/client/components/boards
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-01-25 19:05:09 +0200
committerGitHub <noreply@github.com>2019-01-25 19:05:09 +0200
commitba15526516e1754385d2d6404d64ae9cead3ce95 (patch)
tree29834be1c70610ea3373e03c64891a6b35569fd1 /client/components/boards
parent542cc75dc4a4bf392cac72345ab013cf59c67ad3 (diff)
parent6c3dbc3c6f52a42ddbeeaec9bbfcc82c1c839f7d (diff)
downloadwekan-ba15526516e1754385d2d6404d64ae9cead3ce95.tar.gz
wekan-ba15526516e1754385d2d6404d64ae9cead3ce95.tar.bz2
wekan-ba15526516e1754385d2d6404d64ae9cead3ce95.zip
Merge pull request #2126 from bentiss/color-swimlanes
Color for swimlanes
Diffstat (limited to 'client/components/boards')
-rw-r--r--client/components/boards/boardBody.js31
1 files changed, 31 insertions, 0 deletions
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;