Aw4751 eslint fixes
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -40,9 +40,9 @@ export class ResumableFileUploadService implements OnDestroy{
|
||||
}
|
||||
|
||||
updatetotalprogress() {
|
||||
var totalProgress =0;
|
||||
var n=0;
|
||||
for(var i =0;i<this.files.length;i++) {
|
||||
let totalProgress =0;
|
||||
let n=0;
|
||||
for(let i =0;i<this.files.length;i++) {
|
||||
if(!this.files[i].error) {
|
||||
totalProgress+=this.files[i].progress;
|
||||
n++;
|
||||
@@ -53,9 +53,9 @@ export class ResumableFileUploadService implements OnDestroy{
|
||||
}
|
||||
|
||||
handleState(state:UploadState) {
|
||||
var file =this.files.find((f) => f.identifier == state.uploadId )
|
||||
const file =this.files.find((f) => f.identifier == state.uploadId )
|
||||
if(state.status != "cancelled" && !file) {
|
||||
let file = new File(state);
|
||||
const file = new File(state);
|
||||
this.files.push(file);
|
||||
this.isClosed=false;
|
||||
this.addedFiles.next(file)
|
||||
@@ -66,29 +66,29 @@ export class ResumableFileUploadService implements OnDestroy{
|
||||
this.isUploading = true;
|
||||
file.progress = (state.progress?state.progress:0);
|
||||
}
|
||||
};break;
|
||||
}break;
|
||||
case "complete": {
|
||||
if(file) {
|
||||
var parts = state.url.split("/");
|
||||
const parts = state.url.split("/");
|
||||
file.itemCode = parts[parts.length-1];
|
||||
file.progress = (state.progress?state.progress:0);
|
||||
file.success=true;
|
||||
}
|
||||
};break;
|
||||
}break;
|
||||
case "error": {
|
||||
if(file) {
|
||||
file.error=true;
|
||||
file.errorMessage = state.response as string;
|
||||
}
|
||||
};break;
|
||||
}break;
|
||||
}
|
||||
this.updatetotalprogress();
|
||||
this.refresh.next({});
|
||||
}
|
||||
|
||||
addFiles = (files: any[], event: any, metadata:any) => {
|
||||
for (let f of files) {
|
||||
var options:UploadxOptions = {metadata:metadata};
|
||||
for (const f of files) {
|
||||
const options:UploadxOptions = {metadata:metadata};
|
||||
this.uploadService.handleFiles(f,options);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export class ResumableFileUploadService implements OnDestroy{
|
||||
|
||||
cancelFile = function (file) {
|
||||
this.uploadService.control({action:'cancel',uploadId:file.identifier});
|
||||
var index = this.files.indexOf(file, 0);
|
||||
const index = this.files.indexOf(file, 0);
|
||||
if (index > -1) {
|
||||
this.files.splice(index, 1);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export class ResumableFileUploadService implements OnDestroy{
|
||||
};
|
||||
|
||||
doClose = function () {
|
||||
var toCancel = this.files.filter((f) => !f.success);
|
||||
const toCancel = this.files.filter((f) => !f.success);
|
||||
toCancel.forEach(f => {
|
||||
this.uploadService.control({action:'cancel',uploadId:f.identifier});
|
||||
});
|
||||
|
Reference in New Issue
Block a user