From 92a44f4aeac3272e14411aab264bf62c3072a692 Mon Sep 17 00:00:00 2001 From: Stefano Denti Date: Fri, 23 Jun 2023 10:37:31 +0200 Subject: [PATCH 1/2] fix --- .../ik-upload/ik-upload.component.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sdk/lib/src/imagekitio-angular/ik-upload/ik-upload.component.ts b/sdk/lib/src/imagekitio-angular/ik-upload/ik-upload.component.ts index 767792de..3abd36b6 100644 --- a/sdk/lib/src/imagekitio-angular/ik-upload/ik-upload.component.ts +++ b/sdk/lib/src/imagekitio-angular/ik-upload/ik-upload.component.ts @@ -5,7 +5,7 @@ import { IkUploadComponentOptions, Dict, HTMLInputEvent } from '../utility/ik-ty @Component({ selector: 'ik-upload', template: ` - + @@ -14,6 +14,7 @@ import { IkUploadComponentOptions, Dict, HTMLInputEvent } from '../utility/ik-ty }) export class IkUploadComponent implements AfterViewInit { @Input('fileName') fileName: string; //optional + @Input('acceptedExtension') acceptedExtension: string; //optional @Input('useUniqueFileName') useUniqueFileName: boolean; //optional @Input('tags') tags: Array; //optional @Input('folder') folder: string; //optional @@ -38,9 +39,9 @@ export class IkUploadComponent implements AfterViewInit { @Input('onUploadProgress') onUploadProgress: (e: ProgressEvent) => void; fileToUpload: File = null; - constructor(private el: ElementRef, private imagekit: ImagekitService) { + constructor(private el: ElementRef, private imagekit: ImagekitService) { } - + ngAfterViewInit():void { this.buttonRef && this.buttonRef.addEventListener('click', ()=>{this.el.nativeElement.children[0].click()}); } @@ -73,10 +74,10 @@ export class IkUploadComponent implements AfterViewInit { if (!this.checkCustomFileValidation(options.file)) { return; } - + this.startIkUpload(e, options); } - + checkCustomFileValidation(file: File): boolean { if (this.validateFile && typeof this.validateFile === 'function') { return this.validateFile(file); @@ -95,15 +96,15 @@ export class IkUploadComponent implements AfterViewInit { const params = this.getUploadParams(options); const progressCb = this.createUploadProgressMonitor(options.xhr); const ik = this.getIkInstance(); - + ik.upload(params, (err, result) => { this.handleUploadResponse(err, result, options, options.xhr, progressCb) }); } getIkInstance(): any { - if(this.publicKey === undefined || - this.urlEndpoint === undefined || + if(this.publicKey === undefined || + this.urlEndpoint === undefined || this.authenticationEndpoint === undefined){ return this.imagekit.ikInstance; } From 54959380243e3b1c1e34f7af742e22ff7c91224f Mon Sep 17 00:00:00 2001 From: Stefano Denti Date: Tue, 27 Jun 2023 09:12:44 +0200 Subject: [PATCH 2/2] Compilation fails due to missing generic type #60 --- sdk/lib/src/imagekitio-angular/imagekitio-angular.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lib/src/imagekitio-angular/imagekitio-angular.module.ts b/sdk/lib/src/imagekitio-angular/imagekitio-angular.module.ts index 7de4e228..9488b4a8 100644 --- a/sdk/lib/src/imagekitio-angular/imagekitio-angular.module.ts +++ b/sdk/lib/src/imagekitio-angular/imagekitio-angular.module.ts @@ -14,7 +14,7 @@ import { ImageKitConfiguration, ImagekitService } from './imagekit.service'; }) export class ImagekitioAngularModule { - static forRoot(config: ImageKitConfiguration): ModuleWithProviders { + static forRoot(config: ImageKitConfiguration): ModuleWithProviders { return { ngModule: ImagekitioAngularModule, providers: [