mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
Feature: global search, keyboard shortcuts / hotkey support (#6449)
This commit is contained in:
14
src-ui/src/app/data/datatype.ts
Normal file
14
src-ui/src/app/data/datatype.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export enum DataType {
|
||||
Document = 'document',
|
||||
SavedView = 'saved_view',
|
||||
Correspondent = 'correspondent',
|
||||
DocumentType = 'document_type',
|
||||
StoragePath = 'storage_path',
|
||||
Tag = 'tag',
|
||||
User = 'user',
|
||||
Group = 'group',
|
||||
MailAccount = 'mail_account',
|
||||
MailRule = 'mail_rule',
|
||||
CustomField = 'custom_field',
|
||||
Workflow = 'workflow',
|
||||
}
|
@@ -1,3 +1,5 @@
|
||||
import { DataType } from './datatype'
|
||||
|
||||
// These correspond to src/documents/models.py and changes here require a DB migration (and vice versa)
|
||||
export const FILTER_TITLE = 0
|
||||
export const FILTER_CONTENT = 1
|
||||
@@ -78,57 +80,57 @@ export const FILTER_RULE_TYPES: FilterRuleType[] = [
|
||||
id: FILTER_CORRESPONDENT,
|
||||
filtervar: 'correspondent__id',
|
||||
isnull_filtervar: 'correspondent__isnull',
|
||||
datatype: 'correspondent',
|
||||
datatype: DataType.Correspondent,
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
id: FILTER_HAS_CORRESPONDENT_ANY,
|
||||
filtervar: 'correspondent__id__in',
|
||||
datatype: 'correspondent',
|
||||
datatype: DataType.Correspondent,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
id: FILTER_DOES_NOT_HAVE_CORRESPONDENT,
|
||||
filtervar: 'correspondent__id__none',
|
||||
datatype: 'correspondent',
|
||||
datatype: DataType.Correspondent,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
id: FILTER_STORAGE_PATH,
|
||||
filtervar: 'storage_path__id',
|
||||
isnull_filtervar: 'storage_path__isnull',
|
||||
datatype: 'storage_path',
|
||||
datatype: DataType.StoragePath,
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
id: FILTER_HAS_STORAGE_PATH_ANY,
|
||||
filtervar: 'storage_path__id__in',
|
||||
datatype: 'storage_path',
|
||||
datatype: DataType.StoragePath,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
id: FILTER_DOES_NOT_HAVE_STORAGE_PATH,
|
||||
filtervar: 'storage_path__id__none',
|
||||
datatype: 'storage_path',
|
||||
datatype: DataType.StoragePath,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
id: FILTER_DOCUMENT_TYPE,
|
||||
filtervar: 'document_type__id',
|
||||
isnull_filtervar: 'document_type__isnull',
|
||||
datatype: 'document_type',
|
||||
datatype: DataType.DocumentType,
|
||||
multi: false,
|
||||
},
|
||||
{
|
||||
id: FILTER_HAS_DOCUMENT_TYPE_ANY,
|
||||
filtervar: 'document_type__id__in',
|
||||
datatype: 'document_type',
|
||||
datatype: DataType.DocumentType,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
id: FILTER_DOES_NOT_HAVE_DOCUMENT_TYPE,
|
||||
filtervar: 'document_type__id__none',
|
||||
datatype: 'document_type',
|
||||
datatype: DataType.DocumentType,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
@@ -141,19 +143,19 @@ export const FILTER_RULE_TYPES: FilterRuleType[] = [
|
||||
{
|
||||
id: FILTER_HAS_TAGS_ALL,
|
||||
filtervar: 'tags__id__all',
|
||||
datatype: 'tag',
|
||||
datatype: DataType.Tag,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
id: FILTER_HAS_TAGS_ANY,
|
||||
filtervar: 'tags__id__in',
|
||||
datatype: 'tag',
|
||||
datatype: DataType.Tag,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
id: FILTER_DOES_NOT_HAVE_TAG,
|
||||
filtervar: 'tags__id__none',
|
||||
datatype: 'tag',
|
||||
datatype: DataType.Tag,
|
||||
multi: true,
|
||||
},
|
||||
{
|
||||
|
@@ -56,6 +56,7 @@ export const SETTINGS_KEYS = {
|
||||
DEFAULT_PERMS_EDIT_GROUPS: 'general-settings:permissions:default-edit-groups',
|
||||
DOCUMENT_EDITING_REMOVE_INBOX_TAGS:
|
||||
'general-settings:document-editing:remove-inbox-tags',
|
||||
SEARCH_DB_ONLY: 'general-settings:search:db-only',
|
||||
}
|
||||
|
||||
export const SETTINGS: UiSetting[] = [
|
||||
@@ -219,4 +220,9 @@ export const SETTINGS: UiSetting[] = [
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
key: SETTINGS_KEYS.SEARCH_DB_ONLY,
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
]
|
||||
|
Reference in New Issue
Block a user