|
|
|
|
@ -53,7 +53,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
this.P_PAGE_NUM = 1;
|
|
|
|
|
this.P_PAGE_LIMIT = 50;
|
|
|
|
|
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false);
|
|
|
|
|
// this.getFavruite();
|
|
|
|
|
this.getFavruite();
|
|
|
|
|
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false);
|
|
|
|
|
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false);
|
|
|
|
|
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
|
|
|
|
|
@ -442,9 +442,9 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
this.selectedType = 1;
|
|
|
|
|
this.listOfRealted = this.actionHistory;
|
|
|
|
|
} else if (selectValue === '4') {
|
|
|
|
|
if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) {
|
|
|
|
|
// if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) {
|
|
|
|
|
this.getFavruite();
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
this.isFilter = true;
|
|
|
|
|
this.selectedType = 4;
|
|
|
|
|
} else if (selectValue === '2' || selectValue === '3' || selectValue === '5') {
|
|
|
|
|
@ -505,11 +505,15 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
saveUserFavruiteList(request) {
|
|
|
|
|
saveUserFavruiteList(request, isFav: boolean) {
|
|
|
|
|
this.worklistService.saveFavoriteList(request, () => {
|
|
|
|
|
}).subscribe((result) => {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.cs.toastPK("replacementRoll", "favorite-saved");
|
|
|
|
|
if(isFav){
|
|
|
|
|
this.cs.toastPK("replacementRoll", "favorite-saved");
|
|
|
|
|
} else{
|
|
|
|
|
this.cs.toastPK("replacementRoll", "favorite-unsaved");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
@ -520,55 +524,42 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
|
|
|
|
|
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
|
|
|
|
|
selEmp.IsFavorite = !selEmp.IsFavorite;
|
|
|
|
|
if (this.favoriteUserList.some(x => x['USER_NAME'] === selEmp.USER_NAME)) {
|
|
|
|
|
let 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>';
|
|
|
|
|
}
|
|
|
|
|
let 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>`;
|
|
|
|
|
const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === selEmp.USER_NAME)
|
|
|
|
|
if (userIndex === -1) {
|
|
|
|
|
this.cs.presentConfirmDialog(
|
|
|
|
|
confirmBoxhtml
|
|
|
|
|
, () => {
|
|
|
|
|
const request =
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
'USER_NAME': selEmp['USER_NAME'],
|
|
|
|
|
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
|
|
|
|
|
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
|
|
|
|
|
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
|
|
|
|
|
'IsFavorite': selEmp.IsFavorite
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
|
|
|
|
|
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
|
|
|
|
|
</ion-label>
|
|
|
|
|
</div></ion-row> </div>
|
|
|
|
|
</div>`;
|
|
|
|
|
|
|
|
|
|
const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === selEmp.USER_NAME)
|
|
|
|
|
if (userIndex === -1) {
|
|
|
|
|
this.cs.presentConfirmDialog(
|
|
|
|
|
confirmBoxhtml
|
|
|
|
|
, () => {
|
|
|
|
|
const request =
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
'USER_NAME': selEmp['USER_NAME'],
|
|
|
|
|
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
|
|
|
|
|
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
|
|
|
|
|
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
|
|
|
|
|
'IsFavorite': selEmp.IsFavorite
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
this.saveUserFavruiteList(request);
|
|
|
|
|
}, () => { });
|
|
|
|
|
} else {
|
|
|
|
|
const request =
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
'USER_NAME': selEmp['USER_NAME'],
|
|
|
|
|
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
|
|
|
|
|
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
|
|
|
|
|
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
|
|
|
|
|
'IsFavorite': false
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
this.saveUserFavruiteList(request);
|
|
|
|
|
}
|
|
|
|
|
this.saveUserFavruiteList(request, selEmp.IsFavorite);
|
|
|
|
|
}, () => { });
|
|
|
|
|
} else {
|
|
|
|
|
const request =
|
|
|
|
|
[
|
|
|
|
|
@ -580,7 +571,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
'IsFavorite': false
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
this.saveUserFavruiteList(request);
|
|
|
|
|
this.saveUserFavruiteList(request, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|