From 1a526ac31e230d46f37926facb4d302170a5d057 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Wed, 16 Dec 2020 02:12:58 +0100 Subject: [PATCH] fixes #140 --- .../correspondent-list.component.html | 23 ++++++++++++++++--- .../correspondent-list.component.ts | 14 ++++++++++- .../document-type-list.component.html | 21 +++++++++++++++-- .../document-type-list.component.ts | 14 ++++++++++- .../manage/tag-list/tag-list.component.html | 23 ++++++++++++++++--- .../manage/tag-list/tag-list.component.ts | 15 +++++++++++- 6 files changed, 99 insertions(+), 11 deletions(-) diff --git a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html index 27aa4d366..2efd1c58d 100644 --- a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html +++ b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.html @@ -26,9 +26,26 @@ {{ correspondent.last_correspondence | date }}
- - -
+ + + + diff --git a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts index effae2826..a128340b9 100644 --- a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts +++ b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts @@ -1,6 +1,9 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { FILTER_CORRESPONDENT } from 'src/app/data/filter-rule-type'; import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; +import { DocumentListViewService } from 'src/app/services/document-list-view.service'; import { CorrespondentService } from 'src/app/services/rest/correspondent.service'; import { GenericListComponent } from '../generic-list/generic-list.component'; import { CorrespondentEditDialogComponent } from './correspondent-edit-dialog/correspondent-edit-dialog.component'; @@ -12,7 +15,10 @@ import { CorrespondentEditDialogComponent } from './correspondent-edit-dialog/co }) export class CorrespondentListComponent extends GenericListComponent { - constructor(correspondentsService: CorrespondentService, modalService: NgbModal,) { + constructor(correspondentsService: CorrespondentService, modalService: NgbModal, + private router: Router, + private list: DocumentListViewService + ) { super(correspondentsService,modalService,CorrespondentEditDialogComponent) } @@ -20,4 +26,10 @@ export class CorrespondentListComponent extends GenericListComponent{{ document_type.document_count }}
- - + + +
diff --git a/src-ui/src/app/components/manage/document-type-list/document-type-list.component.ts b/src-ui/src/app/components/manage/document-type-list/document-type-list.component.ts index 16cdd88a9..d18a19226 100644 --- a/src-ui/src/app/components/manage/document-type-list/document-type-list.component.ts +++ b/src-ui/src/app/components/manage/document-type-list/document-type-list.component.ts @@ -1,6 +1,9 @@ import { Component } from '@angular/core'; +import { Router } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { FILTER_DOCUMENT_TYPE } from 'src/app/data/filter-rule-type'; import { PaperlessDocumentType } from 'src/app/data/paperless-document-type'; +import { DocumentListViewService } from 'src/app/services/document-list-view.service'; import { DocumentTypeService } from 'src/app/services/rest/document-type.service'; import { GenericListComponent } from '../generic-list/generic-list.component'; import { DocumentTypeEditDialogComponent } from './document-type-edit-dialog/document-type-edit-dialog.component'; @@ -12,7 +15,10 @@ import { DocumentTypeEditDialogComponent } from './document-type-edit-dialog/doc }) export class DocumentTypeListComponent extends GenericListComponent { - constructor(service: DocumentTypeService, modalService: NgbModal) { + constructor(service: DocumentTypeService, modalService: NgbModal, + private router: Router, + private list: DocumentListViewService + ) { super(service, modalService, DocumentTypeEditDialogComponent) } @@ -20,4 +26,10 @@ export class DocumentTypeListComponent extends GenericListComponent - +
@@ -28,8 +28,25 @@ diff --git 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 index 32093e0a8..e3f151550 100644 --- 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,6 +1,9 @@ import { Component } from '@angular/core'; +import { Router } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { FILTER_HAS_TAG } from 'src/app/data/filter-rule-type'; import { TAG_COLOURS, 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 { GenericListComponent } from '../generic-list/generic-list.component'; import { TagEditDialogComponent } from './tag-edit-dialog/tag-edit-dialog.component'; @@ -12,7 +15,10 @@ import { TagEditDialogComponent } from './tag-edit-dialog/tag-edit-dialog.compon }) export class TagListComponent extends GenericListComponent { - constructor(tagService: TagService, modalService: NgbModal) { + constructor(tagService: TagService, modalService: NgbModal, + private router: Router, + private list: DocumentListViewService + ) { super(tagService, modalService, TagEditDialogComponent) } @@ -23,4 +29,11 @@ export class TagListComponent extends GenericListComponent { getObjectName(object: PaperlessTag) { return `tag '${object.name}'` } + + filterDocuments(object: PaperlessTag) { + this.list.documentListView.filter_rules = [ + {rule_type: FILTER_HAS_TAG, value: object.id.toString()} + ] + this.router.navigate(["documents"]) + } }
Name{{ tag.document_count }}
- - + + +