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