From 4a0ca75f6d4f72ad770510b692ef30cbed216ad0 Mon Sep 17 00:00:00 2001 From: ashwaq Date: Sun, 1 Mar 2020 11:24:40 +0300 Subject: [PATCH 1/2] fix login --- Mohem/src/app/app.component.ts | 1 + .../src/app/authentication/login/login.component.ts | 6 +++--- .../src/app/authentication/sms-page/sms-page.page.ts | 12 +++++++++--- Mohem/src/app/home/home.page.ts | 2 ++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 7378cfea..01c88780 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -60,6 +60,7 @@ export class AppComponent implements OnInit, AfterViewInit { ngAfterViewInit() {} initializeApp() { this.start = false; + this.menu.enable(false) this.lazyLoadingService.monitorLazyLoading(15, true); this.platform.ready().then(() => { this.ts.loadResources(() => { diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 244012bc..7442330d 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -237,12 +237,12 @@ export class LoginComponent implements OnInit, OnDestroy { console.log("success"); this.cs.stopLoading(); if (this.cs.validResponse(result)) { - // alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList.EMPLOYEE_NAME); + // alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList[0].EMPLOYEE_NAME); this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER; this.loginData.P_USER_NAME = this.username; - // this.loginData.EMPLOYEE_NAME =result.MemberLoginList[0].EMPLOYEE_NAME; + // this.loginData.EMPLOYEE_NAME =result.MemberLoginList[0].EMPLOYEE_NAME; this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.remeberMyInfo(); @@ -325,7 +325,7 @@ export class LoginComponent implements OnInit, OnDestroy { console.log(result); this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.P_USER_NAME = this.username; - this.loginData.EmployeeName =result.MemberLoginList[0].EMPLOYEE_NAME; + // this.loginData.EmployeeName =result.MemberLoginList[0].EMPLOYEE_NAME; this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index eb7895b3..20a94df0 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -496,9 +496,13 @@ console.log("successful insertMobileLogin" ); const key = e.which; const t = e.target; let sib = t.nextElementSibling; + let sibPre =t.previousElementSibling; if (key !== 9 && (key < 48 || key > 57)) { if (key === 8 || key === 46) { + + + return true; } else { e.preventDefault(); @@ -509,11 +513,13 @@ console.log("successful insertMobileLogin" ); if (key === 9) { return true; } - if (sib) { //sib = document.querySelector('input'); - if (e.target.value) { + if (e.target.value ==="") { + sibPre.setFocus()} + else{ sib.setFocus(); + } } } // } else { @@ -523,6 +529,6 @@ console.log("successful insertMobileLogin" ); - } + } \ No newline at end of file diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 77e17c73..442a55fd 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -172,6 +172,8 @@ export class HomePage implements OnInit { } ngOnInit() { + this.menu.enable(true) + // this.getUserDetails(); // this.getCount(); // this.events.subscribe('getNotCount', badge => { From 8f9ef27ee153dac57ed430e65bb52d2e1e9f8c55 Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Mon, 2 Mar 2020 09:58:36 +0300 Subject: [PATCH 2/2] add my team to side menu & handle accural balance in absence page --- Mohem/src/app/absence/home/home.component.ts | 10 ++++++---- Mohem/src/app/app.component.html | 9 +++++++++ Mohem/src/app/app.component.ts | 14 +++++++++++++- Mohem/src/app/home/home.page.html | 7 ------- Mohem/src/app/home/home.page.ts | 12 +++++++++--- Mohem/src/assets/imgs/my_team_icon.png | Bin 0 -> 470 bytes Mohem/src/assets/localization/i18n.json | 4 ++-- 7 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 Mohem/src/assets/imgs/my_team_icon.png diff --git a/Mohem/src/app/absence/home/home.component.ts b/Mohem/src/app/absence/home/home.component.ts index 398820e9..05b25d8b 100644 --- a/Mohem/src/app/absence/home/home.component.ts +++ b/Mohem/src/app/absence/home/home.component.ts @@ -55,7 +55,9 @@ export class HomeComponent implements OnInit { public absService: AbsenceListService, public accrualService: AccrualService, public authService: AuthenticationService - ) {} + ) { + // this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false); + } ngOnInit() { @@ -66,8 +68,8 @@ export class HomeComponent implements OnInit { private getUserDetails(){ this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { if (user) { - this.emp_no=user.EMPLOYEE_NUMBER; - this.getAccrualBalance(); + // this.emp_no=user.EMPLOYEE_NUMBER; + // this.getAccrualBalance(); } }); @@ -236,7 +238,7 @@ createAbsence() { let todayDate = month + '/' + day + '/' + year; let effectiveDate = todayDate; const request = { - P_SELECTED_EMPLOYEE_NUMBER: this.emp_no, + P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_EFFECTIVE_DATE: effectiveDate }; diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index 4a975deb..42371b1a 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -114,6 +114,15 @@ --> + + + + + + + {{ts.trPK('myTeam','myTeam-header')}} + +