mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	fixes #102
This commit is contained in:
		@@ -34,7 +34,7 @@ export class FilterEditorComponent implements OnInit {
 | 
			
		||||
  documentTypes: PaperlessDocumentType[] = []
 | 
			
		||||
 | 
			
		||||
  newRuleClicked() {
 | 
			
		||||
    this.filterRules.push({type: this.selectedRuleType, value: null})
 | 
			
		||||
    this.filterRules.push({type: this.selectedRuleType, value: this.selectedRuleType.default})
 | 
			
		||||
    this.selectedRuleType = this.getRuleTypes().length > 0 ? this.getRuleTypes()[0] : null
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -16,19 +16,22 @@ export const FILTER_ADDED_AFTER = 14
 | 
			
		||||
export const FILTER_MODIFIED_BEFORE = 15
 | 
			
		||||
export const FILTER_MODIFIED_AFTER = 16
 | 
			
		||||
 | 
			
		||||
export const FILTER_DOES_NOT_HAVE_TAG = 17
 | 
			
		||||
 | 
			
		||||
export const FILTER_RULE_TYPES: FilterRuleType[] = [
 | 
			
		||||
 | 
			
		||||
  {id: FILTER_TITLE, name: "Title contains", filtervar: "title__icontains", datatype: "string", multi: false},
 | 
			
		||||
  {id: FILTER_CONTENT, name: "Content contains", filtervar: "content__icontains", datatype: "string", multi: false},
 | 
			
		||||
  {id: FILTER_TITLE, name: "Title contains", filtervar: "title__icontains", datatype: "string", multi: false, default: ""},
 | 
			
		||||
  {id: FILTER_CONTENT, name: "Content contains", filtervar: "content__icontains", datatype: "string", multi: false, default: ""},
 | 
			
		||||
  
 | 
			
		||||
  {id: FILTER_ASN, name: "ASN is", filtervar: "archive_serial_number", datatype: "number", multi: false},
 | 
			
		||||
  
 | 
			
		||||
  {id: FILTER_CORRESPONDENT, name: "Correspondent is", filtervar: "correspondent__id", datatype: "correspondent", multi: false},
 | 
			
		||||
  {id: FILTER_DOCUMENT_TYPE, name: "Document type is", filtervar: "document_type__id", datatype: "document_type", multi: false},
 | 
			
		||||
 | 
			
		||||
  {id: FILTER_IS_IN_INBOX, name: "Is in Inbox", filtervar: "is_in_inbox", datatype: "boolean", multi: false},  
 | 
			
		||||
  {id: FILTER_IS_IN_INBOX, name: "Is in Inbox", filtervar: "is_in_inbox", datatype: "boolean", multi: false, default: true},  
 | 
			
		||||
  {id: FILTER_HAS_TAG, name: "Has tag", filtervar: "tags__id__all", datatype: "tag", multi: true},  
 | 
			
		||||
  {id: FILTER_HAS_ANY_TAG, name: "Has any tag", filtervar: "is_tagged", datatype: "boolean", multi: false},
 | 
			
		||||
  {id: FILTER_DOES_NOT_HAVE_TAG, name: "Does not have tag", filtervar: "tags__id__none", datatype: "tag", multi: true},  
 | 
			
		||||
  {id: FILTER_HAS_ANY_TAG, name: "Has any tag", filtervar: "is_tagged", datatype: "boolean", multi: false, default: true},
 | 
			
		||||
 | 
			
		||||
  {id: FILTER_CREATED_BEFORE, name: "Created before", filtervar: "created__date__lt", datatype: "date", multi: false},
 | 
			
		||||
  {id: FILTER_CREATED_AFTER, name: "Created after", filtervar: "created__date__gt", datatype: "date", multi: false},
 | 
			
		||||
@@ -50,4 +53,5 @@ export interface FilterRuleType {
 | 
			
		||||
  filtervar: string
 | 
			
		||||
  datatype: string //number, string, boolean, date
 | 
			
		||||
  multi: boolean
 | 
			
		||||
  default?: any
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user