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,11 +107,11 @@ export class CardViewTextItemComponent implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prepareValueForUpload(property: CardViewTextItemModel, value: string): string | string [] {
|
prepareValueForUpload(property: CardViewTextItemModel, value: string): string | string [] {
|
||||||
const listOfValues = value;
|
|
||||||
if (property.multivalued) {
|
if (property.multivalued) {
|
||||||
return listOfValues.split(this.valueSeparator);
|
const listOfValues = value.split(this.valueSeparator.trim()).map((item) => item.trim());
|
||||||
|
return listOfValues;
|
||||||
}
|
}
|
||||||
return listOfValues;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextAreaInputChange() {
|
onTextAreaInputChange() {
|
||||||
|
@@ -25,8 +25,8 @@ export class MultiValuePipe implements PipeTransform {
|
|||||||
transform(values: string | string [], valueSeparator: string = MultiValuePipe.DEFAULT_SEPARATOR): string {
|
transform(values: string | string [], valueSeparator: string = MultiValuePipe.DEFAULT_SEPARATOR): string {
|
||||||
|
|
||||||
if (values && values instanceof Array) {
|
if (values && values instanceof Array) {
|
||||||
values.map((value) => value.trim());
|
const valueList = values.map((value) => value.trim());
|
||||||
return values.join(valueSeparator);
|
return valueList.join(valueSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
return <string> values;
|
return <string> values;
|
||||||
|
Reference in New Issue
Block a user