From dee4b2169b06036cc965cfaef9135e7e10b6c1ce Mon Sep 17 00:00:00 2001 From: Peddagouni Divya rekha Date: Mon, 9 Jun 2025 19:44:20 +0530 Subject: [PATCH] Testing RMA-124072 in rmA23.4-CHP1 --- .../src/lib/dxc-file-input/dxc-file-input.component.ts | 9 +++++---- .../lib/dxc-file-input/model/fileuploadrequest.data.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.ts b/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.ts index a764078bd..abadff31e 100644 --- a/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.ts +++ b/projects/dxc-ngx-cdk/src/lib/dxc-file-input/dxc-file-input.component.ts @@ -230,7 +230,7 @@ export class DxcFileInputComponent uploadChunkSize: number = 1000000; isDuplicateUpload: boolean = false; uploadId: string; - renderedValue = ""; + renderedValue :any; private totalUploadedChunkedSize = []; chunkUploadSubscription: { fileName: string; @@ -257,8 +257,8 @@ export class DxcFileInputComponent onTouched: () => void = () => { }; onChangeRegister = (val) => { }; - writeValue(fileNames: any): void { - this.renderedValue = fileNames || ""; + writeValue(fileData: any): void { + this.renderedValue = fileData || null; } registerOnChange(fn: any): void { @@ -332,7 +332,7 @@ export class DxcFileInputComponent checkFileSize(file: File) { if(file.name!=null){ let fileExtension = file.name.split('.').pop(); - if(!this.accept.includes(fileExtension)){ + if (!this.accept.toLowerCase().includes(fileExtension.toLowerCase())){ return this.resources.acceptedFiles.description + this.accept; } } @@ -866,6 +866,7 @@ export class DxcFileInputComponent } this.fileService.delete(this.requests.removeRequest.url, fileData).pipe(take(1)).subscribe((response) => { const arr: FileData[] = []; + this.onChangeRegister({ files: arr, eventType: EventType.REMOVE }); this.fileAddService.files.next({ files: arr, event: "remove" }); }); } diff --git a/projects/dxc-ngx-cdk/src/lib/dxc-file-input/model/fileuploadrequest.data.ts b/projects/dxc-ngx-cdk/src/lib/dxc-file-input/model/fileuploadrequest.data.ts index ce2a54fb5..9bc467e05 100644 --- a/projects/dxc-ngx-cdk/src/lib/dxc-file-input/model/fileuploadrequest.data.ts +++ b/projects/dxc-ngx-cdk/src/lib/dxc-file-input/model/fileuploadrequest.data.ts @@ -16,7 +16,8 @@ export interface IEventResponse { export enum EventType { PREUPLOAD = "PREUPLOAD", UPLOAD = "UPLOAD", - POSTUPLOAD = "POSTUPLOAD" + POSTUPLOAD = "POSTUPLOAD", + REMOVE = "REMOVE" } export interface IRequest {