mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4455] Fix whitespaces trim in multivalue metadata field (#4663)
This commit is contained in:
committed by
Eugenio Romano
parent
7016dabb6c
commit
a172543b8f
@@ -107,12 +107,12 @@ export class CardViewTextItemComponent implements OnChanges {
|
||||
}
|
||||
|
||||
prepareValueForUpload(property: CardViewTextItemModel, value: string): string | string [] {
|
||||
const listOfValues = value;
|
||||
if (property.multivalued) {
|
||||
return listOfValues.split(this.valueSeparator);
|
||||
}
|
||||
const listOfValues = value.split(this.valueSeparator.trim()).map((item) => item.trim());
|
||||
return listOfValues;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
onTextAreaInputChange() {
|
||||
this.errorMessages = this.property.getValidationErrors(this.editedValue);
|
||||
|
@@ -25,8 +25,8 @@ export class MultiValuePipe implements PipeTransform {
|
||||
transform(values: string | string [], valueSeparator: string = MultiValuePipe.DEFAULT_SEPARATOR): string {
|
||||
|
||||
if (values && values instanceof Array) {
|
||||
values.map((value) => value.trim());
|
||||
return values.join(valueSeparator);
|
||||
const valueList = values.map((value) => value.trim());
|
||||
return valueList.join(valueSeparator);
|
||||
}
|
||||
|
||||
return <string> values;
|
||||
|
Reference in New Issue
Block a user