mirror of
https://github.com/wekan/wekan.git
synced 2026-02-03 07:01:47 +01:00
Add checklist items model, migration and publication
This commit is contained in:
parent
83848dbee2
commit
bf7de463f1
4 changed files with 116 additions and 26 deletions
|
|
@ -187,3 +187,24 @@ Migrations.add('add-views', () => {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
Migrations.add('add-checklist-items', () => {
|
||||
Checklists.find().forEach((checklist) => {
|
||||
// Create new items
|
||||
_.sortBy(checklist.items, 'sort').forEach((item) => {
|
||||
ChecklistItems.direct.insert({
|
||||
title: item.title,
|
||||
sort: item.sort,
|
||||
isFinished: item.isFinished,
|
||||
checklistId: checklist._id,
|
||||
cardId: checklist.cardId,
|
||||
});
|
||||
});
|
||||
|
||||
// Delete old ones
|
||||
Checklists.direct.update({ _id: checklist._id },
|
||||
{ $unset: { items : 1 } },
|
||||
noValidate
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ Meteor.publishRelations('board', function(boardId) {
|
|||
this.cursor(CardComments.find({ cardId }));
|
||||
this.cursor(Attachments.find({ cardId }));
|
||||
this.cursor(Checklists.find({ cardId }));
|
||||
this.cursor(ChecklistItems.find({ cardId }));
|
||||
});
|
||||
|
||||
if (board.members) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue