mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Merge branch 'GhassenRjab-hotfix/sort-checklists-items' into devel
Fix: Checklist items are lost when moving items to another checklist. Thanks to GhassenRjab ! Related #876
This commit is contained in:
commit
5f697eac05
2 changed files with 33 additions and 1 deletions
|
|
@ -1,9 +1,15 @@
|
||||||
# Upcoming Wekan release
|
# Upcoming Wekan release
|
||||||
|
|
||||||
|
This release adds the following new features:
|
||||||
|
|
||||||
* [Add translations (en/de/fi) for email notifications regarding checklists and checklist
|
* [Add translations (en/de/fi) for email notifications regarding checklists and checklist
|
||||||
items](https://github.com/wekan/wekan/pull/1238).
|
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
|
# v0.39 2017-09-18 Wekan release
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,3 +130,29 @@ Migrations.add('add-member-isactive-field', () => {
|
||||||
Boards.update(board._id, {$set: {members: newMemberSet}}, noValidate);
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue