diff --git a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html index 263918a73..b4c4fc01b 100644 --- a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html +++ b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html @@ -6,20 +6,22 @@ (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)" dropZoneClassName="bg-light card" multiple="true" contentClassName="justify-content-center d-flex align-items-center p-5" [showBrowseBtn]=true browseBtnClassName="btn btn-sm btn-outline-primary ml-2" i18n-dropZoneLabel i18n-browseBtnLabel> - -

Uploading {{getStatusUploading().length}} files...

-

{{status.filename}}: {{status.message}}

- - - -
- - -
- + +
{{status.filename}}
+

{{status.message}}

+ +
+ +
+
- \ No newline at end of file + diff --git a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.scss b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.scss index 461f9d5b3..807eac66b 100644 --- a/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.scss +++ b/src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.scss @@ -3,3 +3,31 @@ ::ng-deep .ngx-file-drop__drop-zone--over { background-color: $primaryFaded !important; } + +form { + position: relative; +} + +.alert { + transition: all 0.2s ease; +} + +.alert-heading { + font-size: 80%; + font-weight: bold; +} + +.btn-sm { + line-height: 1; +} + +::ng-deep .progress { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + height: auto; + mix-blend-mode: soft-light; + pointer-events: none; +} 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 bd0e4e290..e9a62cf9c 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 @@ -41,7 +41,7 @@ export class UploadFileWidgetComponent implements OnInit { return status.phase == FileStatusPhase.FAILED || status.phase == FileStatusPhase.SUCCESS } - getType(status: FileStatus) { + getStatusColor(status: FileStatus) { switch (status.phase) { case FileStatusPhase.PROCESSING: case FileStatusPhase.UPLOADING: @@ -56,7 +56,7 @@ export class UploadFileWidgetComponent implements OnInit { dismiss(status: FileStatus) { this.consumerStatusService.dismiss(status) } - + ngOnInit(): void { } @@ -75,7 +75,7 @@ export class UploadFileWidgetComponent implements OnInit { let formData = new FormData() formData.append('document', file, file.name) let status = this.consumerStatusService.newFileUpload(file.name) - + status.message = "Connecting..." this.documentService.uploadDocument(formData).subscribe(event => { diff --git a/src-ui/src/app/services/consumer-status.service.ts b/src-ui/src/app/services/consumer-status.service.ts index 69e58e2dd..d5ac1ba47 100644 --- a/src-ui/src/app/services/consumer-status.service.ts +++ b/src-ui/src/app/services/consumer-status.service.ts @@ -16,7 +16,7 @@ export class FileStatus { taskId: string - phase: FileStatusPhase = FileStatusPhase.STARTED + phase: FileStatusPhase = FileStatusPhase.STARTED currentPhaseProgress: number @@ -33,7 +33,8 @@ export class FileStatus { case FileStatusPhase.UPLOADING: return this.currentPhaseProgress / this.currentPhaseMaxProgress * 0.2 case FileStatusPhase.PROCESSING: - return this.currentPhaseProgress / this.currentPhaseMaxProgress * 0.8 + 0.2 + if (this.currentPhaseProgress > 100) this.currentPhaseProgress = 0 + return (this.currentPhaseProgress / this.currentPhaseMaxProgress * 0.8) + 0.2 case FileStatusPhase.SUCCESS: case FileStatusPhase.FAILED: return 1.0