|
|
|
|
@ -7,6 +7,8 @@ import { AuthenticatedUser } from "./hmg-common/services/authentication/models/a
|
|
|
|
|
import { TabsBarComponent } from "./hmg-common/ui/tabs-bar/tabs-bar.component";
|
|
|
|
|
import { KeyboardService } from "./hmg-common/services/keyboard/keyboard.service";
|
|
|
|
|
|
|
|
|
|
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
|
|
|
|
|
|
|
|
|
|
import { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service";
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
@ -20,7 +22,7 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
|
start: any = false;
|
|
|
|
|
menuList: any = [];
|
|
|
|
|
User_name_Emp: string = "";
|
|
|
|
|
user_image: string = "../assets/imgs/profile.png"
|
|
|
|
|
user_image: string = "../assets/imgs/profile.png";
|
|
|
|
|
menuSide: string = "left";
|
|
|
|
|
notBadge: number;
|
|
|
|
|
companyUrl: string = "../assets/imgs/CS.png";
|
|
|
|
|
@ -33,7 +35,8 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
|
private platform: Platform,
|
|
|
|
|
private events: Events,
|
|
|
|
|
private keyboardService: KeyboardService,
|
|
|
|
|
private menu: MenuController
|
|
|
|
|
private menu: MenuController,
|
|
|
|
|
private authService: AuthenticationService
|
|
|
|
|
) {}
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.initializeApp();
|
|
|
|
|
@ -48,20 +51,45 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
|
// this.statusBar.styleDefault();
|
|
|
|
|
this.start = true;
|
|
|
|
|
this.watchLanguageChangeEvents();
|
|
|
|
|
// this.checkIfUserLoggedInBefore();
|
|
|
|
|
this.subscribeEvents();
|
|
|
|
|
this.keyboardService.watchKeyboard();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
subscribeEvents() {
|
|
|
|
|
this.events.subscribe("setMenu", () => {
|
|
|
|
|
const user = this.authService
|
|
|
|
|
.loadAuthenticatedUser()
|
|
|
|
|
.subscribe((user: AuthenticatedUser) => {
|
|
|
|
|
if (user) {
|
|
|
|
|
this.companyUrl = user.CompanyImageURL
|
|
|
|
|
? user.CompanyImageURL
|
|
|
|
|
: "../assets/imgs/CS.png";
|
|
|
|
|
|
|
|
|
|
this.companyDesc = user.CompanyImageDescription
|
|
|
|
|
? user.CompanyImageDescription
|
|
|
|
|
: "Powered By Cloud Solutions";
|
|
|
|
|
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
|
|
|
|
|
this.user_image = user.EMPLOYEE_IMAGE
|
|
|
|
|
? "data:image/png;base64," + user.EMPLOYEE_IMAGE
|
|
|
|
|
: "../assets/imgs/profile.png";
|
|
|
|
|
console.log(user);
|
|
|
|
|
} else {
|
|
|
|
|
console.log(user);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
this.events.subscribe("getNotCount", badge => {
|
|
|
|
|
this.notBadge = badge;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
private initializeDirection() {
|
|
|
|
|
this.direction = TranslatorService.getCurrentDirection();
|
|
|
|
|
}
|
|
|
|
|
private watchUserLoginChangeEvents() {
|
|
|
|
|
this.events.subscribe(
|
|
|
|
|
AuthenticationService.LOGIN_EVENT,
|
|
|
|
|
(user: AuthenticatedUser, time: Date) => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
(user: AuthenticatedUser, time: Date) => {}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
private watchLanguageChangeEvents() {
|
|
|
|
|
@ -73,4 +101,11 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
|
}, 100);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
logout() {
|
|
|
|
|
// let req:any={};
|
|
|
|
|
// this.menuService.disableSession(req).subscribe((result: any) => {
|
|
|
|
|
// });
|
|
|
|
|
this.cs.sharedService.clearAll();
|
|
|
|
|
this.cs.openLogin();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|