mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
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
This commit is contained in:
parent
13a2bd6380
commit
7d6d3af54a
29 changed files with 475 additions and 41 deletions
|
|
@ -409,6 +409,23 @@ Boards.helpers({
|
|||
},
|
||||
|
||||
lists() {
|
||||
const enabled = Meteor.user().hasSortBy();
|
||||
return enabled ? this.newestLists() : this.draggableLists();
|
||||
},
|
||||
|
||||
newestLists() {
|
||||
// sorted lists from newest to the oldest, by its creation date or its cards' last modification date
|
||||
const value = Meteor.user()._getListSortBy();
|
||||
const sortKey = { starred: -1, [value[0]]: value[1] }; // [["starred",-1],value];
|
||||
return Lists.find(
|
||||
{
|
||||
boardId: this._id,
|
||||
archived: false,
|
||||
},
|
||||
{ sort: sortKey },
|
||||
);
|
||||
},
|
||||
draggableLists() {
|
||||
return Lists.find({ boardId: this._id }, { sort: { sort: 1 } });
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue