diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html index 9f4f7175..7440f9bd 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html @@ -1,9 +1,12 @@ -
-
+
+
+
+ +
- {{statsValue}} -

{{title}}

+ {{statsValue}} +

{{title}}

\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss index b0f2c44f..22ac4d1a 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.scss @@ -45,3 +45,10 @@ text-align: left; display: block; } + +.iconFab{ + margin-left: -37px; + margin-top: 5px; + width: 80px; + height: 65px; +} diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts index 65bc8ecc..b9161f22 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts @@ -13,6 +13,7 @@ export class StatsButtonComponent implements OnInit { @Input() icon: string; @Input() title: string; @Input() statsValue: string; + @Input() link: string; @Output() trigger = new EventEmitter(); @Input() focusicon: string; @Input() disabled = false; diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index 3681ea1f..3e4485c2 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -15,6 +15,7 @@ [statsValue]="button.statsValue" [icon]="button.icon" [show]="button.show" + [link]="button.link" (click)="openStatsButton(button.link)"> @@ -84,7 +85,7 @@ [renderOnClick]="false">
-
+ diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index 5a84eeae..a2b6cdfd 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -62,6 +62,11 @@ export class HomePage implements OnInit { public isShow = false; public showVcationRule = false; public statsButtons = [ + { + title: this.ts.trPK('attendance-tracking', 'title'), + link: '0', + show: true + }, { title: this.ts.trPK('home','worklist'), statsValue: 0, @@ -69,12 +74,6 @@ export class HomePage implements OnInit { link: '1', show: true }, - // { - // title: 'Pending Request', - // statsValue: 13, - // icon: 'assets/icon/new-design/pending_request.png', - // link: '' - // }, { title: this.ts.trPK('home','missing-swipes'), statsValue: 0, @@ -281,8 +280,8 @@ export class HomePage implements OnInit { for (const servicePrivilage of AuthenticationService.servicePrivilage) { if (servicePrivilage.Previlege === false) { if(servicePrivilage.ServiceName === 'accrualBalance'){ - this.statsButtons[2].show = false; this.statsButtons[3].show = false; + this.statsButtons[4].show = false; } if(servicePrivilage.ServiceName === 'vacationRule'){ this.showVcationRule = false; @@ -293,8 +292,8 @@ export class HomePage implements OnInit { // document.getElementById(servicePrivilage.ServiceName).style.filter = // 'grayscale(1)'; }else{ - this.statsButtons[2].show = true; this.statsButtons[3].show = true; + this.statsButtons[4].show = true; this.showVcationRule = true; } } @@ -555,7 +554,7 @@ export class HomePage implements OnInit { (result: OpenMissingSwipesResponse) => { if (this.common.validResponse(result)) { const key = 'GetOpenMissingSwipesList'; - this.statsButtons[1].statsValue = Math.floor(result[key].P_OPEN_MISSING_SWIPES); + this.statsButtons[2].statsValue = Math.floor(result[key].P_OPEN_MISSING_SWIPES); } } ); @@ -623,7 +622,7 @@ openPeriodDateDashbored() { ITGCountAllNotification() { this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => { - this.statsButtons[0].statsValue = + this.statsButtons[1].statsValue = Math.floor(this.countAllNotification + result.TotalCount); this.common.stopLoading(); }); @@ -701,7 +700,7 @@ getSubordinatesAttStatus() { this.accrualBalancesList = result.GetAccrualBalancesList; for (const accrualBalance of result.GetAccrualBalancesList) { if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') { - this.statsButtons[2].statsValue = + this.statsButtons[3].statsValue = Math.floor(accrualBalance.ACCRUAL_NET_ENTITLEMENT); this.common.sharedService.setSharedData(accrualBalance, 'leaveAccrualBalance'); this.common.sharedService.setSharedData(request, 'leaveAccrualBalanceDate'); @@ -710,7 +709,7 @@ getSubordinatesAttStatus() { totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; } } - this.statsButtons[3].statsValue = Math.floor(totalTicketsLeft); + this.statsButtons[4].statsValue = Math.floor(totalTicketsLeft); } }); } @@ -721,7 +720,10 @@ openattentracking() { openStatsButton(link: any) { // tslint:disable-next-line: triple-equals - if (link == '1') { + if (link == '0') { + this.getDeviceLocation(); + // tslint:disable-next-line: triple-equals + } else if (link == '1') { this.common.startLoading(); this.common.openNotificationPage(); // tslint:disable-next-line: triple-equals diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 7d008191..14855c6a 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -959,7 +959,7 @@ }, "time-left": { "en": "Time Left Today", - "ar": "باقي الوقت لليوم" + "ar": "الوقت المتبقي" } }, "work-list": { @@ -2486,7 +2486,7 @@ "attendance-tracking": { "title": { "en": "Mark Attendance", - "ar": "علامة الحضور " + "ar": "تسجيل الحضور والانصراف" }, "check-in": { "en": "Check In",