From 69ea2637d6580caf68d8801d368626aba75f89ac Mon Sep 17 00:00:00 2001 From: umasoodch Date: Wed, 26 Feb 2020 12:58:46 +0300 Subject: [PATCH] my-team attendance issues resolved --- .../dashbored/AttensanceTrackingList.ts | 5 + .../circle-calendar.component.html | 10 +- .../circle-calendar.component.ts | 380 ++---------------- .../date-info-modal.component.html | 272 +++++-------- .../date-info-modal.component.scss | 16 +- .../date-info-modal.component.ts | 248 ++++-------- .../employee-information.component.html | 8 +- .../employee-information.component.scss | 40 +- .../employee-information.component.ts | 2 - .../my-team/details/details.component.html | 229 +++++------ .../my-team/details/details.component.scss | 160 +++++--- .../app/my-team/details/details.component.ts | 228 +++++------ .../src/app/my-team/home/home.component.html | 14 +- Mohem/src/app/my-team/home/home.component.ts | 73 ++-- .../time-card-details.component.html | 249 +++++------- .../time-card-details.component.ts | 195 ++++----- Mohem/src/assets/localization/i18n.json | 40 +- Mohem/src/theme/styles.scss | 126 ++++-- 18 files changed, 907 insertions(+), 1388 deletions(-) diff --git a/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts b/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts index b5083234..4e238e58 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts @@ -7,4 +7,9 @@ export class AttendanceTrackingList { public P_SCHEDULED_HOURS: string; public P_SHT_NAME: string; public P_SPENT_HOURS: string; + public P_BREAK_HOURS: string; + public P_LATE_IN_HOURS: string; + public P_SWIPES_EXEMPTED_FLAG: string; + public P_SWIPE_IN: string; + public P_SWIPE_OUT: string; } diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html index 07960e77..48c55d3e 100644 --- a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html @@ -1,10 +1,10 @@ + [monthviewEventDetailTemplate]="template" + [calendarMode]="calendar.mode" + [currentDate]="currentDateParent" + [lockSwipes]="true" + (onTimeSelected)="onDayClicked($event)"> diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts index d3580c46..c664d3dc 100644 --- a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts @@ -17,15 +17,16 @@ import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-re styleUrls: ['./circle-calendar.component.scss'] }) export class CircleCalendarComponent implements OnInit { + @Input() eventsdateDayOff: any = []; @Input() eventsdateAttend: any = []; @Input() eventsdateAbsent: any = []; + @Input() normalDays: any = []; + @Input() dayHoursTypeDetailsList: any = []; + @Input() currentDateParent: string; @Output() monthTitle = new EventEmitter(); @Output() currentYear = new EventEmitter(); - - - /////////////////////////////////TIME AND DATE VALUES/////////////////////////////// public monthName: any; public yearDate: any; public selEmp: string; @@ -42,28 +43,11 @@ export class CircleCalendarComponent implements OnInit { public shiftDetailsData: any = []; public swipeDetailsData: any = []; public arrOfAllList: any = []; - ///////////////////////////////END////////////////////////////////////////////////// - - eventsdata: any = []; - calendarModes = [ - { key: 'month', value: 'Month' }, - { key: 'week', value: 'Week' }, - { key: 'day', value: 'Day' }, - ]; - public calendar = { - mode: this.calendarModes[0].key, - currentDate: new Date(), - currentAvailableAppoDate: new Date(), - dateFormatter: { - formatMonthViewDayHeader: (date: Date) => { - return this.getHeaderDay(date); - } - - } - } + mode: 'month' + }; public currentAvailableAppoDate: any; public eventsInput: any = []; @@ -77,7 +61,8 @@ export class CircleCalendarComponent implements OnInit { public selectedDateObject: any; public currentDateToSwipe: any; public activeMonth: any; - isFirst: boolean; + public isFirst = false; + public selectedIndexData: any; arrFutrueDays: any; eventsdateFutrue: any; detailData: any; @@ -86,191 +71,43 @@ export class CircleCalendarComponent implements OnInit { public mod: ModalController, public common: CommonService, public timeCardService: TimeCardService) { } - @ViewChild("slider") slides: ElementRef; + @ViewChild('slider') slides: ElementRef; ngOnInit() { - this.isFirst = false; this.reRenderCalendar(); - console.log("1") + console.log(this.currentDateParent); } - + // tslint:disable-next-line: use-life-cycle-interface ngAfterViewInit() { setTimeout(() => { this.reRenderCalendar(); }, 1000); - console.log("2") - } - - // ngOnChanges(){ - // console.log("3") - // } - - getHeaderDay(date: any) { - return this.weekDaysEnSort[date.getDay()]; - } reRenderCalendar() { this.renderDate(this.eventsdateAbsent, 'absent'); this.renderDate(this.eventsdateAttend, 'present'); this.renderDate(this.eventsdateDayOff, 'dayoff'); + this.renderDate(this.normalDays, 'scheduleDay'); } - - dayClicked(data: any): void { - - if (data.isPast) { - this.eventsInput = []; - this.selectedTime = null; - } else { - // At least one slot - if (data.events.length > 0) { - this.selectedDate = this.getDateISO(data.selectedTime); - //TODO replace later later - for (let i = 0; i < data.events.length; i++) { - - } - this.presentTimeSlots(data.events, data.selectedTime); - this.currentDate = this.getHeaderDate(data.selectedTime); - } else { - this.eventsInput = []; - this.selectedTime = null; - } - //} - } - } - - - async presentTimeSlots(events: TimeSlot[], date: Date) { - this.eventsInput = []; - let index = 1; - for (let event of events) { - // event.end = this.cs.getKSATimeZone(event.end); - this.eventsInput.push({ - name: 'radio' + index, - type: 'radio', - label: event.isoTime.substring(0, event.isoTime.length - 3), - value: event, - checked: index === 1 - }); - if (index == 1) { - this.selectedTime = event.isoTime; - this.selectedDateObject = new Date(event.end); - - } - ++index; - } - } - - - public getDateISO(date: Date): string { - return ( - date.getFullYear().toString() + - "-" + - this.trailerZero(date.getMonth() + 1) + - "-" + - this.trailerZero(date.getDate()) - ); - } - - onCurrentDateChanged(event) { - console.log("onCurrentDateChanged"); - if (this.isFirst) { - const today = new Date(); - this.currentDateToSwipe = event; - if (this.calendar.mode === 'month') { - if ((event.getFullYear() === today.getFullYear() && event.getMonth() <= today.getMonth())) { - this.lockSwipeToPrev = true; - } else { - this.lockSwipeToPrev = false; - } - } - this.activeMonth = this.getHeaderMonth(event); - this.currentDate = this.getHeaderDate(event); - this.sharedData.setSharedData(this.activeMonth, "currentMonth"); - let dateData = this.currentDate.toString() - dateData = dateData.split(" ") - this.getDayHoursTypeDetails(dateData[2], dateData[3]); - this.reRenderCalendar(); - } else { - const today = new Date(); - this.currentDateToSwipe = event; - if (this.calendar.mode === 'month') { - if ((event.getFullYear() === today.getFullYear() && event.getMonth() <= today.getMonth())) { - this.lockSwipeToPrev = true; - } else { - this.lockSwipeToPrev = false; - } - } - this.activeMonth = this.getHeaderMonth(event); - this.currentDate = this.getHeaderDate(event); - this.sharedData.setSharedData(this.activeMonth, "currentMonth"); - this.isFirst = true; - } - } - - getHeaderDate(date: any) { - - return this.weekDaysEn[date.getDay()] + ", " + date.getDate() + " " + this.getMonthName(date.getMonth() + 1) + " " + date.getFullYear(); - - } - - private trailerZero(value: number): string { - const str = value.toString(); - return str.length > 1 ? str : "" + str; - } - getHeaderMonth(date: any) { - - return this.getMonthName(date.getMonth() + 1) + " " + date.getFullYear(); - - } - - public getMonthName(value: number): string { - switch (value) { - case 1: - return "January"; - case 2: - return "February"; - case 3: - return "March"; - case 4: - return "April"; - case 5: - return "May"; - case 6: - return "June"; - case 7: - return "July"; - case 8: - return "August"; - case 9: - return "September"; - case 10: - return "October"; - case 11: - return "November"; - case 12: - return "December"; - } - } - - public async dateModal(todayDate, shiftDetails) { + public async dateModal(shiftDetails) { const modal = await this.mod.create({ component: DateInfoModalComponent, showBackdrop: true, backdropDismiss: true, componentProps: { - TODAYDATE: todayDate, + TODAYDATE: this.selectedIndexData, SHIFTDETAILS: shiftDetails } }); - modal.cssClass = "calendar-modal"; + modal.cssClass = 'calendar-modal'; await modal.present(); } public renderDate(arrayDays, cssClass) { - const td = document.querySelectorAll(".swiper-slide-active .monthview-datetable td:not(.text-muted)"); + const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)'); arrayDays.forEach(dateObj => { const date = dateObj.startTime; td.forEach(element => { @@ -282,194 +119,31 @@ export class CircleCalendarComponent implements OnInit { }); } - onDayClicked(x) { - // this.dateModal(this.currentDate); - let fullDate; - let arrOfFullDate; - for (let i = 0; i < this.arrOfAllList.length; i++) { - fullDate = this.arrOfAllList[i].SCHEDULE_DATE.split(" ") - if (this.common.convertISODateToJsonDate(fullDate[0]) == this.common.convertISODateToJsonDate(this.getDateISO(x.selectedTime))) { - arrOfFullDate = fullDate[0].split("/") - this.showDetails(this.arrOfAllList, fullDate[0]); - // console.log(arrOfFullDate[2]) - // this.getDayHoursTypeDetails(this.getMonthName(parseInt(arrOfFullDate[0])),parseInt(arrOfFullDate[2]),true, fullDate[0]) - } else { - console.log("NOT match"); + onDayClicked(event) { + if (this.isFirst) { + console.log(event.selectedTime.getDate()); + const selectedIndex = event.selectedTime.getDate(); + this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1]; + if (this.selectedIndexData.present) { + const rtpID = this.selectedIndexData.RTP_ID; + this.getScheduleShiftDetails(rtpID); } + } else { + this.isFirst = true; } } - - - - - - getScheduleShiftDetails(RTP_ID) { const GetShiftDetailRequestObject = new GetShiftDetailRequest(); GetShiftDetailRequestObject.P_RTP_ID = RTP_ID; GetShiftDetailRequestObject.P_PAGE_NUM = 1; GetShiftDetailRequestObject.P_PAGE_LIMIT = 10; - console.log(GetShiftDetailRequestObject); this.timeCardService.getShiftDetail(GetShiftDetailRequestObject).subscribe((result) => { if (this.common.validResponse(result)) { console.log(result); this.shiftDetailsData = result.GetScheduleShiftsDetailsList; - this.dateModal(this.detailData,result); - } - }); - } - - - getSwipesDetails() { - const GetSwipesRequestObject = new GetSwipesRequest(); - GetSwipesRequestObject.P_SELECTED_EMPLOYEE_NUMBER = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); - GetSwipesRequestObject.P_SCHEDULE_DATE = this.common.convertISODateToJsonDate(this.selectedShift.SCHEDULE_DATE); - GetSwipesRequestObject.P_PAGE_NUM = 1; - GetSwipesRequestObject.P_PAGE_LIMIT = 10; - this.timeCardService.getSwipes(GetSwipesRequestObject).subscribe((result) => { - if (this.common.validResponse(result)) { - console.log(result); - this.swipeDetailsData = result.GetSwipesList; - } - }); - } - - - - - - - - - - - - - - - - - - - /////////////////////////this function should be in common service///////////////////////// - public getDayHoursTypeDetails(month, year) { - - this.monthTitle.emit(month); - this.currentYear.emit(year); - const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest(); - this.monthName = month//moment().format('MMMM'); - this.yearDate = year//moment().format('YYYY'); - this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); - this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); - this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); - this.menuType = this.selMenu.List_Menu.MENU_TYPE; - - dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; - dayAndHoursReqObj.P_MENU_TYPE = this.menuType; - dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID; - dayAndHoursReqObj.SearchMonth = this.monthName; - dayAndHoursReqObj.SearchYear = this.yearDate; - dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber; - dayAndHoursReqObj.P_PAGE_LIMIT = 100; - - if (Object.keys(this.selectedFilters).length !== 0) { - dayAndHoursReqObj.P_SHT_TYPE = this.selectedShiftFilter; - dayAndHoursReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value; - dayAndHoursReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value; - dayAndHoursReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value; - dayAndHoursReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value; - dayAndHoursReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value; - dayAndHoursReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value; - dayAndHoursReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value; - dayAndHoursReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value; - dayAndHoursReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value; - dayAndHoursReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value; - dayAndHoursReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value; - } - - this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => { - if (this.common.validResponse(result)) { - this.arrOfAllList = result.GetDayHoursTypeDetailsList; - this.countAllAttendDays(result.GetDayHoursTypeDetailsList); - this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'calendarDateValue'); - // this.common.openTimeCardPage(); + this.dateModal(result); } }); - } - - - showDetails(allData, date){ - let fullDate; - for (let i = 0; i < allData.length; i++) { - fullDate = allData[i].SCHEDULE_DATE.split(" ") - if(fullDate[0] == date){ - this.detailData = allData[i] - console.log("date details:") - console.log(this.detailData); - this.getScheduleShiftDetails(this.detailData.RTP_ID); - } - } - } - - - - - countAllAttendDays(allDays) { - this.eventsdateDayOff = []; - this.eventsdateAttend = []; - this.eventsdateAbsent = []; - this.arrDaysOff = []; - this.arrDaysAttendance = []; - this.arrDaysAbsent = []; - this.eventsdateFutrue = []; - this.arrFutrueDays = []; - - for (let i = 0; i < allDays.length; i++) { - if (allDays[i].DAY_TYPE == "OFF") { - //offDay - this.arrDaysOff.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); - } else if (allDays[i].DAY_TYPE == "SCHEDULED" && !allDays[i].REMARKS) { - //attendace - this.arrDaysAttendance.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); - } else if (allDays[i].DAY_TYPE == "SCHEDULED" && allDays[i].REMARKS) { - //absent - this.arrDaysAbsent.push( - { - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE), - isoTime: "09:00:00", - allDay: false - } - ); - } else { - this.arrFutrueDays.push( - { - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE), - isoTime: "09:00:00", - allDay: false - } - ); - } - } - // this.common.sharedService.setSharedData(this.arrDaysOff,'calendarDayOffDateValue'); - // this.common.sharedService.setSharedData(this.arrDaysAttendance,'calendarAttendanceDateValue'); - // this.common.sharedService.setSharedData( this.arrDaysAbsent,'calendarDaysAbsentDateValue'); - this.eventsdateDayOff = this.arrDaysOff; - this.eventsdateAttend = this.arrDaysAttendance; - this.eventsdateAbsent = this.arrDaysAbsent; - this.eventsdateFutrue = this.arrFutrueDays; - this.reRenderCalendar(); - } - - - } diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.html b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.html index ca3d45aa..5c57f654 100644 --- a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.html +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.html @@ -1,180 +1,104 @@ - - - -
-
-
- - + + + + + +
+
+
+

{{percentage}}

+ Completed



+
+ +
- -
- -

{{percentage}}

- Completed



+ + +
+ +

{{nameDay}}

+
+ +

{{day}}

+
+ +

{{nameMonth}}

+
+ +

{{year}}

+
+ +

{{ts.trPK('attendance','present')}}

+
+
+ + - +
+ + + +

{{shiftTime}}

+ +

{{ts.trPK('attendance-tracking','shift-time')}}

+
+
+ +

{{scheduled}}

+ +

{{ts.trPK('attendance-tracking','regular')}}

+
+
+
+ + +

{{startDate}}

+ +

{{ts.trPK('attendance-tracking','check-in')}}

+
+
+ +

{{endDate}}

+ +

{{ts.trPK('attendance-tracking','check-out')}}

+
+
+
+ + +

{{lateIn}}

+ +

{{ts.trPK('attendance-tracking','late-in')}}

+
+
+ +

{{excess}}

+ +

{{ts.trPK('attendance-tracking','excess')}}

+
+
+
+ + +

{{shortage}}

+ +

{{ts.trPK('attendance-tracking','shortage')}}

+
+
+ +

{{earlyOut}}

+ +

{{ts.trPK('attendance-tracking','early-out')}}

+
+
+
-
-
-
- -
- - - -

{{nameDay}}

-
- -

{{day}}

-
- -

{{nameMonth}}

-
- -

{{year}}

-
- -

{{ts.trPK('attendance','present')}}

-
- - + +
+ - -
- - - - -
- - - -

{{shiftTime}}

- -

{{ts.trPK('attendance-tracking','shift-time')}}

-
-
- -

{{scheduled}}

- -

{{ts.trPK('attendance-tracking','regular')}}

-
-
-
- - - -

{{startDate}}

- -

{{ts.trPK('attendance-tracking','check-in')}}

-
-
- -

{{endDate}}

- -

{{ts.trPK('attendance-tracking','check-out')}}

-
-
-
- - - -

{{lateIn}}

- -

{{ts.trPK('attendance-tracking','late-in')}}

-
-
- -

{{excess}}

- -

{{ts.trPK('attendance-tracking','excess')}}

-
-
-
- - - -

{{shortage}}

- -

{{ts.trPK('attendance-tracking','shortage')}}

-
-
- -

{{earlyOut}}

- -

{{ts.trPK('attendance-tracking','early-out')}}

-
-
-
- - - - - - - - - -
- -
+ diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss index 19132960..53ea08a2 100644 --- a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss @@ -108,23 +108,25 @@ height: 360px !important; } - .p0{ margin-bottom: -15px !important; + .p0{ + margin-bottom: -13px !important; color: black !important; - margin-left: 24px; font-weight: bold !important; - font-size: 17px !important; + font-size: 15px !important; margin-top: 8px; - + text-align: center; + display: block; + width: 100%; } .p1{ margin-bottom: -7px !important; color: black !important; - /* margin-right: 25px !important; */ font-family: WorkSans-Bold !important; - margin-left: 36px; - /* margin-bottom: -82px; */ font-size: 33px; margin-top: 10px; + text-align: center; + display: block; + width: 100%; } .p2{ font-weight: bold !important; font-size: 17px !important; diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.ts index 11ccb02a..6bee539f 100644 --- a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.ts +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, Input, ViewChild } from '@angular/core'; import { ModalController, NavParams, IonInfiniteScroll } from '@ionic/angular'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; -// import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; +import { IonSlides } from '@ionic/angular'; @Component({ selector: 'app-date-info-modal', @@ -9,230 +9,130 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl styleUrls: ['./date-info-modal.component.scss'], }) export class DateInfoModalComponent implements OnInit { + @ViewChild('slides') slides: IonSlides; [x: string]: any; - gaugeType = "full"; + gaugeType = 'full'; gaugeValue = 28.3; - gaugeLabel = "Days"; + gaugeLabel = 'Days'; @Input() TODAYDATE: any; - @Input() SHIFTDETAILS:any; + @Input() SHIFTDETAILS: any; today: any; - todayDate: any; month: any; monthDate: any; excess: any; - shortage:any; - lateIn:any; - scheduled:any; - earlyOut:any; - shiftTime:any; - startDate:any; - endDate:any; - shift:any; - percentage:any; - data:any; - scheduleDate:any; - tests:any; + shortage: any; + lateIn: any; + scheduled: any; + earlyOut: any; + shiftTime: any; + startDate: any; + endDate: any; + shift: any; + percentage: any; + data: any; + scheduleDate: any; + tests: any; year: any; - nameMonth:any; + nameMonth: any; nameDay: any; - @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; - // public weekDaysEnSort = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; public weekDaysEn = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; public options = { cutoutPercentage: 85, - tooltips: { enabled: false }, - legend: { display: false } + }; + public slideOptsOne = { + slidesPerView: 1, + spaceBetween: 0 }; - - constructor(public modalController: ModalController, public navParams: NavParams, public ts:TranslatorService, - + + constructor( + public modalController: ModalController, + public navParams: NavParams, + public ts: TranslatorService ) { } ngOnInit() { - // this.shift =this.common.sharedService.getSharedData('shiftDetailsData'); - console.log(this.TODAYDATE.SCHEDULE_DATE.split(" ")[0].split(" ")) -//22/2/2019 - console.log(this.TODAYDATE.EXCESS_HRS) - - this.excess = this.TODAYDATE.EXCESS_HRS - console.log(this.TODAYDATE.LATE_IN_HRS) - this.lateIn = this.TODAYDATE.LATE_IN_HRS - console.log(this.TODAYDATE.SHORTAGE_HRS) - this.shortage = this.TODAYDATE.SHORTAGE_HRS - console.log(this.TODAYDATE.SCHEDULED_HRS) - this.scheduled = this.TODAYDATE.SCHEDULED_HRS - console.log(this.TODAYDATE.EARLY_OUT_HRS ) - this.earlyOut = this.TODAYDATE.EARLY_OUT_HRS - this.scheduleDate = this.TODAYDATE. SCHEDULE_DATE - - console.log(this.TODAYDATE. SCHEDULE_DATE) - - - // console.log(this.SHIFTDETAILS) - // console.log(this.SHIFTDETAILS.SHT_NAME) - this.shiftTime= this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_NAME - this.startDate= this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_ACTUAL_START_TIME - this.endDate= this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_ACTUAL_END_TIME - this.percentage=this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].PERCENTAGE - - this.percChart= this.percentage.substring(0,this.percentage.indexOf("%")); - let test = this.scheduleDate; - let splitdate =test.split(" "); - let date =splitdate[0]; - let test1 =date.split("/"); - console.log("" + test1); - this. month =test1[1]; - console.log("" + this.month); - this. year =test1[2]; - console.log("" + this.year); - this.day =test1[0]; - console.log("date: "+ date); - console.log("this.percChart: " +this.percChart); - - this.nameMonth=this.getMonthName(parseInt(this.month)) - console.log("" + this.nameMonth) - console.log("" + this.month) - - this.nameDay=this.getHeaderDay(new Date(date)) - console.log("" + this.nameDay) - - - // let testnamdeday=this.weekDaysEnSort[new Date(date).getDay()]; - - // console.log("testnamdeday" + testnamdeday) - - - let d = new Date(date); - let dayName = d.toString().split(' ')[0]; + console.log(this.TODAYDATE); + this.excess = this.TODAYDATE.EXCESS_HRS; + this.lateIn = this.TODAYDATE.LATE_IN_HRS; + this.shortage = this.TODAYDATE.SHORTAGE_HRS; + this.scheduled = this.TODAYDATE.SCHEDULED_HRS; + this.earlyOut = this.TODAYDATE.EARLY_OUT_HRS ; + this.scheduleDate = this.TODAYDATE.SCHEDULE_DATE; + this.assignData(this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0]); + } - this.data = { + assignData(shiftDetails) { + this.shiftTime = shiftDetails.SHT_NAME; + this.startDate = shiftDetails.SHT_ACTUAL_START_TIME; + this.endDate = shiftDetails.SHT_ACTUAL_END_TIME; + this.percentage = shiftDetails.PERCENTAGE; + this.percChart = this.percentage.substring(0, this.percentage.indexOf('%')); + const test = this.scheduleDate; + const splitdate = test.split(' '); + const date = splitdate[0]; + const test1 = date.split('/'); + this.day = test1[1]; + this.year = test1[2]; + this.month = test1[0]; + + // tslint:disable-next-line: radix + this.nameMonth = this.getMonthName(parseInt(this.month)); + this.nameDay = this.getHeaderDay(new Date(date)); + const d = new Date(date); + this.data = { labels: ['percentage'], datasets: [ - { - data: [this.percChart], - // data: [96], backgroundColor: [ - '#22C6B3', - - // '#22C6B3' + '#22C6B3' ], - borderWidth: 2 - }] - }; - - - - // this.startDate= this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_ACTUAL_START_DATETIME; - - // console.log(this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_ACTUAL_START_TIME) - - - // console.log(this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_ACTUAL_END_DATETIME ); - // this.endDate= this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_ACTUAL_END_DATETIME ; - - // console.log(this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0].SHT_ACTUAL_END_TIME ) - - // SHT_ACTUAL_START_DATETIME - // SHT_ACTUAL_START_TIME - // SHT_ACTUAL_END_DATETIME - // SHT_ACTUAL_END_TIME - - - //let dateData = this.TODAYDATE.split(' '); - // console.log(dateData) - // this.today = dateData[0]; - // this.todayDate = dateData[1]; - // this.monthDate = dateData[2]; - // this.month = dateData[3]; - // console.log(this.todayDate); - // console.log(this.today); - // console.log(this.monthDate); - // console.log(this.month); - } +slideChanged(ev) { + this.slides.getActiveIndex().then(index => { + const shiftDetails = this.SHIFTDETAILS[index]; + this.assignData(shiftDetails); + }); +} public getMonthName(value: number): string { switch (value) { case 1: - return "Jan"; + return 'Jan'; case 2: - return "Feb"; + return 'Feb'; case 3: - return "Mar"; + return 'Mar'; case 4: - return "Apr"; + return 'Apr'; case 5: - return "May"; + return 'May'; case 6: - return "Jun"; + return 'Jun'; case 7: - return "Jul"; + return 'Jul'; case 8: - return "Aug"; + return 'Aug'; case 9: - return "Sep"; + return 'Sep'; case 10: - return "Oct"; + return 'Oct'; case 11: - return "Nov"; + return 'Nov'; case 12: - return "Dec"; + return 'Dec'; } } getHeaderDay(date: any) { - // return this.weekDaysEnSort[date.getDay()]; return this.weekDaysEn[date.getDay()]; - } - - // hide(){ - // this.hideMe = true; - // } - // @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; - // public options = { - // cutoutPercentage: 80, - - // tooltips: { enabled: false }, - - // legend: { display: false } - - // }; - - // - //return this.weekDaysEn[date.getDay()] + ", " + date.getDate() + " " + this.getMonthName(date.getMonth() + 1) + " " + date.getFullYear(); - // create muthod recive date - // them get day date.getDay() - // them get month name this.getMonthName(date.getMonth() + 1) - // date.getFullYear() - //implemeition this.getMonthName() - -//SCHEDULE_DATE: "2/1/2020 12:00:00 AM" -//GetDayHoursTypeDetailsList - - -// // date = {scheduleDate}; -// let a = date.split(" "); -// let date = a[0]; -//test=date.split("/") -// test[0] -// test[1] -// test[3] - - -// let date2 = date.split("/"); -// String part1 = parts[0]; -// String part2 = parts[1]; -// String part3 = parts[2]; - } diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html index 7c7fc27d..f6b03e26 100644 --- a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html @@ -1,13 +1,13 @@
-
+
Team Member Image
- +

{{name}}

@@ -17,10 +17,10 @@
-
+
\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss index 36e5a37d..4c5915c1 100644 --- a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss @@ -7,25 +7,25 @@ .user-image-container{ position: relative; - width: 80px; - height: 80px; + width: 70px; + height: 70px; display: block; margin: 0 auto; - &:before{ - position: absolute; - content: ""; - width: 20px; - height: 20px; - border-radius: 20px; - border: 1px solid white; - top: 0; - right: 0; - background-color: red; - z-index: 9; - } - &.present:before{ - background-color: green !important; - } +// &:before{ +// position: absolute; +// content: ""; +// width: 20px; +// height: 20px; +// border-radius: 20px; +// border: 1px solid white; +// top: 0; +// right: 0; +// background-color: red; +// z-index: 9; +// } +// &.present:before{ +// background-color: green !important; +// } } .user-image{ overflow: hidden; @@ -46,7 +46,7 @@ display: inline-block; width: 80%; .name{ - font-size: 18px; + font-size: 16px; color: black; margin: 0; width: 100%; @@ -55,7 +55,7 @@ overflow: hidden; } .title{ - font-size: 15px; + font-size: 13px; color: #888; width: 100%; text-overflow: ellipsis; @@ -69,7 +69,7 @@ display: inline-block; text-align: center; vertical-align: top; - margin-top: 10px; + margin-top: 5px; } .swipe-information{ color: #888; diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts index 50e167d3..da0f9ffb 100644 --- a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts @@ -11,8 +11,6 @@ export class EmployeeInformationComponent implements OnInit { @Input() name: string; @Input() title: string; @Input() employeeImage: string; - @Input() checkIn: string; - @Input() checkOut: string; constructor() { } diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html index f439d8df..c6d09459 100644 --- a/Mohem/src/app/my-team/details/details.component.html +++ b/Mohem/src/app/my-team/details/details.component.html @@ -9,9 +9,9 @@
-
+