implement getDefaultSwimline for boards

This commit is contained in:
Nicu Tofan 2018-06-25 22:01:02 +03:00
parent aead18eb58
commit 04745f0c2f
No known key found for this signature in database
GPG key ID: 7EE66E95E64FD0B7
4 changed files with 15 additions and 11 deletions

View file

@ -337,6 +337,18 @@ Boards.helpers({
getDefaultSubtasksList() {
return Lists.findOne(this.getDefaultSubtasksListId());
},
getDefaultSwimline() {
let result = Swimlanes.findOne({boardId: this._id});
if (result === undefined) {
Swimlanes.insert({
title: TAPi18n.__('default'),
boardId: this._id,
});
result = Swimlanes.findOne({boardId: this._id});
}
return result;
},
});