diff --git a/Mohem/src/app/eit/home/home.component.ts b/Mohem/src/app/eit/home/home.component.ts index 686b5c0d..75909a97 100644 --- a/Mohem/src/app/eit/home/home.component.ts +++ b/Mohem/src/app/eit/home/home.component.ts @@ -20,7 +20,7 @@ export class HomeComponent implements OnInit { constructor(private cs: CommonService, private ts: TranslatorService) { this.menu = this.cs.sharedService.getSharedData('menuEntries', false); this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); - let title: string = this.ts.trPK('eit', 'my-requests'); + const title: string = this.ts.trPK('eit', 'my-requests'); this.headerTitle = this.selMenu.List_Menu.MENU_NAME ? this.selMenu.List_Menu.MENU_NAME : title; } @@ -29,12 +29,12 @@ export class HomeComponent implements OnInit { openPage(page, index) { // Reset the content nav to have just this page // we wouldn't want the back button to show in this scenario - if (page.children.length == 0) { + if (page.children.length === 0) { this.goToRequest(page); } else { - if (this.selectedMenu == 0) { + if (this.selectedMenu === 0) { this.selectedMenu = -1; - } else if (this.selectedMenu != -1) { + } else if (this.selectedMenu !== -1) { this.selectedMenu = -1; } else { this.selectedMenu = index; @@ -47,12 +47,12 @@ export class HomeComponent implements OnInit { selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); selMenu.GetMenuEntriesList = menuEntry; this.cs.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); - if (menuEntry.REQUEST_TYPE == 'ABSENCE') { + if (menuEntry.REQUEST_TYPE === 'ABSENCE') { this.cs.openAbsencePage(); - } else if (menuEntry.REQUEST_TYPE == 'EIT') { + } else if (menuEntry.REQUEST_TYPE === 'EIT') { this.cs.openEitListPage(); } - if (menuEntry.REQUEST_TYPE =='PAYSLIP'){ + if (menuEntry.REQUEST_TYPE === 'PAYSLIP'){ this.cs.openPayslipPage(); } } diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index 15daa898..603de802 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -41,6 +41,7 @@ diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index ef257466..cf6a55cf 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -59,18 +59,18 @@ export class HomePage implements OnInit { statsValue: '79', icon: 'assets/icon/new-design/work_list.png' }, - { - title: 'Pending Request', - statsValue: '13', - icon: 'assets/icon/new-design/pending_request.png' - }, + // { + // title: 'Pending Request', + // statsValue: '13', + // icon: 'assets/icon/new-design/pending_request.png' + // }, { title: 'Missing Swipes', statsValue: '99', icon: 'assets/icon/new-design/missing_swipe.png' }, { - title: 'Leave Balance', + title: 'Leave Balance', // getAccrualBalance ticket balance statsValue: '02', icon: 'assets/icon/new-design/leave_balance.png' }, @@ -464,7 +464,7 @@ export class HomePage implements OnInit { }); } - showAttendanceTracking() { + showAttendanceTracking() { // spent hours left hours this.DS.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => { }); } @@ -477,7 +477,7 @@ export class HomePage implements OnInit { }); } - openNotificationsDashbored() { + openNotificationsDashbored() { // work list this.DS.getOpenNotifications( () => {console.log('Error '); } ).subscribe((result: GetOpenNotificationsResponse) => { if (this.common.validResponse(result)) { console.log('response'); @@ -510,6 +510,21 @@ export class HomePage implements OnInit { } }); } + + openPage(subMenu) { + let selMenu: MenuResponse = new MenuResponse(); + selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + selMenu.GetMenuEntriesList = subMenu; + this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); + if (subMenu.REQUEST_TYPE === 'ABSENCE') { + this.common.openAbsencePage(); + } else if (subMenu.REQUEST_TYPE === 'EIT') { + this.common.openEitListPage(); + } + if (subMenu.REQUEST_TYPE === 'PAYSLIP'){ + this.common.openPayslipPage(); + } + } }