AW-432 fix item code
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2019-08-16 10:07:53 +02:00
parent 4671ce08d3
commit 391f0fc190
2 changed files with 5 additions and 1 deletions

View File

@ -40,7 +40,7 @@ export class ResumableFileUploadComponent implements OnInit, OnDestroy {
handleUploadedFileClick(event:MouseEvent,file:File) { handleUploadedFileClick(event:MouseEvent,file:File) {
event.preventDefault(); 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 //TODO do this with an canunload guard

View File

@ -67,6 +67,8 @@ export class ResumableFileUploadService implements OnDestroy{
case "complete": { case "complete": {
var file =this.files.find((f) => f.identifier == state.uploadId ) var file =this.files.find((f) => f.identifier == state.uploadId )
if(file) { if(file) {
var parts = state.url.split("/");
file.itemCode = parts[parts.length-1];
file.progress = (state.progress?state.progress:0); file.progress = (state.progress?state.progress:0);
} }
file.success=true; file.success=true;
@ -128,6 +130,7 @@ export class File {
public fileName: string; public fileName: string;
public progress: number; public progress: number;
public identifier: string; public identifier: string;
public itemCode: string;
public success: boolean; public success: boolean;
public error: boolean; public error: boolean;
public errorMessage: string; public errorMessage: string;
@ -141,5 +144,6 @@ export class File {
this.success = false; this.success = false;
this.error = false; this.error = false;
this.errorMessage = ""; this.errorMessage = "";
this.itemCode = null;
} }
} }