|
|
|
|
@ -2,6 +2,8 @@ import { Component, OnInit, Input } from '@angular/core';
|
|
|
|
|
import { ModalController } from '@ionic/angular';
|
|
|
|
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
|
|
|
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
|
|
|
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
|
|
|
|
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-business-card',
|
|
|
|
|
@ -12,15 +14,27 @@ export class BusinessCardComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
public userInfo: any;
|
|
|
|
|
public userJobName: any;
|
|
|
|
|
public jobName: any;
|
|
|
|
|
constructor(
|
|
|
|
|
public modalCtrl: ModalController,
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
public common: CommonService
|
|
|
|
|
public common: CommonService,
|
|
|
|
|
public authService: AuthenticationService,
|
|
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
|
|
|
|
|
console.log(this.userInfo);
|
|
|
|
|
|
|
|
|
|
this.authService
|
|
|
|
|
.loadAuthenticatedUser()
|
|
|
|
|
.subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
if (user) {
|
|
|
|
|
let jobTitle = user.POSITION_NAME.split('.');
|
|
|
|
|
if (jobTitle && jobTitle.length > 1) {
|
|
|
|
|
this.jobName = jobTitle[0] + " " + jobTitle[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -30,4 +44,4 @@ export class BusinessCardComponent implements OnInit {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|