Don't auto fill destination values

Instead, filter out empty destination values when updating. It ends up just filling in the first letter of the source, which is just awkward to work with
This commit is contained in:
Amelia 2025-06-20 10:48:21 +02:00
parent 1b54b004db
commit 145d74cd6f

View file

@ -190,7 +190,7 @@ export class ManageMetadataSettingsComponent implements OnInit {
destinationValue: value.destinationValue,
excludeFromSource: value.excludeFromSource
}
}).filter(m => m.sourceValue.length > 0);
}).filter(m => m.sourceValue.length > 0 && m.destinationValue.length > 0);
// Translate blacklist string -> Array<string>
return {
@ -231,15 +231,6 @@ export class ManageMetadataSettingsComponent implements OnInit {
excludeFromSource: [mapping?.excludeFromSource || false]
});
// Autofill destination value if empty when source value loses focus
mappingGroup.get('sourceValue')?.valueChanges
.pipe(
filter(() => !mappingGroup.get('destinationValue')?.value)
)
.subscribe(sourceValue => {
mappingGroup.get('destinationValue')?.setValue(sourceValue);
});
//@ts-ignore
this.fieldMappings.push(mappingGroup);
}