From c45153fb455a59aeacc3bedbd4b6b3191e3e9edf Mon Sep 17 00:00:00 2001 From: Art Date: Wed, 22 Sep 2021 15:27:29 +0300 Subject: [PATCH] 185. Report upload progress - Part 3 (#26) --- .../src/app/component/user/user.component.html | 6 +++--- .../src/app/component/user/user.component.ts | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/support-portal-frontend/src/app/component/user/user.component.html b/support-portal-frontend/src/app/component/user/user.component.html index 9cc1100..c7a44b7 100644 --- a/support-portal-frontend/src/app/component/user/user.component.html +++ b/support-portal-frontend/src/app/component/user/user.component.html @@ -137,10 +137,10 @@ -
+
50% + [style.width.%]="fileUploadStatus?.percentage" aria-valuenow="0" aria-valuemin="0" + aria-valuemax="100">{{fileUploadStatus?.percentage}}%
diff --git a/support-portal-frontend/src/app/component/user/user.component.ts b/support-portal-frontend/src/app/component/user/user.component.ts index b49f608..c8b85d2 100644 --- a/support-portal-frontend/src/app/component/user/user.component.ts +++ b/support-portal-frontend/src/app/component/user/user.component.ts @@ -250,6 +250,7 @@ export class UserComponent implements OnInit, OnDestroy { (errorResponse: HttpErrorResponse) => { this.sendErrorNotification(errorResponse.error.message); this.refreshing = false; + this.fileUploadStatus.status = 'error'; }, () => { this.refreshing = false; @@ -276,6 +277,9 @@ export class UserComponent implements OnInit, OnDestroy { this.sendErrorNotification('Unable to upload image. Please try again'); } break; + default: + this.fileUploadStatus.status='default'; + } } }