mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Initial implementation for subtasks
This commit is contained in:
parent
b627ced605
commit
d59583915c
13 changed files with 478 additions and 34 deletions
|
|
@ -215,6 +215,27 @@ Cards.helpers({
|
|||
return this.checklistItemCount() !== 0;
|
||||
},
|
||||
|
||||
subtasks() {
|
||||
return Subtasks.find({cardId: this._id}, {sort: { sort: 1 } });
|
||||
},
|
||||
|
||||
subtasksCount() {
|
||||
return Subtasks.find({cardId: this._id}).count();
|
||||
},
|
||||
|
||||
subtasksFinishedCount() {
|
||||
return Subtasks.find({cardId: this._id, isFinished: true}).count();
|
||||
},
|
||||
|
||||
subtasksFinished() {
|
||||
const finishCount = this.subtasksFinishedCount();
|
||||
return finishCount > 0 && this.subtasksCount() === finishCount;
|
||||
},
|
||||
|
||||
hasSubtasks() {
|
||||
return this.subtasksCount() !== 0;
|
||||
},
|
||||
|
||||
customFieldIndex(customFieldId) {
|
||||
return _.pluck(this.customFields, '_id').indexOf(customFieldId);
|
||||
},
|
||||
|
|
@ -513,6 +534,9 @@ function cardRemover(userId, doc) {
|
|||
Checklists.remove({
|
||||
cardId: doc._id,
|
||||
});
|
||||
Subtasks.remove({
|
||||
cardId: doc._id,
|
||||
});
|
||||
CardComments.remove({
|
||||
cardId: doc._id,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue