feat(core): adjust collection rules (#12268)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Trashed page titles are now visually indicated with a strikethrough style in collection editor dialogs.

- **Bug Fixes**
  - Trashed pages are now properly excluded from allowed lists and filtered views.

- **Refactor**
  - Improved filtering logic for collections and page lists, separating user filters from system filters for more consistent results.
  - Enhanced filter configuration options for more flexible and maintainable filtering behavior.

- **Style**
  - Added a new style for displaying trashed items with a strikethrough effect.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
EYHN
2025-05-14 07:04:56 +00:00
parent cecf545590
commit fa3b08274c
6 changed files with 159 additions and 81 deletions

View File

@@ -114,21 +114,34 @@ export const SelectPage = ({
useEffect(() => {
const subscription = collectionRulesService
.watch([
...filters,
{
type: 'system',
key: 'empty-journal',
method: 'is',
value: 'false',
},
{
type: 'system',
key: 'trash',
method: 'is',
value: 'false',
},
])
.watch({
filters:
filters.length > 0
? filters
: [
// if no filters are present, match all non-trash documents
{
type: 'system',
key: 'trash',
method: 'is',
value: 'false',
},
],
extraFilters: [
{
type: 'system',
key: 'empty-journal',
method: 'is',
value: 'false',
},
{
type: 'system',
key: 'trash',
method: 'is',
value: 'false',
},
],
})
.subscribe(result => {
setFilteredDocIds(result.groups.flatMap(group => group.items));
});