Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class DxcFileInputComponent
uploadChunkSize: number = 1000000;
isDuplicateUpload: boolean = false;
uploadId: string;
renderedValue = "";
renderedValue :any;
private totalUploadedChunkedSize = [];
chunkUploadSubscription: {
fileName: string;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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" });
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export interface IEventResponse {
export enum EventType {
PREUPLOAD = "PREUPLOAD",
UPLOAD = "UPLOAD",
POSTUPLOAD = "POSTUPLOAD"
POSTUPLOAD = "POSTUPLOAD",
REMOVE = "REMOVE"
}

export interface IRequest {
Expand Down
Loading