RED-10030: persist the keyColumn value even if csv mapping is disabled.
This commit is contained in:
parent
e133e944e3
commit
ef5cd39b16
@ -57,6 +57,7 @@ export class FileAttributesConfigurationsDialogComponent extends BaseDialogCompo
|
||||
if (supportCsvMapping) {
|
||||
return {
|
||||
...this.#configuration,
|
||||
keyColumn: this.form.get('keyColumn').value,
|
||||
filenameMappingColumnHeaderName: this.form.get('keyColumn').value,
|
||||
delimiter: this.form.get('delimiter').value,
|
||||
encoding: this.form.get('encodingType').value,
|
||||
@ -66,13 +67,14 @@ export class FileAttributesConfigurationsDialogComponent extends BaseDialogCompo
|
||||
return {
|
||||
...this.#configuration,
|
||||
filenameMappingColumnHeaderName: '',
|
||||
keyColumn: this.form.get('keyColumn').value,
|
||||
};
|
||||
}
|
||||
|
||||
#getForm() {
|
||||
return this._formBuilder.group({
|
||||
supportCsvMapping: [!!this.#configuration.filenameMappingColumnHeaderName],
|
||||
keyColumn: [this.#configuration.filenameMappingColumnHeaderName || '', [Validators.required]],
|
||||
keyColumn: [this.#configuration.filenameMappingColumnHeaderName || this.#configuration.keyColumn || '', [Validators.required]],
|
||||
delimiter: [this.#configuration.delimiter || '', [Validators.required]],
|
||||
encodingType: [this.#configuration.encoding || FileAttributeEncodingTypes['UTF-8'], [Validators.required]],
|
||||
});
|
||||
|
||||
@ -85,6 +85,7 @@ export default class FileAttributesListingScreenComponent extends ListingCompone
|
||||
},
|
||||
];
|
||||
readonly roles = Roles;
|
||||
keyColumnValue: string = '';
|
||||
|
||||
constructor(
|
||||
readonly permissionsService: PermissionsService,
|
||||
@ -171,13 +172,13 @@ export default class FileAttributesListingScreenComponent extends ListingCompone
|
||||
FileAttributesConfigurationsDialogComponent,
|
||||
{
|
||||
...defaultDialogConfig,
|
||||
data: this.#existingConfiguration,
|
||||
data: { ...this.#existingConfiguration, keyColumn: this.keyColumnValue },
|
||||
},
|
||||
);
|
||||
|
||||
const configuration = await firstValueFrom(ref.afterClosed());
|
||||
|
||||
if (configuration) {
|
||||
this.keyColumnValue = configuration.keyColumn;
|
||||
await this.#setConfigAndLoadData(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user