diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/dossier-details/dossier-details.component.html b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/dossier-details/dossier-details.component.html index d02fb53b7..973510154 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/dossier-details/dossier-details.component.html +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/dossier-details/dossier-details.component.html @@ -41,7 +41,7 @@
manager.id); } - calculateChartConfig(filesCount: FileCountPerWorkflowStatus): DoughnutChartConfig[] { - const documentsChartData: DoughnutChartConfig[] = Object.keys(filesCount).map(status => ({ - value: filesCount[status], + calculateChartConfig(stats: DossierStats): DoughnutChartConfig[] { + const documentsChartData: DoughnutChartConfig[] = Object.keys(stats.fileCountPerWorkflowStatus).map(status => ({ + value: stats.fileCountPerWorkflowStatus[status], color: status, label: fileStatusTranslations[status], key: status, diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts index b81c09c84..8e26de997 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts @@ -37,7 +37,10 @@ export class FileUploadService extends GenericService { protected readonly _injector: Injector, ) { super(_injector, 'upload'); - interval(2500).subscribe(() => { + interval(2500).subscribe(async () => { + if (this.activeUploads > 0) { + await this._appStateService.reloadActiveDossierFiles(); + } this._handleUploads(); }); } @@ -174,7 +177,7 @@ export class FileUploadService extends GenericService { this.activeUploads++; const obs = this.uploadFileForm(uploadFile.dossierId, uploadFile.file); return obs.subscribe( - async event => { + event => { if (event.type === HttpEventType.UploadProgress) { uploadFile.progress = Math.round((event.loaded / (event.total || event.loaded)) * 100); this._applicationRef.tick(); @@ -190,7 +193,6 @@ export class FileUploadService extends GenericService { }; } this._removeUpload(uploadFile); - await this._appStateService.reloadActiveDossierFiles(); } }, (err: HttpErrorResponse) => {