mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
feat(core): add collection rules module (#11683)
whats changed:
### orm
add a new `select$` method, can subscribe on only one field to improve batch subscribe performance
### yjs-observable
add a new `yjsObservePath` method, which can subscribe to changes from specific path in yjs. Improves batch subscribe performance
```ts
yjsGetPath(
this.workspaceService.workspace.rootYDoc.getMap('meta'),
'pages'
).pipe(
switchMap(pages => yjsObservePath(pages, '*.tags')),
map(pages => {
// only when tags changed
})
)
```
### standard property naming
All `DocProperty` components renamed to `WorkspaceProperty` which is consistent with the product definition.
### `WorkspacePropertyService`
Split the workspace property management logic from the `doc` module and create a new `WorkspacePropertyService`. The new service manages the creation and modification of properties, and the `docService` is only responsible for storing the property value data.
### new `<Filters />` component
in `core/component/filter`
### new `<ExplorerDisplayMenuButton />` component
in `core/component/explorer/display-menu`

### new `/workspace/xxx/all-new` route
New route for test components and functions
### new collection role service
Implemented some filter group order rules
see `collection-rules/index.ts`
### standard property type definition
define type in `modules\workspace-property\types.ts`

define components (name,icon,....) in `components\workspace-property-types\index.ts`

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced comprehensive filtering, grouping, and ordering capabilities for workspace documents with reactive updates.
- Added a new "All Pages" workspace view supporting dynamic filters and display preferences.
- Developed UI components for filter creation, condition editing, and display menu controls.
- Launched enhanced tag management with inline editors, selection, creation, and deletion workflows.
- Added workspace property types with dedicated filter UIs including checkbox, date, tags, and text.
- Introduced workspace property management replacing document property handling.
- Added modular providers for filters, group-by, and order-by operations supporting various property types and system attributes.
- **Improvements**
- Standardized tag and property naming conventions across the application (using `name` instead of `value` or `title`).
- Migrated document property handling to workspace property-centric logic.
- Enhanced internationalization with additional filter and display menu labels.
- Improved styling for filter conditions, display menus, and workspace pages.
- Optimized reactive data subscriptions and state management for performance.
- Refined schema typings and type safety for workspace properties.
- Updated imports and component references to workspace property equivalents throughout frontend.
- **Bug Fixes**
- Resolved tag property inconsistencies affecting display and filtering.
- Fixed filter and tag selection behaviors for accurate and reliable UI interactions.
- **Chores**
- Added and refined test cases for ORM, observables, and filtering logic.
- Cleaned up legacy document property code and improved type safety.
- Modularized and restructured components for better maintainability.
- Introduced new CSS styles for workspace pages and display menus.
- Added framework module configurations for collection rules and workspace property features.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"ar": 98,
|
||||
"ar": 97,
|
||||
"ca": 4,
|
||||
"da": 4,
|
||||
"de": 98,
|
||||
"el-GR": 98,
|
||||
"de": 97,
|
||||
"el-GR": 97,
|
||||
"en": 100,
|
||||
"es-AR": 98,
|
||||
"es-CL": 99,
|
||||
"es": 98,
|
||||
"fa": 98,
|
||||
"fr": 98,
|
||||
"es-AR": 97,
|
||||
"es-CL": 98,
|
||||
"es": 97,
|
||||
"fa": 97,
|
||||
"fr": 97,
|
||||
"hi": 2,
|
||||
"it-IT": 98,
|
||||
"it-IT": 97,
|
||||
"it": 1,
|
||||
"ja": 98,
|
||||
"ja": 97,
|
||||
"ko": 56,
|
||||
"pl": 98,
|
||||
"pt-BR": 98,
|
||||
"ru": 98,
|
||||
"sv-SE": 98,
|
||||
"uk": 98,
|
||||
"pl": 97,
|
||||
"pt-BR": 97,
|
||||
"ru": 97,
|
||||
"sv-SE": 97,
|
||||
"uk": 97,
|
||||
"ur": 2,
|
||||
"zh-Hans": 98,
|
||||
"zh-Hant": 98
|
||||
"zh-Hans": 97,
|
||||
"zh-Hant": 97
|
||||
}
|
||||
|
||||
@@ -1843,6 +1843,10 @@ export function useAFFiNEI18N(): {
|
||||
* `is`
|
||||
*/
|
||||
["com.affine.editCollection.rules.include.is"](): string;
|
||||
/**
|
||||
* `is-not`
|
||||
*/
|
||||
["com.affine.editCollection.rules.include.is-not"](): string;
|
||||
/**
|
||||
* `Doc`
|
||||
*/
|
||||
@@ -2085,6 +2089,10 @@ export function useAFFiNEI18N(): {
|
||||
* `Empty`
|
||||
*/
|
||||
["com.affine.filter.empty-tag"](): string;
|
||||
/**
|
||||
* `Empty`
|
||||
*/
|
||||
["com.affine.filter.empty"](): string;
|
||||
/**
|
||||
* `false`
|
||||
*/
|
||||
@@ -2109,6 +2117,42 @@ export function useAFFiNEI18N(): {
|
||||
* `Shared`
|
||||
*/
|
||||
["com.affine.filter.is-public"](): string;
|
||||
/**
|
||||
* `between`
|
||||
*/
|
||||
["com.affine.filter.between"](): string;
|
||||
/**
|
||||
* `last 3 days`
|
||||
*/
|
||||
["com.affine.filter.last 3 days"](): string;
|
||||
/**
|
||||
* `last 7 days`
|
||||
*/
|
||||
["com.affine.filter.last 7 days"](): string;
|
||||
/**
|
||||
* `last 15 days`
|
||||
*/
|
||||
["com.affine.filter.last 15 days"](): string;
|
||||
/**
|
||||
* `last 30 days`
|
||||
*/
|
||||
["com.affine.filter.last 30 days"](): string;
|
||||
/**
|
||||
* `this week`
|
||||
*/
|
||||
["com.affine.filter.this week"](): string;
|
||||
/**
|
||||
* `this month`
|
||||
*/
|
||||
["com.affine.filter.this month"](): string;
|
||||
/**
|
||||
* `this quarter`
|
||||
*/
|
||||
["com.affine.filter.this quarter"](): string;
|
||||
/**
|
||||
* `this year`
|
||||
*/
|
||||
["com.affine.filter.this year"](): string;
|
||||
/**
|
||||
* `last`
|
||||
*/
|
||||
@@ -2125,6 +2169,18 @@ export function useAFFiNEI18N(): {
|
||||
* `Add filter`
|
||||
*/
|
||||
["com.affine.filterList.button.add"](): string;
|
||||
/**
|
||||
* `Display`
|
||||
*/
|
||||
["com.affine.explorer.display-menu.button"](): string;
|
||||
/**
|
||||
* `Grouping`
|
||||
*/
|
||||
["com.affine.explorer.display-menu.grouping"](): string;
|
||||
/**
|
||||
* `Ordering`
|
||||
*/
|
||||
["com.affine.explorer.display-menu.ordering"](): string;
|
||||
/**
|
||||
* `View in Page mode`
|
||||
*/
|
||||
|
||||
@@ -459,6 +459,7 @@
|
||||
"com.affine.editCollection.rules.empty.noRules.tips": "Please <1>add rules</1> to save this collection or switch to <3>Docs</3>, use manual selection mode",
|
||||
"com.affine.editCollection.rules.include.add": "Add selected doc",
|
||||
"com.affine.editCollection.rules.include.is": "is",
|
||||
"com.affine.editCollection.rules.include.is-not": "is-not",
|
||||
"com.affine.editCollection.rules.include.page": "Doc",
|
||||
"com.affine.editCollection.rules.include.tips": "“Selected docs” refers to manually adding docs rather than automatically adding them through rule matching. You can manually add docs through the “Add selected docs” option or by dragging and dropping.",
|
||||
"com.affine.editCollection.rules.include.tipsTitle": "What is \"Selected docs\"?",
|
||||
@@ -521,16 +522,29 @@
|
||||
"com.affine.filter.does not contains all": "does not contains all",
|
||||
"com.affine.filter.does not contains one of": "does not contains one of",
|
||||
"com.affine.filter.empty-tag": "Empty",
|
||||
"com.affine.filter.empty": "Empty",
|
||||
"com.affine.filter.false": "false",
|
||||
"com.affine.filter.is": "is",
|
||||
"com.affine.filter.is empty": "is empty",
|
||||
"com.affine.filter.is not empty": "is not empty",
|
||||
"com.affine.filter.is-favourited": "Favourited",
|
||||
"com.affine.filter.is-public": "Shared",
|
||||
"com.affine.filter.between": "between",
|
||||
"com.affine.filter.last 3 days": "last 3 days",
|
||||
"com.affine.filter.last 7 days": "last 7 days",
|
||||
"com.affine.filter.last 15 days": "last 15 days",
|
||||
"com.affine.filter.last 30 days": "last 30 days",
|
||||
"com.affine.filter.this week": "this week",
|
||||
"com.affine.filter.this month": "this month",
|
||||
"com.affine.filter.this quarter": "this quarter",
|
||||
"com.affine.filter.this year": "this year",
|
||||
"com.affine.filter.last": "last",
|
||||
"com.affine.filter.save-view": "Save view",
|
||||
"com.affine.filter.true": "true",
|
||||
"com.affine.filterList.button.add": "Add filter",
|
||||
"com.affine.explorer.display-menu.button": "Display",
|
||||
"com.affine.explorer.display-menu.grouping": "Grouping",
|
||||
"com.affine.explorer.display-menu.ordering": "Ordering",
|
||||
"com.affine.header.mode-switch.page": "View in Page mode",
|
||||
"com.affine.header.mode-switch.edgeless": "View in Edgeless Canvas",
|
||||
"com.affine.header.option.add-tag": "Add tag",
|
||||
|
||||
Reference in New Issue
Block a user