mirror of
https://github.com/wekan/wekan.git
synced 2026-03-05 05:10:15 +01:00
Add Feature: allow user to sort Lists in Board by his own preference, boardadmin can star list
This commit is contained in:
parent
2737d6b23f
commit
bc2a20f04e
15 changed files with 272 additions and 14 deletions
|
|
@ -409,18 +409,20 @@ Boards.helpers({
|
|||
},
|
||||
|
||||
lists() {
|
||||
const enabled = Meteor.user().hasShowDesktopDragHandles();
|
||||
return enabled ? this.draggableLists() : this.newestLists();
|
||||
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: { updatedAt: -1 } },
|
||||
{ sort: sortKey },
|
||||
);
|
||||
},
|
||||
draggableLists() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue