[ADF-4713] Add new DecimalNumber Pipe to transform and localize numbers (#4926)

* [ADF-4713] Add new DecimalNumber Pipe to transform and localize numbers

* Unsubscribe from userPreference service

* Make Pipe impure

* Add documentation in localization page
This commit is contained in:
davidcanonieto
2019-07-18 11:09:50 +01:00
committed by Eugenio Romano
parent 8ee5cd1908
commit a0d4160c11
25 changed files with 457 additions and 66 deletions

View File

@@ -27,7 +27,8 @@ import {
CardViewFloatItemModel,
LogService,
MultiValuePipe,
AppConfigService
AppConfigService,
DecimalNumberPipe
} from '@alfresco/adf-core';
import { Property, CardViewGroup, OrganisedPropertyGroup } from '../interfaces/content-metadata.interfaces';
@@ -52,6 +53,7 @@ export class PropertyGroupTranslatorService {
constructor(private logService: LogService,
private multiValuePipe: MultiValuePipe,
private decimalNumberPipe: DecimalNumberPipe,
private appConfig: AppConfigService) {
this.valueSeparator = this.appConfig.get<string>('content-metadata.multi-value-pipe-separator');
}
@@ -104,7 +106,9 @@ export class PropertyGroupTranslatorService {
case D_FLOAT:
case D_DOUBLE:
cardViewItemProperty = new CardViewFloatItemModel(propertyDefinition);
cardViewItemProperty = new CardViewFloatItemModel(Object.assign(propertyDefinition, {
pipes: [{ pipe: this.decimalNumberPipe }]
}));
break;
case D_DATE: