-
diff --git a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts
index a6870e0e7..5ac68d42a 100644
--- a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts
+++ b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts
@@ -23,7 +23,24 @@ export class UploadFileWidgetComponent implements OnInit {
return this.consumerStatusService.getConsumerStatus().slice(0, MAX_ALERTS)
}
- getStatusesHidden() {
+ getStatusSummary() {
+ let strings = []
+ let countUploadingAndProcessing = this.consumerStatusService.getConsumerStatusNotCompleted().length
+ let countFailed = this.getStatusFailed().length
+ let countSuccess = this.getStatusSuccess().length
+ if (countUploadingAndProcessing > 0) {
+ strings.push($localize`Processing: ${countUploadingAndProcessing}`)
+ }
+ if (countFailed > 0) {
+ strings.push($localize`Failed: ${countFailed}`)
+ }
+ if (countSuccess > 0) {
+ strings.push($localize`Added: ${countSuccess}`)
+ }
+ return strings.join($localize`:this string is used to separate processing, failed and added on the file upload widget:, `)
+ }
+
+ getStatusHidden() {
if (this.consumerStatusService.getConsumerStatus().length < MAX_ALERTS) return []
else return this.consumerStatusService.getConsumerStatus().slice(MAX_ALERTS)
}
@@ -32,6 +49,14 @@ export class UploadFileWidgetComponent implements OnInit {
return this.consumerStatusService.getConsumerStatus(FileStatusPhase.UPLOADING)
}
+ getStatusFailed() {
+ return this.consumerStatusService.getConsumerStatus(FileStatusPhase.FAILED)
+ }
+
+ getStatusSuccess() {
+ return this.consumerStatusService.getConsumerStatus(FileStatusPhase.SUCCESS)
+ }
+
getStatusCompleted() {
return this.consumerStatusService.getConsumerStatusCompleted()
}
diff --git a/src-ui/src/app/services/consumer-status.service.ts b/src-ui/src/app/services/consumer-status.service.ts
index c2169d51f..8151b1c18 100644
--- a/src-ui/src/app/services/consumer-status.service.ts
+++ b/src-ui/src/app/services/consumer-status.service.ts
@@ -90,13 +90,17 @@ export class ConsumerStatusService {
}
getConsumerStatus(phase?: FileStatusPhase) {
- if (phase) {
+ if (phase != null) {
return this.consumerStatus.filter(s => s.phase == phase)
} else {
return this.consumerStatus
}
}
+ getConsumerStatusNotCompleted() {
+ return this.consumerStatus.filter(s => s.phase < FileStatusPhase.SUCCESS)
+ }
+
getConsumerStatusCompleted() {
return this.consumerStatus.filter(s => s.phase == FileStatusPhase.FAILED || s.phase == FileStatusPhase.SUCCESS)
}