diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index 8bd5b1a55..cc682b8e3 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -84,7 +84,7 @@ - +
@@ -94,13 +94,30 @@ - - - - - - - + + + + + + +
ASN CorrespondentAdded
{{d.archive_serial_number}}{{d.correspondent ? d.correspondent.name : ''}}{{d.title}}{{d.document_type ? d.document_type.name : ''}}{{d.created | date}}{{d.added | date}}
+ {{d.archive_serial_number}} + + + {{d.correspondent.name}} + + + {{d.title}} + + + + {{d.document_type.name}} + + + {{d.created | date}} + + {{d.added | date}} +
diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.ts index 774e83a07..08f94c2ee 100644 --- a/src-ui/src/app/components/document-list/document-list.component.ts +++ b/src-ui/src/app/components/document-list/document-list.component.ts @@ -2,8 +2,9 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { cloneFilterRules, FilterRule } from 'src/app/data/filter-rule'; -import { FILTER_CORRESPONDENT, FILTER_HAS_TAG, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type'; +import { FILTER_CORRESPONDENT, FILTER_DOCUMENT_TYPE, FILTER_HAS_TAG, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type'; import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; +import { PaperlessDocumentType } from 'src/app/data/paperless-document-type'; import { PaperlessTag } from 'src/app/data/paperless-tag'; import { SavedViewConfig } from 'src/app/data/saved-view-config'; import { DocumentListViewService } from 'src/app/services/document-list-view.service'; @@ -109,4 +110,14 @@ export class DocumentListComponent implements OnInit { this.applyFilterRules() } + filterByDocumentType(dt: PaperlessDocumentType) { + let existing_rule = this.filterRules.find(rule => rule.type.id == FILTER_DOCUMENT_TYPE) + if (existing_rule) { + existing_rule.value = dt.id + } else { + this.filterRules.push({type: FILTER_RULE_TYPES.find(t => t.id == FILTER_DOCUMENT_TYPE), value: dt.id}) + } + this.applyFilterRules() + } + }