Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Merge branch 'dev' into feature/any-all-filtering

Michael Shamoonf75d4ccc89c0
diff --cc src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts
index b5cca38ac,23c3d810a..175e3475f
--- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts
+++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts
@@@ -8,9 -8,17 +8,17 @@@ import { DocumentTypeService } from 'sr
import { TagService } from 'src/app/services/rest/tag.service';
import { CorrespondentService } from 'src/app/services/rest/correspondent.service';
import { FilterRule } from 'src/app/data/filter-rule';
- import { FILTER_ADDED_AFTER, FILTER_ADDED_BEFORE, FILTER_CORRESPONDENT, FILTER_CREATED_AFTER, FILTER_CREATED_BEFORE, FILTER_DOCUMENT_TYPE, FILTER_HAS_ANY_TAG, FILTER_HAS_TAGS_ALL, FILTER_HAS_TAGS_ANY, FILTER_DOES_NOT_HAVE_TAG, FILTER_TITLE } from 'src/app/data/filter-rule-type';
-import { FILTER_ADDED_AFTER, FILTER_ADDED_BEFORE, FILTER_ASN, FILTER_CORRESPONDENT, FILTER_CREATED_AFTER, FILTER_CREATED_BEFORE, FILTER_DOCUMENT_TYPE, FILTER_FULLTEXT_MORELIKE, FILTER_FULLTEXT_QUERY, FILTER_HAS_ANY_TAG, FILTER_HAS_TAG, FILTER_TITLE, FILTER_TITLE_CONTENT } from 'src/app/data/filter-rule-type';
++import { FILTER_ADDED_AFTER, FILTER_ADDED_BEFORE, FILTER_ASN, FILTER_CORRESPONDENT, FILTER_CREATED_AFTER, FILTER_CREATED_BEFORE, FILTER_DOCUMENT_TYPE, FILTER_FULLTEXT_MORELIKE, FILTER_FULLTEXT_QUERY, FILTER_HAS_ANY_TAG, FILTER_HAS_TAGS_ALL, FILTER_HAS_TAGS_ANY, FILTER_DOES_NOT_HAVE_TAG, FILTER_TITLE, FILTER_TITLE_CONTENT } from 'src/app/data/filter-rule-type';
import { FilterableDropdownSelectionModel } from '../../common/filterable-dropdown/filterable-dropdown.component';
import { ToggleableItemState } from '../../common/filterable-dropdown/toggleable-dropdown-button/toggleable-dropdown-button.component';
+ import { DocumentService } from 'src/app/services/rest/document.service';
+ import { PaperlessDocument } from 'src/app/data/paperless-document';
+
+ const TEXT_FILTER_TARGET_TITLE = "title"
+ const TEXT_FILTER_TARGET_TITLE_CONTENT = "title-content"
+ const TEXT_FILTER_TARGET_ASN = "asn"
+ const TEXT_FILTER_TARGET_FULLTEXT_QUERY = "fulltext-query"
+ const TEXT_FILTER_TARGET_FULLTEXT_MORELIKE = "fulltext-morelike"
@Component({
selector: 'app-filter-editor',
@@@ -206,19 -303,21 +314,21 @@@ export class FilterEditorComponent impl
}
resetSelected() {
- this.reset.next()
+ this.textFilterTarget = TEXT_FILTER_TARGET_TITLE_CONTENT
+ this.filterRules = this._unmodifiedFilterRules
+ this.updateRules()
}
- toggleTag(tagId: number) {
- this.tagSelectionModel.toggle(tagId)
+ addTag(tagId: number) {
+ this.tagSelectionModel.set(tagId, ToggleableItemState.Selected)
}
- toggleCorrespondent(correspondentId: number) {
- this.correspondentSelectionModel.toggle(correspondentId)
+ addCorrespondent(correspondentId: number) {
+ this.correspondentSelectionModel.set(correspondentId, ToggleableItemState.Selected)
}
- toggleDocumentType(documentTypeId: number) {
- this.documentTypeSelectionModel.toggle(documentTypeId)
+ addDocumentType(documentTypeId: number) {
+ this.documentTypeSelectionModel.set(documentTypeId, ToggleableItemState.Selected)
}
onTagsDropdownOpen() {
diff --cc src-ui/src/app/components/manage/tag-list/tag-list.component.ts
index 45862b017,7ea379f64..6d93d7dd4
--- a/src-ui/src/app/components/manage/tag-list/tag-list.component.ts
+++ b/src-ui/src/app/components/manage/tag-list/tag-list.component.ts
@@@ -1,7 -1,7 +1,7 @@@
import { Component } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
-import { FILTER_HAS_TAG } from 'src/app/data/filter-rule-type';
+import { FILTER_HAS_TAGS_ALL } from 'src/app/data/filter-rule-type';
- import { TAG_COLOURS, PaperlessTag } from 'src/app/data/paperless-tag';
+ import { PaperlessTag } from 'src/app/data/paperless-tag';
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
import { TagService } from 'src/app/services/rest/tag.service';
import { ToastService } from 'src/app/services/toast.service';
diff --cc src/documents/filters.py
index 5a58c2f18,a1ad94b1e..152c556c3
mode 100755,100644..100644
--- a/src/documents/filters.py
+++ b/src/documents/filters.py
@@@ -87,10 -94,10 +98,12 @@@ class DocumentFilterSet(FilterSet)
tags__id__none = TagsFilter(exclude=True)
+ tags__id__in = TagsFilter(in_list=True)
+
is_in_inbox = InboxFilter()
+ title_content = TitleContentFilter()
+
class Meta:
model = Document
fields = {
diff --cc src/documents/models.py
index 444738252,2a763c602..1e9760334
mode 100755,100644..100644
--- a/src/documents/models.py
+++ b/src/documents/models.py
@@@ -387,7 -384,10 +384,11 @@@ class SavedViewFilterRule(models.Model)
(15, _("modified before")),
(16, _("modified after")),
(17, _("does not have tag")),
- (19, _("has tags in")),
+ (18, _("does not have ASN")),
+ (19, _("title or content contains")),
+ (20, _("fulltext query")),
- (21, _("more like this"))
++ (21, _("more like this")),
++ (22, _("has tags in"))
]
saved_view = models.ForeignKey(