summaryrefslogtreecommitdiffstats
path: root/client/components/boards/boardBody.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-01-25 22:20:00 +0200
committerLauri Ojansivu <x@xet7.org>2019-01-25 22:20:00 +0200
commit95c178cee32d0c5a782ba0f39d717c1446eee22d (patch)
tree0e623b7087de42140cd12aeceb32a5ba85425649 /client/components/boards/boardBody.js
parent46a468b06dd5d4ca2338140bb2fd32958ccef85f (diff)
parentbe8f00ab8af080790758362d43c9efea2ed1b2eb (diff)
downloadwekan-95c178cee32d0c5a782ba0f39d717c1446eee22d.tar.gz
wekan-95c178cee32d0c5a782ba0f39d717c1446eee22d.tar.bz2
wekan-95c178cee32d0c5a782ba0f39d717c1446eee22d.zip
Merge branch 'edge' into meteor-1.8
Diffstat (limited to 'client/components/boards/boardBody.js')
-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;