[ADF-1356] Single configuration of i18n service per project (#2199)

* rework i18n layer init

* fix unit tests

* fix tests

* test fixes

* remove obsolete tests
This commit is contained in:
Denys Vuika
2017-08-11 10:55:52 +01:00
committed by Mario Romano
parent bb53844f92
commit 003b0c133b
85 changed files with 333 additions and 431 deletions

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,sCAA8D;AAC9D,uDAA+C;AAE/C,4EAAyE;AACzE,oEAAiE;AACjE,oEAAiE;AAEjE,0DAAqD;AACrD,qDAAgD;AAChD,qDAAgD;AAEnC,QAAA,oBAAoB,GAAU;IACvC,uCAAiB;CACpB,CAAC;AAEW,QAAA,mBAAmB,GAAU;IACtC,iCAAc;IACd,iCAAc;CACjB,CAAC;AAgBF,IAAa,uBAAuB;IAApC;IASA,CAAC;IARU,+BAAO,GAAd;QACI,MAAM,CAAC;YACH,QAAQ,EAAE,yBAAuB;YACjC,SAAS,EACF,2BAAmB,QACzB;SACJ,CAAC;IACN,CAAC;IACL,8BAAC;AAAD,CAAC,AATD,IASC;AATY,uBAAuB;IAdnC,eAAQ,CAAC;QACN,OAAO,EAAE;YACL,8BAAU;SACb;QACD,YAAY,EACL,4BAAoB,QAC1B;QACD,SAAS,EACF,2BAAmB,QACzB;QACD,OAAO,EACA,4BAAoB,QAC1B;KACJ,CAAC;GACW,uBAAuB,CASnC;AATY,0DAAuB"}

View File

@@ -16,7 +16,7 @@
*/
import { ModuleWithProviders, NgModule } from '@angular/core';
import { CoreModule } from 'ng2-alfresco-core';
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
import { UserInfoComponent } from './src/components/user-info.component';
import { BpmUserService } from './src/services/bpm-user.service';
@@ -43,7 +43,15 @@ export const USER_INFO_PROVIDERS: any[] = [
...USER_INFO_DIRECTIVES
],
providers: [
...USER_INFO_PROVIDERS
...USER_INFO_PROVIDERS,
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'ng2-alfresco-userinfo',
source: 'assets/ng2-alfresco-userinfo'
}
}
],
exports: [
...USER_INFO_DIRECTIVES

View File

@@ -16,7 +16,7 @@
*/
import { Component, Input, OnInit } from '@angular/core';
import { AlfrescoAuthenticationService, AlfrescoTranslationService } from 'ng2-alfresco-core';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
import { BpmUserModel } from './../models/bpm-user.model';
import { EcmUserModel } from './../models/ecm-user.model';
import { BpmUserService } from './../services/bpm-user.service';
@@ -51,11 +51,7 @@ export class UserInfoComponent implements OnInit {
constructor(private ecmUserService: EcmUserService,
private bpmUserService: BpmUserService,
private authService: AlfrescoAuthenticationService,
translateService: AlfrescoTranslationService) {
if (translateService) {
translateService.addTranslationFolder('ng2-alfresco-userinfo', 'assets/ng2-alfresco-userinfo');
}
private authService: AlfrescoAuthenticationService) {
authService.onLogin.subscribe((response) => {
this.getUserInfo();
});