|
|
|
|
@ -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);
|
|
|
|
|
}, () => {
|
|
|
|
|
|