feat: Allow sorting collections in sidebar (#1870)
closes #1759 Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@ -17,9 +17,10 @@ export default class Collection extends BaseModel {
|
||||
color: string;
|
||||
private: boolean;
|
||||
sharing: boolean;
|
||||
index: string;
|
||||
documents: NavigationNode[];
|
||||
createdAt: ?string;
|
||||
updatedAt: ?string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
deletedAt: ?string;
|
||||
sort: { field: string, direction: "asc" | "desc" };
|
||||
url: string;
|
||||
@ -67,6 +68,11 @@ export default class Collection extends BaseModel {
|
||||
travelDocuments(this.documents);
|
||||
}
|
||||
|
||||
@action
|
||||
updateIndex(index: string) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
getDocumentChildren(documentId: string): NavigationNode[] {
|
||||
let result = [];
|
||||
const traveler = (nodes) => {
|
||||
@ -117,6 +123,7 @@ export default class Collection extends BaseModel {
|
||||
"icon",
|
||||
"private",
|
||||
"sort",
|
||||
"index",
|
||||
]);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user