Fix: separate displayed and API collection sizes for tags (#12170)

This commit is contained in:
shamoon
2026-02-25 17:25:36 -08:00
committed by GitHub
parent 98298e37cd
commit 13e07844fe
4 changed files with 28 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ import {
MatchingModel,
} from 'src/app/data/matching-model'
import { ObjectWithPermissions } from 'src/app/data/object-with-permissions'
import { Results } from 'src/app/data/results'
import {
SortableDirective,
SortEvent,
@@ -88,6 +89,7 @@ export abstract class ManagementListComponent<T extends MatchingModel>
public page = 1
public collectionSize = 0
public displayCollectionSize = 0
public sortField: string
public sortReverse: boolean
@@ -141,6 +143,14 @@ export abstract class ManagementListComponent<T extends MatchingModel>
return data
}
protected getCollectionSize(results: Results<T>): number {
return results.all?.length ?? results.count
}
protected getDisplayCollectionSize(results: Results<T>): number {
return this.getCollectionSize(results)
}
getDocumentCount(object: MatchingModel): number {
return (
object.document_count ??
@@ -171,7 +181,8 @@ export abstract class ManagementListComponent<T extends MatchingModel>
tap((c) => {
this.unfilteredData = c.results
this.data = this.filterData(c.results)
this.collectionSize = c.all?.length ?? c.count
this.collectionSize = this.getCollectionSize(c)
this.displayCollectionSize = this.getDisplayCollectionSize(c)
}),
delay(100)
)