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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user