diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 284beceb2..1be4f94fe 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -2244,6 +2244,13 @@ 17 + + other + + src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts + 56 + + Upload new documents diff --git a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html index ad971b491..f85176fde 100644 --- a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.html @@ -15,32 +15,13 @@
File types:
-
+
- {{filetype.mime_type}} + {{filetype.mime_type}} {{getFileTypePercent(filetype) | number: '1.0-1'}}%
-
diff --git a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.scss b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.scss index 74f88314c..6b26f8f00 100644 --- a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.scss +++ b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.scss @@ -1,3 +1,7 @@ .flex-column { row-gap: 0.2rem; } + +.filetypes-list { + max-width: 75%; +} diff --git a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts index 1b4daa300..0daecd91f 100644 --- a/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts +++ b/src-ui/src/app/components/dashboard/widgets/statistics-widget/statistics-widget.component.ts @@ -48,6 +48,20 @@ export class StatisticsWidgetComponent implements OnInit, OnDestroy { this.loading = true this.getStatistics().subscribe((statistics) => { this.loading = false + // truncate the list and sum others + if (statistics.document_file_type_counts?.length > 4) { + let others = statistics.document_file_type_counts.slice(4) + statistics.document_file_type_counts = + statistics.document_file_type_counts.slice(0, 4) + statistics.document_file_type_counts.push({ + mime_type: $localize`other`, + mime_type_count: others.reduce( + (currentValue, documentFileType) => + documentFileType.mime_type_count + currentValue, + 0 + ), + }) + } this.statistics = statistics }) }