compatiblity with old saved searches
This commit is contained in:
@ -159,7 +159,7 @@ const createDefaultFiltersForUser =
|
||||
name: 'Continue Reading',
|
||||
filter: 'in:inbox sort:read-desc is:reading',
|
||||
},
|
||||
{ name: 'Non-Feed Items', filter: 'in:library' },
|
||||
{ name: 'Non-Feed Items', filter: 'no:subscription' },
|
||||
{ name: 'Highlights', filter: 'has:highlights mode:highlights' },
|
||||
{ name: 'Unlabeled', filter: 'no:label' },
|
||||
{ name: 'Oldest First', filter: 'sort:saved-asc' },
|
||||
|
||||
@ -232,7 +232,9 @@ const buildWhereClause = (
|
||||
|
||||
if (args.noFilters) {
|
||||
args.noFilters.forEach((filter) => {
|
||||
queryBuilder.andWhere(`library_item.${filter.field} = '{}'`)
|
||||
queryBuilder.andWhere(
|
||||
`library_item.${filter.field} = '{}' OR library_item.${filter.field} IS NULL`
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -386,13 +386,20 @@ const parseNoFilter = (str?: string): NoFilter | undefined => {
|
||||
return { field: 'highlight_annotations' }
|
||||
case 'label':
|
||||
return { field: 'label_names' }
|
||||
case 'subscription':
|
||||
return { field: 'subscription' }
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
export const parseSearchQuery = (query: string | undefined): SearchFilter => {
|
||||
const searchQuery = query ? query.replace(/\W\s":/g, '') : undefined
|
||||
const searchQuery = query
|
||||
? query
|
||||
.replace(/\W\s":/g, '')
|
||||
.replace('in:subscription', 'has:subscriptions') // compatibility with old search
|
||||
.replace('in:library', 'no:subscription') // compatibility with old search
|
||||
: undefined
|
||||
const result: SearchFilter = {
|
||||
query: searchQuery,
|
||||
readFilter: ReadFilter.ALL,
|
||||
|
||||
@ -169,7 +169,7 @@ export const EmptyLibrary = (props: EmptyLibraryProps) => {
|
||||
return 'inbox'
|
||||
case 'in:inbox sort:read-desc is:reading':
|
||||
return 'continue'
|
||||
case 'in:library':
|
||||
case 'no:subscription':
|
||||
return 'non-feed'
|
||||
case 'has:highlights mode:highlights':
|
||||
return 'highlight'
|
||||
@ -181,7 +181,7 @@ export const EmptyLibrary = (props: EmptyLibraryProps) => {
|
||||
return 'archive'
|
||||
case 'label:RSS':
|
||||
return 'feed'
|
||||
case 'in:subscription':
|
||||
case 'has:subscriptions':
|
||||
return 'subscription'
|
||||
case 'label:Newsletter':
|
||||
return 'newsletter'
|
||||
|
||||
@ -241,7 +241,7 @@ function Subscriptions(
|
||||
>
|
||||
{!collapsed ? (
|
||||
<>
|
||||
<FilterButton filterTerm="in:subscription" text="All" {...props} />
|
||||
<FilterButton filterTerm="has:subscriptions" text="All" {...props} />
|
||||
<FilterButton filterTerm={`label:RSS`} text="Feeds" {...props} />
|
||||
<FilterButton
|
||||
filterTerm={`label:Newsletter`}
|
||||
|
||||
Reference in New Issue
Block a user