mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ADF-4219] Multivalue Metadata Card View (#4600)
* [ADF-4219] Multivalue Metadata Card View * [ADF-4219] Add documentation * [ADF-4219] Improve code, docs and tests * [ADF-4219] Fix e2e tests
This commit is contained in:
committed by
Eugenio Romano
parent
21fd0299bd
commit
8395b0baa5
+12
-3
@@ -25,7 +25,9 @@ import {
|
||||
CardViewDatetimeItemModel,
|
||||
CardViewIntItemModel,
|
||||
CardViewFloatItemModel,
|
||||
LogService
|
||||
LogService,
|
||||
MultiValuePipe,
|
||||
AppConfigService
|
||||
} from '@alfresco/adf-core';
|
||||
import { Property, CardViewGroup, OrganisedPropertyGroup } from '../interfaces/content-metadata.interfaces';
|
||||
|
||||
@@ -46,7 +48,12 @@ export class PropertyGroupTranslatorService {
|
||||
|
||||
static readonly RECOGNISED_ECM_TYPES = [D_TEXT, D_MLTEXT, D_DATE, D_DATETIME, D_INT, D_LONG, D_FLOAT, D_DOUBLE, D_BOOLEAN];
|
||||
|
||||
constructor(private logService: LogService) {
|
||||
valueSeparator: string;
|
||||
|
||||
constructor(private logService: LogService,
|
||||
private multiValuePipe: MultiValuePipe,
|
||||
private appConfig: AppConfigService) {
|
||||
this.valueSeparator = this.appConfig.get<string>('content-metadata.multi-value-pipe-separator');
|
||||
}
|
||||
|
||||
public translateToCardViewGroups(propertyGroups: OrganisedPropertyGroup[], propertyValues): CardViewGroup[] {
|
||||
@@ -115,7 +122,9 @@ export class PropertyGroupTranslatorService {
|
||||
case D_TEXT:
|
||||
default:
|
||||
cardViewItemProperty = new CardViewTextItemModel(Object.assign(propertyDefinition, {
|
||||
multiline: false
|
||||
multivalued: property.multiValued,
|
||||
multiline: property.multiValued,
|
||||
pipes: [{ pipe: this.multiValuePipe, params: [this.valueSeparator]}]
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user