summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md8
-rw-r--r--server/migrations.js26
2 files changed, 33 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d59528b..2c7add5d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,15 @@
# Upcoming Wekan release
+This release adds the following new features:
+
* [Add translations (en/de/fi) for email notifications regarding checklists and checklist
items](https://github.com/wekan/wekan/pull/1238).
-Thanks to GitHub users umbertooo and xet7 for their contributions.
+and fixes the following bugs:
+
+* [Checklist items are lost when moving items to another checklist](https://github.com/wekan/wekan/pull/1240).
+
+Thanks to GitHub users GhassenRjab, umbertooo and xet7 for their contributions.
# v0.39 2017-09-18 Wekan release
diff --git a/server/migrations.js b/server/migrations.js
index 99125976..40420e8e 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -130,3 +130,29 @@ Migrations.add('add-member-isactive-field', () => {
Boards.update(board._id, {$set: {members: newMemberSet}}, noValidate);
});
});
+
+Migrations.add('add-sort-checklists', () => {
+ Checklists.find().forEach((checklist, index) => {
+ if (!checklist.hasOwnProperty('sort')) {
+ Checklists.direct.update(
+ checklist._id,
+ {
+ $set: {
+ sort: index,
+ newItemIndex: checklist.items.length,
+ },
+ },
+ noValidate
+ );
+ }
+ checklist.items.forEach(function(item, index) {
+ if (!item.hasOwnProperty('sort')) {
+ Checklists.direct.update(
+ { _id: checklist._id, 'items._id': item._id },
+ { $set: { 'items.$.sort': index } },
+ noValidate
+ );
+ }
+ });
+ });
+});