RED-9201 - UI for Component Mapping Tables
This commit is contained in:
parent
c5fd581a62
commit
456ca8cc46
@ -73,19 +73,20 @@ export class AddEditComponentMappingDialogComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fileChanged(file: Blob) {
|
fileChanged(file: File) {
|
||||||
this.form.get('file').setValue(file);
|
this.form.get('file').setValue(file);
|
||||||
|
this.form.get('fileName').setValue(file?.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
const fileName = document.getElementById('file-name-label')?.textContent;
|
this.dialogRef.close({ ...this.data.mapping, ...this.form.getRawValue() });
|
||||||
this.dialogRef.close({ ...this.data.mapping, ...this.form.getRawValue(), fileName });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#getForm(): UntypedFormGroup {
|
#getForm(): UntypedFormGroup {
|
||||||
return this._formBuilder.group({
|
return this._formBuilder.group({
|
||||||
name: [this.data?.mapping?.name, Validators.required],
|
name: [this.data?.mapping?.name, Validators.required],
|
||||||
file: [null, 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],
|
encoding: this.encodingTypeOptions.find(e => e === this.data?.mapping?.encoding) ?? this.encodingTypeOptions[0],
|
||||||
delimiter: [this.data?.mapping?.delimiter ?? ',', Validators.required],
|
delimiter: [this.data?.mapping?.delimiter ?? ',', Validators.required],
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user