diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-10-29 19:05:44 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-10-29 19:05:44 +0200 |
commit | 7d6d3af54a2fc1fb68634725eb754b22f02fd430 (patch) | |
tree | 8703d32a5489dfce95e026bc535d6459c1743784 /models/lists.js | |
parent | 13a2bd6380ced34a828b9469e48786ed21fcb380 (diff) | |
download | wekan-7d6d3af54a2fc1fb68634725eb754b22f02fd430.tar.gz wekan-7d6d3af54a2fc1fb68634725eb754b22f02fd430.tar.bz2 wekan-7d6d3af54a2fc1fb68634725eb754b22f02fd430.zip |
Add Features: allowing lists to be sorted by modifiedAt when not in draggable mode.
Bug Fix #2093: the broken should be prior to file attachment feature introduced, and tested export board is working.
Thanks to whowillcare !
( xet7 merged this pull request manually from https://github.com/wekan/wekan/pull/2756 )
Closes #2093
Diffstat (limited to 'models/lists.js')
-rw-r--r-- | models/lists.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/models/lists.js b/models/lists.js index 9136c337..f06b15b1 100644 --- a/models/lists.js +++ b/models/lists.js @@ -11,6 +11,15 @@ Lists.attachSchema( */ type: String, }, + starred: { + /** + * if a list is stared + * then we put it on the top + */ + type: Boolean, + optional: true, + defaultValue: false, + }, archived: { /** * is the list archived @@ -81,10 +90,14 @@ Lists.attachSchema( denyUpdate: false, // eslint-disable-next-line consistent-return autoValue() { - if (this.isInsert || this.isUpsert || this.isUpdate) { + // this is redundant with updatedAt + /*if (this.isInsert || this.isUpsert || this.isUpdate) { return new Date(); } else { this.unset(); + }*/ + if (!this.isSet) { + return new Date(); } }, }, @@ -252,6 +265,14 @@ Lists.helpers({ return this.type === 'template-list'; }, + isStarred() { + return this.starred === true; + }, + + absoluteUrl() { + const card = Cards.findOne({ listId: this._id }); + return card && card.absoluteUrl(); + }, remove() { Lists.remove({ _id: this._id }); }, @@ -261,6 +282,9 @@ Lists.mutations({ rename(title) { return { $set: { title } }; }, + star(enable = true) { + return { $set: { starred: !!enable } }; + }, archive() { if (this.isTemplateList()) { |