feat(core): add title order by (#12696)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for ordering documents by their title. - Introduced a new "title" system property type with an associated icon and display name. - **Improvements** - Enhanced system property types to allow more flexible filtering options. - Improved filter condition handling to show an unknown filter UI when filtering methods or values are unavailable. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -81,6 +81,10 @@ export class DocsService extends Service {
|
||||
return this.store.watchTrashDocIds();
|
||||
}
|
||||
|
||||
allDocTitle$() {
|
||||
return this.store.watchAllDocTitle();
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly store: DocsStore,
|
||||
private readonly docPropertiesStore: DocPropertiesStore,
|
||||
|
||||
@@ -142,6 +142,25 @@ export class DocsStore extends Store {
|
||||
);
|
||||
}
|
||||
|
||||
watchAllDocTitle() {
|
||||
return yjsGetPath(
|
||||
this.workspaceService.workspace.rootYDoc.getMap('meta'),
|
||||
'pages'
|
||||
).pipe(
|
||||
switchMap(pages => yjsObservePath(pages, '*.title')),
|
||||
map(pages => {
|
||||
if (pages instanceof YArray) {
|
||||
return pages.map(v => ({
|
||||
id: v.get('id') as string,
|
||||
title: (v.get('title') ?? '') as string,
|
||||
}));
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
watchNonTrashDocIds() {
|
||||
return yjsGetPath(
|
||||
this.workspaceService.workspace.rootYDoc.getMap('meta'),
|
||||
|
||||
Reference in New Issue
Block a user