mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
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:
@@ -37,6 +37,16 @@ export const SystemFilterCondition = ({
|
||||
const methods = type.filterMethod;
|
||||
const Value = type.filterValue;
|
||||
|
||||
if (!methods || !Value) {
|
||||
return (
|
||||
<UnknownFilterCondition
|
||||
isDraft={isDraft}
|
||||
onDraftCompleted={onDraftCompleted}
|
||||
filter={filter}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Condition
|
||||
filter={filter}
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
MemberIcon,
|
||||
TagIcon,
|
||||
TemplateIcon,
|
||||
TitleIcon,
|
||||
} from '@blocksuite/icons/rc';
|
||||
|
||||
import type { GroupHeaderProps } from '../explorer/types';
|
||||
@@ -55,6 +56,11 @@ import {
|
||||
} from './template';
|
||||
|
||||
export const SystemPropertyTypes = {
|
||||
title: {
|
||||
icon: TitleIcon,
|
||||
name: 'Title',
|
||||
allowInOrderBy: true,
|
||||
},
|
||||
tags: {
|
||||
icon: TagIcon,
|
||||
name: 'Tags',
|
||||
@@ -213,8 +219,8 @@ export const SystemPropertyTypes = {
|
||||
|
||||
allowInOrderBy?: boolean;
|
||||
allowInGroupBy?: boolean;
|
||||
filterMethod: { [key: string]: I18nString };
|
||||
filterValue: React.FC<{
|
||||
filterMethod?: { [key: string]: I18nString };
|
||||
filterValue?: React.FC<{
|
||||
filter: FilterParams;
|
||||
isDraft?: boolean;
|
||||
onDraftCompleted?: () => void;
|
||||
|
||||
Reference in New Issue
Block a user