diff --git a/projects/common/ng-package.json b/projects/common/ng-package.json index 713d998..23ce9f8 100644 --- a/projects/common/ng-package.json +++ b/projects/common/ng-package.json @@ -2,7 +2,10 @@ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", "dest": "../../dist/common", "lib": { - "entryFile": "src/public-api.ts" + "entryFile": "src/public-api.ts", + "umdModuleIds": { + "my-data": "my-data" + } }, "whitelistedNonPeerDependencies": [ "." diff --git a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.html b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.html index 278221c..04194f1 100644 --- a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.html +++ b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.component.html @@ -11,7 +11,7 @@ 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 d6166a5..82de934 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 @@ -10,7 +10,7 @@ import { AppConfig } from '../../shared/app.config'; export class ResumableFileUploadService implements OnDestroy{ public files: Array = new Array(); public isUploading = false; - public totalProgress = "0"; + public totalProgress = 0; public isClosed = true; public isMinimized = false; public parentCode: string; @@ -38,19 +38,45 @@ export class ResumableFileUploadService implements OnDestroy{ } } + updatetotalprogress() { + var totalProgress =0; + for(var i =0;i f.identifier == state.uploadId ) + if(file) { + file.progress = (state.progress?state.progress:0); + this.updatetotalprogress(); + } };break; - case "uploading": case "complete": { var file =this.files.find((f) => f.identifier == state.uploadId ) if(file) { - file.progress = (state.progress * 100) + '%'; + file.progress = (state.progress?state.progress:0); + this.updatetotalprogress(); } + file.success=true; + };break; + case "error": { + var file =this.files.find((f) => f.identifier == state.uploadId ) + if(file) { + file.error=true; + file.errorMessage = state.response; + } };break; } + this.refresh.next({}); } addFiles = (files: any[], event: any, geoRefJson?: string, attributes?: any) => { @@ -97,7 +123,7 @@ export class ResumableFileUploadService implements OnDestroy{ export class File { private file: any; public fileName: string; - public progress: string; + public progress: number; public identifier: string; public success: boolean; public error: boolean; @@ -107,7 +133,7 @@ export class File { constructor(state: UploadState) { this.file = state; this.fileName = state.file.name; - this.progress = (state.progress * 100) + '%'; + this.progress = state.progress?state.progress:0; this.identifier = state.uploadId; this.success = false; this.error = false;