Merge branch 'VM/RED-9201' into 'master'

RED-9201 - UI for Component Mapping Tables

Closes RED-9201

See merge request redactmanager/red-ui!514
This commit is contained in:
Dan Percic 2024-07-26 15:17:24 +02:00
commit c1a8898e92

View File

@ -73,19 +73,20 @@ export class AddEditComponentMappingDialogComponent
}
}
fileChanged(file: Blob) {
fileChanged(file: File) {
this.form.get('file').setValue(file);
this.form.get('fileName').setValue(file?.name);
}
save() {
const fileName = document.getElementById('file-name-label')?.textContent;
this.dialogRef.close({ ...this.data.mapping, ...this.form.getRawValue(), fileName });
this.dialogRef.close({ ...this.data.mapping, ...this.form.getRawValue() });
}
#getForm(): UntypedFormGroup {
return this._formBuilder.group({
name: [this.data?.mapping?.name, Validators.required],
file: [null, Validators.required],
fileName: [this.data?.mapping?.fileName, Validators.required],
encoding: this.encodingTypeOptions.find(e => e === this.data?.mapping?.encoding) ?? this.encodingTypeOptions[0],
delimiter: [this.data?.mapping?.delimiter ?? ',', Validators.required],
});