AW-432 fix item code
FarmMaps.Develop/FarmMapsLib/develop This commit looks good Details

pull/1/head
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) {
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

View File

@ -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;
}
}