From 391f0fc1906d059422d6d6b8c9f75aed477b5487 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Fri, 16 Aug 2019 10:07:53 +0200 Subject: [PATCH] AW-432 fix item code --- .../resumable-file-upload/resumable-file-upload.component.ts | 2 +- .../resumable-file-upload/resumable-file-upload.service.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.ts b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.ts index bedd060..f6f8f84 100644 --- a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.ts +++ b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.ts @@ -40,7 +40,7 @@ export class ResumableFileUploadComponent implements OnInit, OnDestroy { handleUploadedFileClick(event:MouseEvent,file:File) { event.preventDefault(); - this.store.dispatch(new commonActions.UploadedFileClick(file.identifier)); + this.store.dispatch(new commonActions.UploadedFileClick(file.itemCode)); } //TODO do this with an canunload guard diff --git a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts index 5b3c179..42b8936 100644 --- a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts +++ b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts @@ -67,6 +67,8 @@ export class ResumableFileUploadService implements OnDestroy{ case "complete": { var file =this.files.find((f) => f.identifier == state.uploadId ) if(file) { + var parts = state.url.split("/"); + file.itemCode = parts[parts.length-1]; file.progress = (state.progress?state.progress:0); } file.success=true; @@ -128,6 +130,7 @@ export class File { public fileName: string; public progress: number; public identifier: string; + public itemCode: string; public success: boolean; public error: boolean; public errorMessage: string; @@ -141,5 +144,6 @@ export class File { this.success = false; this.error = false; this.errorMessage = ""; + this.itemCode = null; } }