feat: Update default collection tab (#1821)

* feat: Allow listing root level documents only via documents.list

* feat: New tab on collection home

* update tab layout

* fix: Correctly sort index sorted documents.list

* revert: Tab layout changes

* fix: Missing route for recently published
fix: Redirect unknown tabs
This commit is contained in:
Tom Moor
2021-01-31 12:37:27 -08:00
committed by GitHub
parent 91ee3e62f2
commit 620e4942d8
5 changed files with 109 additions and 7 deletions

View File

@@ -111,6 +111,15 @@ export default class DocumentsStore extends BaseStore<Document> {
);
}
rootInCollection(collectionId: string): Document[] {
const collection = this.rootStore.collections.get(collectionId);
if (!collection) {
return [];
}
return compact(collection.documents.map((node) => this.get(node.id)));
}
leastRecentlyUpdatedInCollection(collectionId: string): Document[] {
return orderBy(this.inCollection(collectionId), "updatedAt", "asc");
}