mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Fix: support multiple inbox tags from stats widget (#7281)
This commit is contained in:
@@ -75,7 +75,7 @@ describe('StatisticsWidgetComponent', () => {
|
||||
const mockStats = {
|
||||
documents_total: 200,
|
||||
documents_inbox: 18,
|
||||
inbox_tag: 10,
|
||||
inbox_tags: [10],
|
||||
}
|
||||
|
||||
const req = httpTestingController.expectOne(
|
||||
@@ -100,7 +100,7 @@ describe('StatisticsWidgetComponent', () => {
|
||||
const mockStats = {
|
||||
documents_total: 200,
|
||||
documents_inbox: 18,
|
||||
inbox_tag: 10,
|
||||
inbox_tags: [10],
|
||||
document_file_type_counts: [
|
||||
{
|
||||
mime_type: 'application/pdf',
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { HttpClient } from '@angular/common/http'
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core'
|
||||
import { Observable, Subscription } from 'rxjs'
|
||||
import { FILTER_HAS_TAGS_ALL } from 'src/app/data/filter-rule-type'
|
||||
import { FILTER_HAS_TAGS_ANY } from 'src/app/data/filter-rule-type'
|
||||
import { ConsumerStatusService } from 'src/app/services/consumer-status.service'
|
||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service'
|
||||
import { environment } from 'src/environments/environment'
|
||||
@@ -11,7 +11,7 @@ import { ComponentWithPermissions } from 'src/app/components/with-permissions/wi
|
||||
export interface Statistics {
|
||||
documents_total?: number
|
||||
documents_inbox?: number
|
||||
inbox_tag?: number
|
||||
inbox_tags?: number[]
|
||||
document_file_type_counts?: DocumentFileType[]
|
||||
character_count?: number
|
||||
tag_count?: number
|
||||
@@ -110,8 +110,10 @@ export class StatisticsWidgetComponent
|
||||
goToInbox() {
|
||||
this.documentListViewService.quickFilter([
|
||||
{
|
||||
rule_type: FILTER_HAS_TAGS_ALL,
|
||||
value: this.statistics.inbox_tag.toString(),
|
||||
rule_type: FILTER_HAS_TAGS_ANY,
|
||||
value: this.statistics.inbox_tags
|
||||
.map((tagID) => tagID.toString())
|
||||
.join(','),
|
||||
},
|
||||
])
|
||||
}
|
||||
|
Reference in New Issue
Block a user