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 c664d3dc..842cbd83 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,11 +17,6 @@ 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(); @@ -86,10 +81,7 @@ export class CircleCalendarComponent implements OnInit { } reRenderCalendar() { - this.renderDate(this.eventsdateAbsent, 'absent'); - this.renderDate(this.eventsdateAttend, 'present'); - this.renderDate(this.eventsdateDayOff, 'dayoff'); - this.renderDate(this.normalDays, 'scheduleDay'); + this.renderDate(this.dayHoursTypeDetailsList); } public async dateModal(shiftDetails) { @@ -106,14 +98,23 @@ export class CircleCalendarComponent implements OnInit { await modal.present(); } - public renderDate(arrayDays, cssClass) { + public renderDate(arrayDays) { const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)'); arrayDays.forEach(dateObj => { - const date = dateObj.startTime; + const date = dateObj.customScheduleDate; td.forEach(element => { // tslint:disable-next-line: triple-equals - if (date.getDate() == element.textContent.trim()) { - element.classList.add(cssClass); + if (date.getDate() == element.textContent.trim() && dateObj.customPresent === true) { + element.classList.add('present'); + // tslint:disable-next-line: triple-equals + } else if (date.getDate() == element.textContent.trim() && dateObj.customAbsent === true) { + element.classList.add('absent'); + // tslint:disable-next-line: triple-equals + } else if (date.getDate() == element.textContent.trim() && dateObj.customDaysOff === true) { + element.classList.add('dayoff'); + // tslint:disable-next-line: triple-equals + } else if (date.getDate() == element.textContent.trim() && dateObj.customSchedule === true) { + element.classList.add('scheduleDay'); } }); }); @@ -124,7 +125,7 @@ export class CircleCalendarComponent implements OnInit { console.log(event.selectedTime.getDate()); const selectedIndex = event.selectedTime.getDate(); this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1]; - if (this.selectedIndexData.present) { + if (this.selectedIndexData.customPresent) { const rtpID = this.selectedIndexData.RTP_ID; this.getScheduleShiftDetails(rtpID); } 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 10600f8b..7f648459 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 @@ -78,7 +78,7 @@ height: 360px !important; margin-bottom: -13px !important; color: black !important; font-weight: bold !important; - font-size: 15px !important; + font-size: 14px !important; margin-top: 8px; text-align: center; display: block; 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 f3099eaa..a90e4704 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,6 +1,6 @@
- +
Team Member Image @@ -9,11 +9,11 @@
- +

{{name}}

{{title}}
- +
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 47d44bb7..47fe4440 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 @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; @Component({ selector: 'app-employee-information', @@ -12,10 +12,15 @@ export class EmployeeInformationComponent implements OnInit { @Input() title: string; @Input() employeeImage: string; @Input() employeePhoneNumber: string; - + // tslint:disable-next-line: no-output-on-prefix + @Output() onGetDetails = new EventEmitter(); constructor() { } ngOnInit() {} + getDetails() { + this.onGetDetails.emit(); + } + } diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html index 3e0c7759..af154d2f 100644 --- a/Mohem/src/app/my-team/details/details.component.html +++ b/Mohem/src/app/my-team/details/details.component.html @@ -23,7 +23,7 @@
- + Call @@ -174,12 +174,8 @@
{{ts.trPK('attendance','monthly-attendance-calendar')}} @@ -223,7 +219,7 @@ [title]="subordinate.POSITION_NAME" [employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'" [employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER" - (click)="getDetails(i)"> + (onGetDetails)="getDetails(i)"> diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts index ae4acf22..a5e58229 100644 --- a/Mohem/src/app/my-team/details/details.component.ts +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -54,10 +54,6 @@ export class DetailsComponent implements OnInit { public attendedDays: number; public futrueDays = 0; public totalAttendancePrecentage = 0; - public arrDaysAttendance: any = []; - public arrDaysAbsent: any = []; - public arrDaysOff: any = []; - public normalDays: any = []; public monthTitle: string = moment().format('MMMM'); public yearTitle: string; public activeMonth: any; @@ -120,7 +116,6 @@ export class DetailsComponent implements OnInit { public segmentChanged(event: any) { this.activeSegment = event.detail.value; if (this.activeSegment === 'Attendance') { - this.normalDays = []; this.initAttendance(); } } @@ -137,9 +132,6 @@ export class DetailsComponent implements OnInit { } calendarConfig(month?, year?) { - this.arrDaysOff = []; - this.arrDaysAttendance = []; - this.arrDaysAbsent = []; this.month = month; this.year = year; this.getTimeCardSummaryDetails(month, year); @@ -169,14 +161,12 @@ export class DetailsComponent implements OnInit { console.log(result.GetDayHoursTypeDetailsList); this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); this.countAllAttendDays(result.GetDayHoursTypeDetailsList); - this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList; } }); } nextSlide() { - this.normalDays = []; if (this.currentMonthName !== this.month) { this.showData = false; if (this.nextMonth > 12) { @@ -191,7 +181,6 @@ export class DetailsComponent implements OnInit { } previousSlide() { - this.normalDays = []; this.showData = false; if (this.preMonth === 0) { this.currentYear = this.currentYear - 1; @@ -219,48 +208,35 @@ export class DetailsComponent implements OnInit { for (let i = 0; i < allDays.length; i++) { // tslint:disable-next-line: triple-equals if (allDays[i].ATTENDED_FLAG == 'Y') { - allDays[i].present = true; - allDays[i].absent = false; - allDays[i].daysOff = false; - allDays[i].schedule = false; - this.arrDaysAttendance.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); + allDays[i].customPresent = true; + allDays[i].customAbsent = false; + allDays[i].customDaysOff = false; + allDays[i].customSchedule = false; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); // tslint:disable-next-line: triple-equals } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') { - allDays[i].present = false; - allDays[i].absent = true; - allDays[i].daysOff = false; - allDays[i].schedule = false; - this.arrDaysAbsent.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE), - isoTime: '09:00:00', - allDay: false - }); + allDays[i].customPresent = false; + allDays[i].customAbsent = true; + allDays[i].customDaysOff = false; + allDays[i].customSchedule = false; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); // tslint:disable-next-line: triple-equals } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') { - allDays[i].present = false; - allDays[i].absent = false; - allDays[i].daysOff = true; - allDays[i].schedule = false; - this.arrDaysOff.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); + allDays[i].customPresent = false; + allDays[i].customAbsent = false; + allDays[i].customDaysOff = true; + allDays[i].customSchedule = false; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); } else { - allDays[i].present = false; - allDays[i].absent = false; - allDays[i].daysOff = false; - allDays[i].schedule = true; - this.normalDays.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); + allDays[i].customPresent = false; + allDays[i].customAbsent = false; + allDays[i].customDaysOff = false; + allDays[i].customSchedule = true; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); } } this.showData = true; + this.dayHoursTypeDetailsList = allDays; } public getTimeCardSummaryDetails(month?, year?) { diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html index 1a297ab0..76a56be7 100644 --- a/Mohem/src/app/my-team/home/home.component.html +++ b/Mohem/src/app/my-team/home/home.component.html @@ -69,7 +69,7 @@ [title]="subordinate.POSITION_NAME" [employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'" [employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER" - (click)="getDetails(i)"> + (onGetDetails)="getDetails(i)"> diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html index d2f9d80d..9eb7fe15 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html @@ -84,12 +84,8 @@
{{ts.trPK('attendance','monthly-attendance-calendar')}} diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts index 7b2230aa..377dfbd3 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts @@ -53,9 +53,6 @@ export class TimeCardDetailsComponent implements OnInit { public attendedDays: number; public futrueDays = 0; public totalAttendancePrecentage = 0; - public arrDaysAttendance: any = []; - public arrDaysAbsent: any = []; - public arrDaysOff: any = []; public monthTitle: string = moment().format('MMMM'); public yearTitle: string; public isChange = false; @@ -64,7 +61,6 @@ export class TimeCardDetailsComponent implements OnInit { public showData = false; public currentYear = new Date().getFullYear(); public dayHoursTypeDetailsList = []; - public normalDays: any = []; public currentDate = new Date(); public options = { cutoutPercentage: 80, @@ -81,9 +77,6 @@ export class TimeCardDetailsComponent implements OnInit { } calendarConfig(month?, year?) { - this.arrDaysOff = []; - this.arrDaysAttendance = []; - this.arrDaysAbsent = []; this.month = month; this.year = year; this.getTimeCardSummaryDetails(month, year); @@ -113,7 +106,6 @@ export class TimeCardDetailsComponent implements OnInit { console.log(result.GetDayHoursTypeDetailsList); this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); this.countAllAttendDays(result.GetDayHoursTypeDetailsList); - this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList; } }); @@ -124,48 +116,35 @@ export class TimeCardDetailsComponent implements OnInit { for (let i = 0; i < allDays.length; i++) { // tslint:disable-next-line: triple-equals if (allDays[i].ATTENDED_FLAG == 'Y') { - allDays[i].present = true; - allDays[i].absent = false; - allDays[i].daysOff = false; - allDays[i].schedule = false; - this.arrDaysAttendance.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); + allDays[i].customPresent = true; + allDays[i].customAbsent = false; + allDays[i].customDaysOff = false; + allDays[i].customSchedule = false; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); // tslint:disable-next-line: triple-equals } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') { - allDays[i].present = false; - allDays[i].absent = true; - allDays[i].daysOff = false; - allDays[i].schedule = false; - this.arrDaysAbsent.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE), - isoTime: '09:00:00', - allDay: false - }); + allDays[i].customPresent = false; + allDays[i].customAbsent = true; + allDays[i].customDaysOff = false; + allDays[i].customSchedule = false; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); // tslint:disable-next-line: triple-equals } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') { - allDays[i].present = false; - allDays[i].absent = false; - allDays[i].daysOff = true; - allDays[i].schedule = false; - this.arrDaysOff.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); + allDays[i].customPresent = false; + allDays[i].customAbsent = false; + allDays[i].customDaysOff = true; + allDays[i].customSchedule = false; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); } else { - allDays[i].present = false; - allDays[i].absent = false; - allDays[i].daysOff = false; - allDays[i].schedule = true; - this.normalDays.push({ - startTime: new Date(allDays[i].SCHEDULE_DATE), - endTime: new Date(allDays[i].SCHEDULE_DATE) - }); + allDays[i].customPresent = false; + allDays[i].customAbsent = false; + allDays[i].customDaysOff = false; + allDays[i].customSchedule = true; + allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE); } } this.showData = true; + this.dayHoursTypeDetailsList = allDays; } public getTimeCardSummaryDetails(month?, year?) { @@ -214,7 +193,6 @@ export class TimeCardDetailsComponent implements OnInit { } nextSlide() { - this.normalDays = []; if (this.currentMonthName !== this.month) { this.showData = false; if (this.nextMonth > 12) { @@ -229,7 +207,6 @@ export class TimeCardDetailsComponent implements OnInit { } previousSlide() { - this.normalDays = []; this.showData = false; if (this.preMonth === 0) { this.currentYear = this.currentYear - 1; diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 1e791c08..b2768650 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -1284,7 +1284,7 @@ border:0px } .calendar-modal { - --height: 13cm !important; + --height: 13.5cm !important; --width: 88% !important; --border-radius: 0.4cm; } @@ -1409,6 +1409,11 @@ table.monthview-datetable th small { border-radius: 20px !important; } +.disable-phone { + pointer-events: none; + opacity: .3; +} + // .replaceRoll-modal { // padding: 30% 1% !important;