|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import { Platform, Events, MenuController } from '@ionic/angular';
|
|
|
|
|
import { Platform, Events, MenuController, ModalController } from '@ionic/angular';
|
|
|
|
|
import { TranslatorService } from './hmg-common/services/translator/translator.service';
|
|
|
|
|
import { CommonService } from './hmg-common/services/common/common.service';
|
|
|
|
|
import { AuthenticationService } from './hmg-common/services/authentication/authentication.service';
|
|
|
|
|
@ -10,6 +10,7 @@ import { LazyLoadingService } from './hmg-common/services/lazy-loading/lazy-load
|
|
|
|
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
|
|
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
import { DigitalIdComponent } from './authentication/digital-id/digital-id.component';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-root',
|
|
|
|
|
@ -37,6 +38,8 @@ export class AppComponent implements OnInit {
|
|
|
|
|
DeviceToken: string; // this.deviceToken
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private digitalIDUser: any;
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
private cs: CommonService,
|
|
|
|
|
@ -50,6 +53,7 @@ export class AppComponent implements OnInit {
|
|
|
|
|
public pushService: PushService,
|
|
|
|
|
private splashScreen: SplashScreen,
|
|
|
|
|
public router: Router,
|
|
|
|
|
public modalController: ModalController
|
|
|
|
|
) {
|
|
|
|
|
this.events.subscribe('img-change', displayImg => {
|
|
|
|
|
console.log('app compont: ' + displayImg);
|
|
|
|
|
@ -116,8 +120,7 @@ export class AppComponent implements OnInit {
|
|
|
|
|
this.events.subscribe('setMenu', () => {
|
|
|
|
|
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
if (user) {
|
|
|
|
|
const digitalIDUser: any = JSON.stringify(user);
|
|
|
|
|
localStorage.setItem('digitalIDUser', digitalIDUser);
|
|
|
|
|
this.digitalIDUser = user//JSON.stringify(user);
|
|
|
|
|
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
|
|
|
|
|
this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription : 'Powered By Cloud Solutions';
|
|
|
|
|
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
|
|
|
|
|
@ -188,6 +191,17 @@ export class AppComponent implements OnInit {
|
|
|
|
|
this.menu.toggle();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async openDigitalId() {
|
|
|
|
|
const modal = await this.modalController.create({
|
|
|
|
|
component: DigitalIdComponent,
|
|
|
|
|
cssClass: 'digital-id-modal-css',
|
|
|
|
|
componentProps: {
|
|
|
|
|
'userInfo':this.digitalIDUser//JSON.parse(this.digitalIDUser)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return await modal.present();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private changeImage() {
|
|
|
|
|
this.cs.openChangeImagePage();
|
|
|
|
|
this.menu.toggle();
|
|
|
|
|
|