dashboard changes

production
Sultan Khan 7 years ago
parent 0bf7dbd72e
commit e083d0c783

@ -1,9 +1,9 @@
<!-- <ion-nav [root]="rootPage" #mycontent swipeBackEnabled="false"></ion-nav> -->
<!-- (ionWillOpen)="menuOpened(true)" -->
<ion-app [dir]="direction">
<ion-split-pane>
<ion-menu [side]=" direction === 'rtl' ? 'end' : 'start'" [swipeGesture]="false" (ionWillOpen)="menuOpened(true)"
(ionWillClose)="menuOpened(false)">
<ion-menu [side]=" direction === 'rtl' ? 'end' : 'start'" [swipeGesture]="false" >
<ion-content class="sidebar-menu" >
<div class="header-div">
<div class="centerDiv">

@ -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();
}
}

@ -304,6 +304,8 @@ export class AuthenticationService {
user.P_SESSION_ID = result.P_SESSION_ID;
user.MobileNumber = result.EMPLOYEE_MOBILE_NUMBER;
user.TokenID = result.TokenID;
user.CompanyImageDescription=result.CompanyImageDescription;
user.CompanyImageURL=result.CompanyImageURL;
user.LogInTokenID = this.cs.sharedService.getSharedData(
"logindata"
).LogInTokenID;

@ -75,4 +75,6 @@ USER_STATUS: string;
P_SESSION_ID:number;
MobileNumber:string;
LogInTokenID:string;
CompanyImageDescription: string
CompanyImageURL: string
}

@ -12,14 +12,14 @@
<ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge>
</button>
<div class="centerDiv" (click)="openPersonalInfo()">
<p class="TxtPlace">{{ts.trPK('home','hello')}}, {{User_name_Emp}}, {{User_name_Emp}}</p>
<p class="TxtPlace">{{ts.trPK('home','hello')}}, {{userData.EMPLOYEE_DISPLAY_NAME}}</p>
<div class="profileDiv"><ion-img class="profileImg" src="{{user_image}}"></ion-img></div>
</div>
</div>
<div>
<div>
<p class="dash-header text-caps">{{ts.trPK('home','dashboard')}}, {{User_name_Emp}}</p>
<p class="dash-header text-caps">{{ts.trPK('home','dashboard')}}, {{userData.EMPLOYEE_DISPLAY_NAME}}</p>
</div>
<div>
<ion-grid class="cus-grid">

@ -1,12 +1,12 @@
import { Component, OnInit } from "@angular/core";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuController } from "@ionic/angular";
import { MenuController,Events } from "@ionic/angular";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
@Component({
selector: "app-home",
templateUrl: "./home.page.html",
@ -21,7 +21,8 @@ export class HomePage implements OnInit {
public menu: MenuController,
public authService: AuthenticationService,
public menuService: MenuService,
public common: CommonService
public common: CommonService,
public events:Events
) {}
ngOnInit() {
@ -37,7 +38,9 @@ export class HomePage implements OnInit {
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
this.events.publish('setMenu');
this.userData = user;
this.user_image=user.EMPLOYEE_IMAGE?user.EMPLOYEE_IMAGE: this.user_image;
console.log(user);
} else {
console.log(user);

Loading…
Cancel
Save