X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=portal-FE-common%2Fsrc%2Fapp%2Flayout%2Fcomponents%2Fheader%2Fheader.component.ts;h=7a8e7095b5bde36e2b41e93f03f2a855be55ee29;hb=refs%2Fchanges%2F85%2F111385%2F1;hp=74f6fb3a43c7978c215bef63e9bd6de100807a35;hpb=8c25a4de18479983cb63824ebc75b4263c12ffad;p=portal.git diff --git a/portal-FE-common/src/app/layout/components/header/header.component.ts b/portal-FE-common/src/app/layout/components/header/header.component.ts index 74f6fb3a..7a8e7095 100644 --- a/portal-FE-common/src/app/layout/components/header/header.component.ts +++ b/portal-FE-common/src/app/layout/components/header/header.component.ts @@ -92,17 +92,20 @@ export class HeaderComponent implements OnInit { this.brandLogoImagePath = this.api.brandLogoImagePath; } - this.menusService.getAllLanguages().subscribe(data =>{ - this.result = data; + } + + getLanguageInfo() { + this.menusService.getAllLanguages().subscribe(data =>{ + this.result = data; for(let lang of this.result.languageList ){ this.languages.push(lang); } - - this.menusService.getCurrentLang(this.loginSnippetUserid).subscribe(data=>{ - this.result = data; + + this.menusService.getCurrentLang(this.loginSnippetUserid).subscribe(data=>{ + this.result = data; this.languages.map((obj:any)=>{ obj.selected = obj.languageId == parseInt(this.result.languageId); - }) ; + }) ; }); }); } @@ -123,6 +126,7 @@ export class HeaderComponent implements OnInit { this.loginSnippetEmail = res.email; this.loginSnippetUserid = res.userId; this.lastLogin = Date.parse(res.last_login); + this.getLanguageInfo(); } if(res != null && res.isSystemUser === 'true'){ this.isSystemUser = true; @@ -218,7 +222,6 @@ export class HeaderComponent implements OnInit { setLanguage(langId : string){ this.menusService.setLanguage(langId, this.loginSnippetUserid).subscribe(data =>{ - console.log("Language Applied :", data); this.languageEvent.emit(langId); }); }