ソースを参照

Merge branch 'zebby76-devel' into devel

Lauri Ojansivu 7 年 前
コミット
bf7520c430
4 ファイル変更17 行追加5 行削除
  1. 8 0
      CHANGELOG.md
  2. 2 0
      models/trelloCreator.js
  3. 3 3
      models/users.js
  4. 4 2
      models/wekanCreator.js

+ 8 - 0
CHANGELOG.md

@@ -1,3 +1,11 @@
+# Upcoming Wekan release
+
+This release fixes the following bugs:
+
+- [Fix Wekan Import / Export lists not being sortable](https://github.com/wekan/wekan/commit/539c1ab87a098a7ddfd23cdbd663441bd609b73d).
+
+Thanks to GitHub user zebby76 for contributions.
+
 # v0.90 2018-05-01 Wekan release
 
 This release adds the following new features:

+ 2 - 0
models/trelloCreator.js

@@ -379,6 +379,7 @@ export class TrelloCreator {
         // we require.
         createdAt: this._now(this.createdAt.lists[list.id]),
         title: list.name,
+        sort: list.pos,
       };
       const listId = Lists.direct.insert(listToCreate);
       Lists.direct.update(listId, {$set: {'updatedAt': this._now()}});
@@ -410,6 +411,7 @@ export class TrelloCreator {
       // we require.
       createdAt: this._now(),
       title: 'Default',
+      sort: 1,
     };
     const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
     Swimlanes.direct.update(swimlaneId, {$set: {'updatedAt': this._now()}});

+ 3 - 3
models/users.js

@@ -566,10 +566,11 @@ if (Meteor.isServer) {
           Swimlanes.insert({
             title: TAPi18n.__('welcome-swimlane'),
             boardId,
+            sort: 1,
           }, fakeUser);
 
-          ['welcome-list1', 'welcome-list2'].forEach((title) => {
-            Lists.insert({title: TAPi18n.__(title), boardId}, fakeUser);
+          ['welcome-list1', 'welcome-list2'].forEach((title, titleIndex) => {
+            Lists.insert({title: TAPi18n.__(title), boardId, sort: titleIndex}, fakeUser);
           });
         });
       });
@@ -754,4 +755,3 @@ if (Meteor.isServer) {
     }
   });
 }
-

+ 4 - 2
models/wekanCreator.js

@@ -390,7 +390,7 @@ export class WekanCreator {
   }
 
   createLists(wekanLists, boardId) {
-    wekanLists.forEach((list) => {
+    wekanLists.forEach((list, listIndex) => {
       const listToCreate = {
         archived: list.archived,
         boardId,
@@ -400,6 +400,7 @@ export class WekanCreator {
         // we require.
         createdAt: this._now(this.createdAt.lists[list.id]),
         title: list.title,
+        sort: list.sort ? list.sort : listIndex,
       };
       const listId = Lists.direct.insert(listToCreate);
       Lists.direct.update(listId, {$set: {'updatedAt': this._now()}});
@@ -422,7 +423,7 @@ export class WekanCreator {
   }
 
   createSwimlanes(wekanSwimlanes, boardId) {
-    wekanSwimlanes.forEach((swimlane) => {
+    wekanSwimlanes.forEach((swimlane, swimlaneIndex) => {
       const swimlaneToCreate = {
         archived: swimlane.archived,
         boardId,
@@ -432,6 +433,7 @@ export class WekanCreator {
         // we require.
         createdAt: this._now(this.createdAt.swimlanes[swimlane._id]),
         title: swimlane.title,
+        sort: swimlane.sort ? swimlane.sort : swimlaneIndex,
       };
       const swimlaneId = Swimlanes.direct.insert(swimlaneToCreate);
       Swimlanes.direct.update(swimlaneId, {$set: {'updatedAt': this._now()}});