mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-11 10:00:48 -05:00
Do other this way because translation
This commit is contained in:
parent
efc12ec9cc
commit
982af2d48f
@ -71,7 +71,7 @@
|
|||||||
<div class="d-flex flex-wrap align-items-start">
|
<div class="d-flex flex-wrap align-items-start">
|
||||||
@for (filetype of statistics?.document_file_type_counts; track filetype; let i = $index) {
|
@for (filetype of statistics?.document_file_type_counts; track filetype; let i = $index) {
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<div class="text-nowrap me-2" [class.cursor-pointer]="filetype.mime_type !== 'Other'" (click)="filterByFileType(filetype)">
|
<div class="text-nowrap me-2" [class.cursor-pointer]="!filetype.is_other" (click)="filterByFileType(filetype)">
|
||||||
<span class="badge rounded-pill bg-primary d-inline-block p-0 me-1" [style.opacity]="getItemOpacity(i)"></span>
|
<span class="badge rounded-pill bg-primary d-inline-block p-0 me-1" [style.opacity]="getItemOpacity(i)"></span>
|
||||||
<small class="text-nowrap"><span class="fw-bold">{{ getFileTypeExtension(filetype) }}</span> <span class="text-muted">({{getFileTypePercent(filetype) | number: '1.0-1'}}%)</span></small>
|
<small class="text-nowrap"><span class="fw-bold">{{ getFileTypeExtension(filetype) }}</span> <span class="text-muted">({{getFileTypePercent(filetype) | number: '1.0-1'}}%)</span></small>
|
||||||
</div>
|
</div>
|
||||||
|
@ -253,6 +253,7 @@ describe('StatisticsWidgetComponent', () => {
|
|||||||
component.filterByFileType({
|
component.filterByFileType({
|
||||||
mime_type: 'Other',
|
mime_type: 'Other',
|
||||||
mime_type_count: 160,
|
mime_type_count: 160,
|
||||||
|
is_other: true,
|
||||||
})
|
})
|
||||||
expect(qfSpy).not.toHaveBeenCalled()
|
expect(qfSpy).not.toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
@ -32,6 +32,7 @@ export interface Statistics {
|
|||||||
interface DocumentFileType {
|
interface DocumentFileType {
|
||||||
mime_type: string
|
mime_type: string
|
||||||
mime_type_count: number
|
mime_type_count: number
|
||||||
|
is_other?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -80,6 +81,7 @@ export class StatisticsWidgetComponent
|
|||||||
statistics.document_file_type_counts.slice(0, fileTypeMax)
|
statistics.document_file_type_counts.slice(0, fileTypeMax)
|
||||||
statistics.document_file_type_counts.push({
|
statistics.document_file_type_counts.push({
|
||||||
mime_type: $localize`Other`,
|
mime_type: $localize`Other`,
|
||||||
|
is_other: true,
|
||||||
mime_type_count: others.reduce(
|
mime_type_count: others.reduce(
|
||||||
(currentValue, documentFileType) =>
|
(currentValue, documentFileType) =>
|
||||||
documentFileType.mime_type_count + currentValue,
|
documentFileType.mime_type_count + currentValue,
|
||||||
@ -137,7 +139,7 @@ export class StatisticsWidgetComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
filterByFileType(filetype: DocumentFileType) {
|
filterByFileType(filetype: DocumentFileType) {
|
||||||
if (filetype.mime_type === 'Other') return
|
if (filetype.is_other) return
|
||||||
this.documentListViewService.quickFilter([
|
this.documentListViewService.quickFilter([
|
||||||
{
|
{
|
||||||
rule_type: FILTER_MIME_TYPE,
|
rule_type: FILTER_MIME_TYPE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user