Merge branch 'MOHEMM-Q2-DEV' into enad-Q1

MOHEMM-Q3-DEV-LATEST
enadhilal 5 years ago
commit 5f9260d111

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Platform, Events, MenuController, ModalController } from '@ionic/angular';
import { Platform, Events, MenuController, ModalController, NavController } from '@ionic/angular';
import { TranslatorService } from './hmg-common/services/translator/translator.service';
import { CommonService } from './hmg-common/services/common/common.service';
import { AuthenticationService } from './hmg-common/services/authentication/authentication.service';
@ -53,7 +53,8 @@ export class AppComponent implements OnInit {
public pushService: PushService,
private splashScreen: SplashScreen,
public router: Router,
public modalController: ModalController
public modalController: ModalController,
public nav: NavController,
) {
this.events.subscribe('img-change', displayImg => {
console.log('app compont: ' + displayImg);
@ -116,6 +117,9 @@ export class AppComponent implements OnInit {
this.platform.backButton.subscribe(() => {
if (this.router.isActive('/authentication/login', true)) {
navigator['app'].exitApp();
} else if (this.router.isActive('/home', true)) {
this.nav.navigateRoot('/home');
}
});
this.events.subscribe('setMenu', () => {

@ -1,6 +1,7 @@
<div class="full-ads" style="background-image: url(https://i.pinimg.com/564x/a8/b4/42/a8b442181f7c004f98d4eef842a76e76.jpg);">
<div class="skip-btn" (click)="skip()">Skip</div>
<div class="skip-btn" (click)="skip()" *ngIf="isSkip ==true">{{ts.trPK('worklistMain','skip')}}</div>
<div class="seconds" *ngIf="isSkip ==false">{{setTime}}</div>
<div class="info-container">
<ion-icon name="thumbs-down" class="red"></ion-icon>

@ -8,7 +8,8 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
isSkip: boolean = false;
setTime: number = 5;
constructor(public nav: NavController,) { }
ngOnInit() { }
@ -16,4 +17,14 @@ export class HomeComponent implements OnInit {
this.nav.pop();
CommonService.SKIP = true;
}
setTimer() {
setTimeout(() => {
this.setTime--;
if (this.setTime == 0) {
this.isSkip = true;
} else {
this.setTimer();
}
}, 1000);
}
}

@ -1,16 +1,17 @@
<ion-content padding class="survey-content">
<div class="skip-btn" (click)="skip()">Skip</div>
<div class="skip-btn" (click)="skip()" *ngIf="isSkip ==true">{{ts.trPK('worklistMain','skip')}} </div>
<div class="seconds" *ngIf="isSkip ==false">{{setTime}}</div>
<ion-grid class="ion-no-padding grid-parent">
<ion-row>
<ion-text class="title-text">
This is to get feedback about the user experience
{{ts.trPK('erm-channel','fedback-about-ux')}}
</ion-text>
</ion-row>
<ion-row>
<ion-col [size]="12">
<p class="subheading">1. How would you like to rate </p>
<p class="subheading">1. {{ts.trPK('erm-channel','how-would-you-like')}} </p>
</ion-col>
</ion-row>
<ion-row>
@ -22,7 +23,7 @@
<ion-grid>
<ion-row>
<ion-col>
<p class="subheading">2. How do you satisfied about this application </p>
<p class="subheading">2. {{ts.trPK('erm-channel','how-would-you-satisfied')}} </p>
</ion-col>
</ion-row>
<ion-row class="faces-row">
@ -47,7 +48,7 @@
</ion-grid>
<ion-row>
<ion-col>
<p class="comments">Please give us a comments</p>
<p class="comments"> {{ts.trPK('erm-channel','give-comments')}} </p>
</ion-col>
</ion-row>
<ion-card class="doctor-card">
@ -56,7 +57,7 @@
<ion-col [size]="12">
<ion-textarea rows="6" cols="20" [(ngModel)]="Note" placeholder="Enter any notes here..."></ion-textarea>
<ion-textarea rows="6" cols="20" [(ngModel)]="Note" [placeholder]="ts.trPK('replacementRoll','enterNote')"></ion-textarea>
</ion-col>
</ion-row>
</ion-card>

@ -10,11 +10,25 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class SurveyComponent implements OnInit {
rate: any;
isSkip: boolean = false;
setTime: number = 5;
constructor(public ts: TranslatorService, public cs: CommonService, public nav: NavController) { }
ngOnInit() { }
ngOnInit() {
this.setTimer();
}
skip() {
this.nav.pop();
CommonService.SKIP = true;
}
setTimer() {
setTimeout(() => {
this.setTime--;
if (this.setTime == 0) {
this.isSkip = true;
} else {
this.setTimer();
}
}, 1000);
}
}

@ -13,6 +13,7 @@ import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/g
import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response';
import { WorklistService } from 'src/app/notification/service/worklist.service';
@Component({
selector: 'app-details',
templateUrl: './details.component.html',
@ -57,7 +58,7 @@ export class DetailsComponent implements OnInit {
public yearTitle: string;
public activeMonth: any;
public currentMonthName = '';
favoriteUserList: [] = [];
public showAttendence = false;
public showData = false;
public currentYear = new Date().getFullYear();
@ -218,6 +219,7 @@ export class DetailsComponent implements OnInit {
public modalController: ModalController,
public authService: AuthenticationService,
public dashboardService: DashboredService,
public worklistService: WorklistService,
) {
this.direction = TranslatorService.getCurrentLanguageName();
}
@ -264,7 +266,10 @@ export class DetailsComponent implements OnInit {
this.showData = false;
this.nextMonth = new Date().getMonth() + 2;
this.preMonth = new Date().getMonth();
// this.currentActiveIndex = this.nextMonth -1;
this.activeFilter(this.preMonth);
this.calendarConfig(this.common.getMonthName(new Date().getMonth() + 1), new Date().getFullYear());
}
calendarConfig(month?, year?) {
@ -303,11 +308,18 @@ export class DetailsComponent implements OnInit {
monthCardSliders(monthNo) {
console.log(monthNo + "__________________")
// this.common.startLoading();
// this.showData = false;
// this.currentMonth = this.nextMonth - 1;
// this.currentDate = new Date(this.currentYear, (this.preMonth + 1), 1);
this.calendarConfig(this.getMonthName(this.monthNo) , this.currentYear);
/* change
*/
this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex);
this.currentYear = new Date().getFullYear();
this.currentDate = new Date(new Date().getFullYear(), monthNo - 1);
this.showData = false;
this.nextMonth = monthNo;//new Date().getMonth() + 2;
this.preMonth = monthNo - 1;///new Date().getMonth();
//end
this.calendarConfig(this.getMonthName(monthNo), this.currentYear);
console.log("next month =" + this.nextMonth);
console.log(" Month Name =" + this.currentMonthName);
@ -719,8 +731,7 @@ doInfinite(infiniteScroll) {
};
// this.myTeamService.getSuborinatesAttStatus().subscribe((result: any) =>
this.myTeamService.getSuborinatesAttStatus(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
{
this.myTeamService.getSuborinatesAttStatus(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handleRespondSuborinatesAttStatusResult(result);
})
@ -763,4 +774,73 @@ doInfinite(infiniteScroll) {
}
}
//save favorite here
setFavorite(selEmp) {
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
var confirmBoxhtml = `<div>
<h4>Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
<br/>
<br/>
<div class="fav-profileImageDiv"><ion-row>`;
if (selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>';
if (!selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="../assets/imgs/profile.png"></div>';
confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
</ion-label>
</div></ion-row> </div>
</div>`
let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
if (userIndex == -1)
this.common.presentConfirmDialog(
confirmBoxhtml
, () => {
var request =
[{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
this.saveUserFavruiteList(request);
}, () => {
})
// if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
// this.isSelect = true;
// }
// else {
// this.isSelect = false;
// }
}
getFavruite() {
this.worklistService.getFavorite({}, () => {
}).subscribe((result) => {
if (this.common.validResponse(result)) {
this.common.stopLoading();
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
}
})
}
saveUserFavruiteList(request) {
this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => {
if (this.common.validResponse(result)) {
this.common.toastPK("replacementRoll", "favorite-saved");
}
})
}
}

@ -108,7 +108,7 @@
<!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} -->
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'">
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite()">
<img src="assets/imgs/fav.svg" />
</div>
</div>

@ -75,7 +75,7 @@
<span>{{employee.NAME}}</span>
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'">
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
</div>

@ -327,7 +327,7 @@ export class WorkListReplacementRollComponent implements OnInit {
data: "Success"
});
if (this.selEmp && this.isAnswer == false)
this.setFavorite();
this.setFavorite(this.selEmp);
}, 5000);
this.cs.openNotificationPage();
@ -457,38 +457,41 @@ export class WorkListReplacementRollComponent implements OnInit {
this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => {
if (this.cs.validResponse(result)) {
console.log(result);
this.cs.toastPK("replacementRoll", "favorite-saved");
}
})
}
setFavorite() {
setFavorite(selEmp) {
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
var confirmBoxhtml = `<div>
<h4>Do you want to add ` + this.selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
<h4>Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
<br/>
<br/>
<div class="fav-profileImageDiv">`;
if (this.selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<img class="empImgeRep" src="data:image/png;base64,' + this.selEmp.EMPLOYEE_IMAGE + '">';
if (!this.selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<img class="empImgeRep" src="../assets/imgs/profile.png">';
<div class="fav-profileImageDiv"><ion-row>`;
if (selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>';
if (!selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="../assets/imgs/profile.png"></div>';
confirmBoxhtml += ` <ion-label class="fav-employee-details">
confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
<span>` + this.selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
</ion-label>
</div>
</div></ion-row> </div>
</div>`
let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == this.selEmp.USER_NAME)
let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
if (userIndex == -1)
this.cs.presentConfirmDialog(
confirmBoxhtml
, () => {
var request =
[{ "USER_NAME": this.selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": this.selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": this.selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": this.selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
[{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
this.saveUserFavruiteList(request);
}, () => {

@ -2105,6 +2105,10 @@
"en": "Enter a note",
"ar": "أدخل ملاحظة"
},
"favorite-saved": {
"en": "Your Favorite saved successfully",
"ar": "تم حفظ مفضلتك بنجاح"
},
"msg": {
"en": "Select a replacement",
"ar": "اختر بديل"
@ -3093,5 +3097,23 @@
"en": "Whatsapp",
"ar": "واتس اب"
}
},
"erm-channel": {
"fedback-about-ux": {
"en": "This is to get feedback about the user experience",
"ar": "هذا للحصول على تعليقات حول تجربة المستخدم"
},
"how-would-you-like": {
"en": "How would you like to rate",
"ar": "كيف تريد أن تقيم"
},
"how-would-you-satisfied": {
"en": "How do you satisfied with this application",
"ar": "ما مدى رضائك عن هذا التطبيق"
},
"give-comments": {
"en": "Please give us a comments",
"ar": "من فضلك اعطنا تعليقات"
}
}
}

@ -1562,11 +1562,12 @@ table.monthview-datetable th small {
display: block;
}
.fav-employee-details{
font-size: 24px;
position: relative;
bottom: 30px;
font-size: 20px;
position: absolute;
bottom: 85px;
font-weight: bold;
color: black !important;
padding: 5px;
}
.fav-profileImageDiv{
width: 100%;

Loading…
Cancel
Save