[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:
davidcanonieto
2021-05-09 04:05:26 +01:00
committed by GitHub
parent 71cad4c287
commit bd805cb34b
23 changed files with 280 additions and 54 deletions

View File

@@ -29,6 +29,7 @@ export abstract class CardViewBaseItemModel {
validators?: CardViewItemValidator[];
data?: any;
type?: string;
multivalued?: boolean;
constructor(cardViewItemProperties: CardViewItemProperties) {
this.label = cardViewItemProperties.label || '';
@@ -40,6 +41,7 @@ export abstract class CardViewBaseItemModel {
this.icon = cardViewItemProperties.icon || '';
this.validators = cardViewItemProperties.validators || [];
this.data = cardViewItemProperties.data || null;
this.multivalued = !!cardViewItemProperties.multivalued;
if (cardViewItemProperties?.constraints?.length ?? 0) {
for (const constraint of cardViewItemProperties.constraints) {
@@ -51,7 +53,7 @@ export abstract class CardViewBaseItemModel {
}
isEmpty(): boolean {
return this.value === undefined || this.value === null || this.value === '';
return this.value === undefined || this.value === null || this.value.length === 0;
}
isValid(newValue: any): boolean {