edit side menu conflict

mekawy-issues
Mohamed Mekawy 6 years ago
commit d42ba46ea2

@ -1,99 +1,32 @@
<!-- <ion-nav [root]="rootPage" #mycontent swipeBackEnabled="false"></ion-nav> -->
<!-- (ionWillOpen)="menuOpened(true)" -->
<ion-app [dir]="direction"> <ion-app [dir]="direction">
<ion-split-pane> <ion-split-pane>
<!-- <ion-menu [side]=" direction === 'rtl' ? 'end' : 'start'" [swipeGesture]="false"> -->
<ion-menu side='start' *ngIf="direction ==='ltr'"> <ion-menu side='start' *ngIf="direction ==='ltr'">
<ion-content class="sidebar-menu"> <ion-content class="sidebar-menu">
<div class="header-div"> <div class="header-div">
<div> <div>
<ion-button class="closeIcon" (click)="closeMenu()"> <ion-button class="closeIcon" (click)="closeMenu()">
<img style= "height: 18px !important;" src="../assets/imgs/close_menu_icon.png "></ion-button> <img style= "height: 18px !important;" src="../assets/imgs/close_menu_icon.png "></ion-button>
</div>
<div style="border-bottom: rgb(190, 186, 186) solid 1px;" >
<img class="mohemmLogo" src="../assets/imgs/menu_mohemm_logo.png" >
</div> </div>
<div *ngIf='direction==="ltr"' style="border-bottom: rgb(190, 186, 186) solid 1px;" >
<img class="mohemmLogo" src="../assets/imgs/menu_mohemm_logo.png" ></div>
<hr>
<div *ngIf='direction ==="rtl"' style="border-bottom: rgb(190, 186, 186) solid 1px;" >
<img class="mohemmLogo-ar" src="../assets/imgs/menu_mohemm_logo.png" ></div>
<hr> <hr>
</div> </div>
<div class="centerDiv homeBox">
<div class="centerDiv homeBox" (click)="openPersonalInfo()"> <div class="profileDiv">
<div [ngClass]="direction==='ltr'? 'profileDiv':'profileDiv-ar'">
<!-- <ion-img class="profileImg" src="{{user_image}}"></ion-img> -->
<img class="profileImg" [src]="user_image"> <img class="profileImg" [src]="user_image">
<p class="TxtPlace">{{User_name_Emp}}</p> <p class="TxtPlace">{{User_name_Emp}}</p>
<p class="TxtPlaces"> {{User_Job_name}}</p> <p class="TxtPlaces"> {{User_Job_name}}</p>
</div> </div>
</div> </div>
<!-- <div class="changeImgBtn">
<button ion-button icon-only menuToggle class="menubutton" (click)="changeImage()">
<ion-icon (click)="changeImage();" class="changeIcon" name="md-create"></ion-icon></button>
</div> -->
<!-- <div class="changeImgBtn"> <div style="border-bottom: rgb(190, 187, 187) solid 1px;" >
<ion-button class="editIcon" (click)="changeImage()"> <button class="logout" ion-button (click)="logout();" > {{ts.trPK('home','logout')}}</button>
<img style= "height: 13px !important;" src="../assets/imgs/edit_icon.png ">
</ion-button>
<img class="menuImg" [src]="user_image"></div> -->
<!-- <div class="centerDiv">
<p class="TxtPlace">{{ts.trPK('home')}}, {{User_name_Emp}}</p>
//<div> <img src="{{user_image}}" class="profileImg"></div>
//<div><img class="menuImg" [src]="user_image"></div>
<p class="TxtPlaces">{{ts.trPK('home')}}, {{User_Job_name}}</p>
</div> -->
<div style="border-bottom: rgb(190, 187, 187) solid 1px;" >
<button [ngClass]="direction ==='ltr'? 'logout':'logout-ar'" ion-button (click)="logout();" > {{ts.trPK('home','logout')}}</button>
</div> </div>
<br>
<!-- <div>
<ion-item (click)="logout();">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/signout.png" item-left>
</ion-thumbnail>
<ion-label>
{{ts.trPK('home','logout')}}
</ion-label>
</ion-item>
</div> -->
<br>
<ion-list> <ion-list>
<ion-item (click)="profile()"> <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 24px !important;" src="../assets/imgs/profile_icon.png" item-left> <img style= "height: 24px !important;" src="../assets/imgs/profile_icon.png" item-left>
@ -120,209 +53,85 @@
</ion-thumbnail> </ion-thumbnail>
<ion-label class="changepassword" > <ion-label class="changepassword" >
{{ts.trPK('login','changepassword')}} {{ts.trPK('login','changepassword')}}
<ion-badge class="start-badge main-badge" slot="end" color="danger">{{notBadge}}</ion-badge>
<ion-badge [ngClass]=" direction === 'rtl' ? 'end-badge' : 'start-badge'" slot="end" color="danger" class="main-badge">{{notBadge}}</ion-badge>
</ion-label> </ion-label>
<!-- <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >
</button> -->
</ion-item> </ion-item>
<!-- <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/profile_icon.png" item-left>
</ion-thumbnail>
<ion-label>
{{ts.trPK('userProfile','title')}}
</ion-label>
</ion-item> -->
<!-- <ion-item (click)="logout();">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/signout.png" item-left>
</ion-thumbnail>
<ion-label>
{{ts.trPK('home','logout')}}
</ion-label>
</ion-item> -->
</ion-list> </ion-list>
<div class="" style="text-align:center"> <div class="" style="text-align:center">
<img src="{{companyUrl}}" class="CompanyImg logoImg"> <img src="{{companyUrl}}" class="CompanyImg logoImg">
<p class="companyTxt">{{CompanyImageDescription}}</p> <p class="companyTxt">{{companyDesc}}</p>
</div> </div>
<div class="menuFooter"> <div class="menuFooter">
<!-- <div> <img src="../assets/imgs/CS.png" class="CompanyImg"></div> -->
<p class="companyTxt">{{companyDesc}}</p> <p class="companyTxt">{{companyDesc}}</p>
</div> </div>
</ion-content> </ion-content>
</ion-menu> </ion-menu>
<ion-menu side='end' *ngIf="direction ==='rtl'">
<ion-content class="sidebar-menu">
<div class="header-div">
<div>
<ion-button class="closeIcon" (click)="closeMenu()">
<img style= "height: 18px !important;" src="../assets/imgs/close_menu_icon.png "></ion-button>
<ion-menu side='end' *ngIf="direction ==='rtl'">
<ion-content class="sidebar-menu">
<div class="header-div">
<div>
<ion-button class="closeIcon" (click)="closeMenu()">
<img style= "height: 18px !important;" src="../assets/imgs/close_menu_icon.png "></ion-button>
</div>
<div style="border-bottom: rgb(190, 186, 186) solid 1px;" >
<img class="mohemmLogo-ar" src="../assets/imgs/menu_mohemm_logo.png" >
</div>
<hr>
</div> </div>
<div *ngIf='direction==="ltr"' style="border-bottom: rgb(190, 186, 186) solid 1px;" > <div class="centerDiv homeBox">
<img class="mohemmLogo" src="../assets/imgs/menu_mohemm_logo.png" ></div> <div class="profileDiv-ar">
<img class="profileImg" [src]="user_image">
<hr> <p class="TxtPlace">{{User_name_Emp}}</p>
<div *ngIf='direction ==="rtl"' style="border-bottom: rgb(190, 186, 186) solid 1px;" > <p class="TxtPlaces"> {{User_Job_name}}</p>
<img class="mohemmLogo-ar" src="../assets/imgs/menu_mohemm_logo.png" ></div> </div>
<hr>
</div>
<div class="centerDiv homeBox">
<div [ngClass]="direction==='ltr'? 'profileDiv':'profileDiv-ar'">
<!-- <ion-img class="profileImg" src="{{user_image}}"></ion-img> -->
<img class="profileImg" [src]="user_image">
<p class="TxtPlace">{{User_name_Emp}}</p>
<p class="TxtPlaces"> {{User_Job_name}}</p>
</div> </div>
</div>
<!-- <div class="changeImgBtn">
<button ion-button icon-only menuToggle class="menubutton" (click)="changeImage()">
<ion-icon (click)="changeImage();" class="changeIcon" name="md-create"></ion-icon></button>
</div> -->
<!-- <div class="changeImgBtn">
<ion-button class="editIcon" (click)="changeImage()">
<img style= "height: 13px !important;" src="../assets/imgs/edit_icon.png ">
</ion-button>
<img class="menuImg" [src]="user_image"></div> -->
<!-- <div class="centerDiv">
<p class="TxtPlace">{{ts.trPK('home')}}, {{User_name_Emp}}</p>
//<div> <img src="{{user_image}}" class="profileImg"></div>
//<div><img class="menuImg" [src]="user_image"></div>
<p class="TxtPlaces">{{ts.trPK('home')}}, {{User_Job_name}}</p>
</div> -->
<div style="border-bottom: rgb(190, 187, 187) solid 1px;" >
<button [ngClass]="direction ==='ltr'? 'logout':'logout-ar'" ion-button (click)="logout();" > {{ts.trPK('home','logout')}}</button>
</div>
<!-- <div>
<ion-item (click)="logout();">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/signout.png" item-left>
</ion-thumbnail>
<ion-label>
{{ts.trPK('home','logout')}}
</ion-label>
</ion-item>
</div> -->
<br>
<ion-list>
<ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 24px !important;" src="../assets/imgs/profile_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('userProfile','title')}}
</ion-label>
</ion-item>
<ion-item [hidden]="TeamFlag!='true'" (click)="openMyTeamPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('myTeam','myTeam-header')}}
</ion-label>
</ion-item>
<div style="border-bottom: rgb(190, 187, 187) solid 1px;" >
<button class="logout-ar" ion-button (click)="logout();" > {{ts.trPK('home','logout')}}</button>
</div>
<br>
<!-- <ion-item (click)="openChangePassword()"> --> <ion-list>
<ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 24px !important;" src="../assets/imgs/profile_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('userProfile','title')}}
</ion-label>
</ion-item>
<ion-item [hidden]="TeamFlag!='true'" (click)="openMyTeamPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('myTeam','myTeam-header')}}
</ion-label>
</ion-item>
<ion-item (click)="openChangePassword()"> <ion-item (click)="openChangePassword()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/lock_icon.png" item-left> <img style= "height: 25px !important;" src="../assets/imgs/lock_icon.png" item-left>
</ion-thumbnail> </ion-thumbnail>
<ion-label class="changepassword" > <ion-label class="changepassword" >
{{ts.trPK('login','changepassword')}} {{ts.trPK('login','changepassword')}}
<ion-badge class="end-badge main-badge" slot="end" color="danger">{{notBadge}}</ion-badge>
<ion-badge [ngClass]=" direction === 'rtl' ? 'end-badge' : 'start-badge'" slot="end" color="danger" class="main-badge">{{notBadge}}</ion-badge> </ion-label>
</ion-label> </ion-item>
<!-- <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" > </ion-list>
</button> -->
</ion-item>
<!-- <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/profile_icon.png" item-left>
</ion-thumbnail>
<ion-label>
{{ts.trPK('userProfile','title')}}
</ion-label>
</ion-item> -->
<!-- <ion-item (click)="logout();">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/signout.png" item-left>
</ion-thumbnail>
<ion-label>
{{ts.trPK('home','logout')}}
</ion-label>
</ion-item> -->
</ion-list>
<div class="" style="text-align:center">
<img src="{{companyUrl}}" class="CompanyImg logoImg">
<p class="companyTxt">{{companyDesc}}</p>
</div>
<div class="menuFooter">
<!-- <div> <img src="../assets/imgs/CS.png" class="CompanyImg"></div> -->
<p class="companyTxt">{{companyDesc}}</p>
</div>
</ion-content>
</ion-menu>
<div class="" style="text-align:center">
<img src="{{companyUrl}}" class="CompanyImg logoImg">
<p class="companyTxt">{{companyDesc}}</p>
</div>
<div class="menuFooter">
<p class="companyTxt">{{companyDesc}}</p>
</div>
</ion-content>
</ion-menu>
<ion-router-outlet main></ion-router-outlet> <ion-router-outlet main></ion-router-outlet>
</ion-split-pane> </ion-split-pane>
</ion-app> </ion-app>

@ -1,44 +1,44 @@
import { Component, OnInit, ViewChild, AfterViewInit } from "@angular/core"; import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { Platform, Events, MenuController } from "@ionic/angular"; import { Platform, Events, MenuController } from '@ionic/angular';
import { TranslatorService } from "./hmg-common/services/translator/translator.service"; import { TranslatorService } from './hmg-common/services/translator/translator.service';
import { CommonService } from "./hmg-common/services/common/common.service"; import { CommonService } from './hmg-common/services/common/common.service';
import { AuthenticationService } from "./hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from './hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from "./hmg-common/services/authentication/models/authenticated-user"; import { AuthenticatedUser } from './hmg-common/services/authentication/models/authenticated-user';
import { TabsBarComponent } from "./hmg-common/ui/tabs-bar/tabs-bar.component"; import { TabsBarComponent } from './hmg-common/ui/tabs-bar/tabs-bar.component';
import { KeyboardService } from "./hmg-common/services/keyboard/keyboard.service"; import { KeyboardService } from './hmg-common/services/keyboard/keyboard.service';
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response"; import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response';
import { PushService } from '../../src/app/hmg-common/services/push/push.service'; import { PushService } from '../../src/app/hmg-common/services/push/push.service';
import { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service"; import { LazyLoadingService } from './hmg-common/services/lazy-loading/lazy-loading.service';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
// import { SplashScreen } from '@ionic-native/splash-screen'; // import { SplashScreen } from '@ionic-native/splash-screen';
import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { SplashScreen } from '@ionic-native/splash-screen/ngx';
@Component({ @Component({
selector: "app-root", selector: 'app-root',
styleUrls: ["./app.component.scss"], styleUrls: ['./app.component.scss'],
templateUrl: "app.component.html" templateUrl: 'app.component.html'
}) })
export class AppComponent implements OnInit, AfterViewInit { export class AppComponent implements OnInit, AfterViewInit {
// rootPage:any = LoginPage; // rootPage:any = LoginPage;
// @ViewChild(Nav) nav: Nav; // @ViewChild(Nav) nav: Nav;
start: any = false; start: any = false;
menuList: any = []; menuList: any = [];
User_name_Emp: string = ""; User_name_Emp = '';
user_image: any = "../assets/imgs/profile.png"; user_image: any = '../assets/imgs/profile.png';
menuSide: string = "left"; menuSide = 'left';
notBadge: number; notBadge: number;
companyUrl: string = "../assets/imgs/CS.png"; companyUrl = '../assets/imgs/CS.png';
companyDesc: string = "Powered By Cloud Solutions"; companyDesc = 'Powered By Cloud Solutions';
public direction = "ltr"; direction = 'ltr';
User_Job_name: string; User_Job_name: string;
public logoutFlage: any =false; public logoutFlage: any = false;
requestGetLoginInfo: { requestGetLoginInfo: {
DeviceType: string; DeviceToken: string; //this.deviceToken DeviceType: string; DeviceToken: string; // this.deviceToken
}; };
user: boolean; user: boolean;
deviceToken: string; deviceToken: string;
TeamFlag :string = "false"; TeamFlag: string = 'false';
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
private cs: CommonService, private cs: CommonService,
@ -53,23 +53,23 @@ export class AppComponent implements OnInit, AfterViewInit {
private splashScreen: SplashScreen private splashScreen: SplashScreen
) { ) {
this.events.subscribe("img-change", displayImg => { this.events.subscribe('img-change', displayImg => {
console.log("app compont: "+displayImg); console.log('app compont: ' + displayImg);
//this.user_image = "data:image/png;base64"+displayImg; // this.user_image = "data:image/png;base64"+displayImg;
this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg); this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg);
}); });
} }
ngOnInit() { ngOnInit() {
this.initializeApp(); this.initializeApp();
} }
ngAfterViewInit() {} ngAfterViewInit() {}
initializeApp() { initializeApp() {
this.start = false; this.start = false;
this.menu.enable(false) this.menu.enable(false);
this.lazyLoadingService.monitorLazyLoading(15, true); this.lazyLoadingService.monitorLazyLoading(15, true);
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.ts.loadResources(() => { this.ts.loadResources(() => {
@ -85,44 +85,44 @@ export class AppComponent implements OnInit, AfterViewInit {
} }
private startReceivingPushService() { private startReceivingPushService() {
console.log("platform.ready") console.log('platform.ready');
this.pushService.startReceiving(); this.pushService.startReceiving();
setTimeout(() => { setTimeout(() => {
console.log(" in setTimeout startReceiving"); console.log(' in setTimeout startReceiving');
this.getLastLoginInfo(); this.getLastLoginInfo();
},4000); }, 4000);
} }
subscribeEvents() { subscribeEvents() {
this.events.subscribe("setMenu", () => { this.events.subscribe('setMenu', () => {
const user = this.authService const user = this.authService
.loadAuthenticatedUser() .loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => { .subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
this.companyUrl = user.CompanyImageURL this.companyUrl = user.CompanyImageURL
? user.CompanyImageURL ? user.CompanyImageURL
: "../assets/imgs/CS.png"; : '../assets/imgs/CS.png';
this.companyDesc = user.CompanyImageDescription this.companyDesc = user.CompanyImageDescription
? user.CompanyImageDescription ? user.CompanyImageDescription
: "Powered By Cloud Solutions"; : 'Powered By Cloud Solutions';
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME; this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
if(this.cs.getUpdateImage().status){ if (this.cs.getUpdateImage().status) {
this.user_image =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img); this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
}else{ } else {
this.user_image = user.EMPLOYEE_IMAGE this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: "../assets/imgs/profile.png"; : '../assets/imgs/profile.png';
} }
this.User_Job_name=user.JOB_NAME; this.User_Job_name = user.JOB_NAME;
console.log(user); console.log(user);
} else { } else {
console.log(user); console.log(user);
} }
}); });
}); });
this.events.subscribe("getNotCount", badge => { this.events.subscribe('getNotCount', badge => {
this.notBadge = badge; this.notBadge = badge;
}); });
@ -152,12 +152,12 @@ export class AppComponent implements OnInit, AfterViewInit {
} }
logout() { logout() {
this.cs.sharedService.clearAll(); this.cs.sharedService.clearAll();
//this.menu.toggle(); // this.menu.toggle();
this.menu.enable(false); this.menu.enable(false);
this.logoutFlage=true; this.logoutFlage = true;
this.events.publish('logoutFlage', this.logoutFlage); this.events.publish('logoutFlage', this.logoutFlage);
this.cs.setUpdateImage("",false); this.cs.setUpdateImage('', false);
this.TeamFlag ="false"; this.TeamFlag = 'false';
this.getLastLoginInfo(); this.getLastLoginInfo();
// this.cs.openLogin(); // this.cs.openLogin();
@ -167,7 +167,7 @@ export class AppComponent implements OnInit, AfterViewInit {
openMyTeamPage() { openMyTeamPage() {
this.menu.toggle(); this.menu.toggle();
this.cs.openMyTeamPage(); this.cs.openMyTeamPage();
} }
// profile() { // profile() {
// this.cs.openProfile(); // this.cs.openProfile();
@ -178,17 +178,17 @@ export class AppComponent implements OnInit, AfterViewInit {
this.cs.openEditProfile(); this.cs.openEditProfile();
this.menu.toggle(); this.menu.toggle();
} }
openNotification(){ openNotification() {
this.cs.openNotificationPage(); this.cs.openNotificationPage();
this.menu.toggle(); this.menu.toggle();
} }
openChangePassword(){ openChangePassword() {
this.cs.openChangePassword(); this.cs.openChangePassword();
this.menu.toggle(); this.menu.toggle();
} }
// openPayslipPage(){ // openPayslipPage(){
// this.cs.openPayslipPage(); // this.cs.openPayslipPage();
// this.menu.toggle(); // this.menu.toggle();
@ -199,47 +199,47 @@ export class AppComponent implements OnInit, AfterViewInit {
this.menu.toggle(); this.menu.toggle();
} }
closeMenu(){ closeMenu() {
this.menu.toggle(); this.menu.toggle();
} }
getLastLoginInfo(){ getLastLoginInfo() {
console.log(" getLastLoginInfo"); console.log(' getLastLoginInfo');
console.log("get method :"+this.cs.getDeviceToken()); console.log('get method :' + this.cs.getDeviceToken());
this.deviceToken= this.cs.getDeviceToken(); this.deviceToken = this.cs.getDeviceToken();
//this.cs.sharedService.getSharedData("new-device-token",false);// localStorage.getItem('devicyeToken'); // this.cs.sharedService.getSharedData("new-device-token",false);// localStorage.getItem('devicyeToken');
console.log("let deviceToken app" + this.cs.sharedService.getSharedData("new-device-token",false)); console.log('let deviceToken app' + this.cs.sharedService.getSharedData('new-device-token', false));
console.log("localStorage.getItem app" + localStorage.getItem('devicyeToken')); console.log('localStorage.getItem app' + localStorage.getItem('devicyeToken'));
console.log("sheard DEVICE_TOKEN" + this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false)); console.log('sheard DEVICE_TOKEN' + this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false));
if (this.deviceToken) { if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken); console.log('login enabled first time: ' + this.deviceToken);
} else { } else {
console.log("no deviceToken" ); console.log('no deviceToken' );
this.pushService.startReceiving(); this.pushService.startReceiving();
setTimeout(() => { setTimeout(() => {
this.deviceToken= localStorage.getItem('deviceToken'); this.deviceToken = localStorage.getItem('deviceToken');
console.log('login enabled second time: ' + this.deviceToken); console.log('login enabled second time: ' + this.deviceToken);
}, 1000); }, 1000);
} }
this.requestGetLoginInfo= { this.requestGetLoginInfo = {
DeviceType:this.cs.getDeviceType(),//'Android', DeviceType: this.cs.getDeviceType(), // 'Android',
DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken DeviceToken: this.deviceToken// "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken
} };
this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => { this.authService.getLoginInfo(this.requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) { if (this.cs.validResponse(res)) {
if(res.Mohemm_GetMobileLoginInfoList.length > 0){ if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData( this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0], // res.Patient_SELECTDeviceIMEIbyIMEIList[0],
@ -250,31 +250,30 @@ export class AppComponent implements OnInit, AfterViewInit {
this.events.publish('user', this.user); this.events.publish('user', this.user);
setTimeout(() => { setTimeout(() => {
this.splashScreen.hide(); this.splashScreen.hide();
},3000); }, 3000);
if(this.logoutFlage){ if (this.logoutFlage) {
this.cs.openLogin(); this.cs.openLogin();
} }
} } else {
else{
this.user = false; this.user = false;
this.events.publish('user', this.user); this.events.publish('user', this.user);
setTimeout(() => { setTimeout(() => {
this.splashScreen.hide(); this.splashScreen.hide();
},3000); }, 3000);
if(this.logoutFlage){ if (this.logoutFlage) {
this.cs.openLogin(); this.cs.openLogin();
} }
} }
}else{
} else {
// this.user = false; // this.user = false;
// this.splashScreen.hide(); // this.splashScreen.hide();
// if(this.logoutFlage){ // if(this.logoutFlage){
@ -284,5 +283,5 @@ export class AppComponent implements OnInit, AfterViewInit {
} }
}); });
} }
} }

@ -2,8 +2,7 @@
[userImage]="userImage" [userImage]="userImage"
showImage="true" showImage="true"
showMenu="true" showMenu="true"
[headerText]="'home,dashboard' | translate" [headerText]="'home,dashboard' | translate">
>
</app-generic-header> </app-generic-header>
<ion-content class="main-dashboard-container"> <ion-content class="main-dashboard-container">

@ -23,9 +23,9 @@ export class MoItemHistoryComponent implements OnInit {
constructor( constructor(
public worklistMainService: WorklistMainService, public worklistMainService: WorklistMainService,
private cs: CommonService, private cs: CommonService,
private ts: TranslatorService, public ts: TranslatorService,
public worklistService: WorklistService public worklistService: WorklistService
) { ) {
this.getPassMOInfo = this.cs.sharedService.getSharedData('passMOReq'); this.getPassMOInfo = this.cs.sharedService.getSharedData('passMOReq');
this.MOItemHistoryReq = new MOItemHistoryReq(); this.MOItemHistoryReq = new MOItemHistoryReq();

Loading…
Cancel
Save