mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5390] [ADF-5391] Add multivalue cardview for Date, Datetime, Integers and Decimal properties. (#6980)
* [ADF-5390] Addd multivalue cardview for Date, Datetime, Integers and Decimal properties * Fix unit test * Fix linting * Fix e2e tests * fix e2e Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com>
This commit is contained in:
@@ -119,7 +119,7 @@ export class PropertyGroupTranslatorService {
|
||||
|
||||
if (this.isListOfValues(propertyDefinition.constraints)) {
|
||||
const options = propertyDefinition.constraints[0].parameters.allowedValues.map((value) => ({ key: value, label: value }));
|
||||
const properties = Object.assign(propertyDefinition, { options$: of(options) });
|
||||
const properties = Object.assign(propertyDefinition, { options$: of(options) });
|
||||
|
||||
cardViewItemProperty = new CardViewSelectItemModel(properties);
|
||||
} else {
|
||||
@@ -132,22 +132,35 @@ export class PropertyGroupTranslatorService {
|
||||
|
||||
case D_INT:
|
||||
case D_LONG:
|
||||
cardViewItemProperty = new CardViewIntItemModel(propertyDefinition);
|
||||
cardViewItemProperty = new CardViewIntItemModel(Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
}));
|
||||
break;
|
||||
|
||||
case D_FLOAT:
|
||||
case D_DOUBLE:
|
||||
cardViewItemProperty = new CardViewFloatItemModel(Object.assign(propertyDefinition, {
|
||||
pipes: [{ pipe: this.decimalNumberPipe }]
|
||||
multivalued: isMultiValued,
|
||||
pipes: [
|
||||
{ pipe: this.decimalNumberPipe },
|
||||
{ pipe: this.multiValuePipe, params: [this.valueSeparator] }
|
||||
]
|
||||
}));
|
||||
break;
|
||||
|
||||
case D_DATE:
|
||||
cardViewItemProperty = new CardViewDateItemModel(propertyDefinition);
|
||||
cardViewItemProperty = new CardViewDateItemModel(Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
}));
|
||||
break;
|
||||
|
||||
case D_DATETIME:
|
||||
cardViewItemProperty = new CardViewDatetimeItemModel(propertyDefinition);
|
||||
cardViewItemProperty = new CardViewDatetimeItemModel(Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
}));
|
||||
break;
|
||||
|
||||
case D_BOOLEAN:
|
||||
@@ -159,7 +172,7 @@ export class PropertyGroupTranslatorService {
|
||||
cardViewItemProperty = new CardViewTextItemModel(Object.assign(propertyDefinition, {
|
||||
multivalued: isMultiValued,
|
||||
multiline: isMultiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator]}]
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator] }]
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user