mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Code cleanup
This commit is contained in:
parent
9bfc92cf79
commit
54d90a4c4b
@ -113,17 +113,17 @@ export class DocumentListComponent implements OnInit {
|
||||
}
|
||||
|
||||
clickTag(tagID: number) {
|
||||
this.filterEditorService.toggleFilterByTagID(tagID)
|
||||
this.filterEditorService.toggleFilterByTag(tagID)
|
||||
this.applyFilterRules()
|
||||
}
|
||||
|
||||
clickCorrespondent(correspondentID: number) {
|
||||
this.filterEditorService.toggleFilterByCorrespondentID(correspondentID)
|
||||
this.filterEditorService.toggleFilterByCorrespondent(correspondentID)
|
||||
this.applyFilterRules()
|
||||
}
|
||||
|
||||
clickDocumentType(documentTypeID: number) {
|
||||
this.filterEditorService.toggleFilterByDocumentTypeID(documentTypeID)
|
||||
this.filterEditorService.toggleFilterByDocumentType(documentTypeID)
|
||||
this.applyFilterRules()
|
||||
}
|
||||
|
||||
|
@ -76,28 +76,19 @@ export class FilterEditorViewService {
|
||||
return this.documentTypes?.filter(dt => documentTypeRules.find(dtr => dtr.value == dt.id))
|
||||
}
|
||||
|
||||
toggleFilterByTag(tag: PaperlessTag) {
|
||||
toggleFilterByTag(tag: PaperlessTag | number) {
|
||||
if (typeof tag == 'number') tag = this.tags?.find(t => t.id == tag)
|
||||
this.toggleFilterByItem(tag, FILTER_HAS_TAG)
|
||||
}
|
||||
|
||||
toggleFilterByCorrespondent(tag: PaperlessCorrespondent) {
|
||||
this.toggleFilterByItem(tag, FILTER_CORRESPONDENT)
|
||||
toggleFilterByCorrespondent(correspondent: PaperlessCorrespondent | number) {
|
||||
if (typeof correspondent == 'number') correspondent = this.correspondents?.find(t => t.id == correspondent)
|
||||
this.toggleFilterByItem(correspondent, FILTER_CORRESPONDENT)
|
||||
}
|
||||
|
||||
toggleFilterByDocumentType(tag: PaperlessDocumentType) {
|
||||
this.toggleFilterByItem(tag, FILTER_DOCUMENT_TYPE)
|
||||
}
|
||||
|
||||
toggleFilterByTagID(tagID: number) {
|
||||
this.toggleFilterByTag(this.tags?.find(t => t.id == tagID))
|
||||
}
|
||||
|
||||
toggleFilterByCorrespondentID(correspondentID: number) {
|
||||
this.toggleFilterByCorrespondent(this.correspondents?.find(t => t.id == correspondentID))
|
||||
}
|
||||
|
||||
toggleFilterByDocumentTypeID(documentTypeID: number) {
|
||||
this.toggleFilterByDocumentType(this.documentTypes?.find(t => t.id == documentTypeID))
|
||||
toggleFilterByDocumentType(documentType: PaperlessDocumentType | number) {
|
||||
if (typeof documentType == 'number') documentType = this.documentTypes?.find(t => t.id == documentType)
|
||||
this.toggleFilterByItem(documentType, FILTER_DOCUMENT_TYPE)
|
||||
}
|
||||
|
||||
private toggleFilterByItem(item: ObjectWithId, filterRuleTypeID: number) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user