fixed bug# 687

added toasts MSG for survey and video erm
fixed fav for ITG
added new icons for action btn in ITG
enad-pre-live
enadhilal 4 years ago
parent c10590d58a
commit fe5f41e89e

@ -32,7 +32,7 @@ export class AbsenceReplacementListComponent implements OnInit {
P_PAGE_NUM: number; P_PAGE_NUM: number;
P_PAGE_LIMIT: number; P_PAGE_LIMIT: number;
ReplacementList: any = []; ReplacementList: any = [];
searchBy: string = ""; searchBy: string = "2";
IsReachEnd: boolean = false; IsReachEnd: boolean = false;
ReplacmentListRes: WorKListReplacmentEmployeeResponse; ReplacmentListRes: WorKListReplacmentEmployeeResponse;
private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest(); private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest();

@ -60,9 +60,14 @@ export class HomeComponent implements OnInit {
}, ( }, (
) => { }, this.ts.trPK('general', 'ok')).subscribe((result) => { ) => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
CommonService.SKIP = true; if (this.cs.validResponse(result)){
this.cs.openHome(); this.cs.greenToastPK("erm-channel", "viedo-success");
}) CommonService.SKIP = true;
this.cs.openHome();
}else{
this.cs.redToastPK("erm-channel", "erm-failed");
}
});
} }
} }

@ -52,9 +52,14 @@ export class SurveyComponent implements OnInit {
this.authService.saveAdsStatus(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result) => { this.authService.saveAdsStatus(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result) => {
CommonService.SKIP = true; if (this.cs.validResponse(result)){
this.cs.openHome(); this.cs.greenToastPK("erm-channel", "survey-success");
}) CommonService.SKIP = true;
this.cs.openHome();
}else{
this.cs.redToastPK("erm-channel", "erm-failed");
}
});
} }
select(rating) { select(rating) {
this.satisfied = rating; this.satisfied = rating;

@ -149,16 +149,16 @@ export class WorkListMainItgComponent implements OnInit {
return '../assets/imgs/mohemm-action/info.png'; return '../assets/imgs/mohemm-action/info.png';
} }
if (actionName === 'Grant') { if (actionName === 'Grant') {
return '../assets/imgs/mohemm-action/info.png'; return '../assets/imgs/mohemm-action/grant.png';
} }
if (actionName === 'Delegate') { if (actionName === 'Delegate') {
return '../assets/imgs/mohemm-action/delegate.png'; return '../assets/imgs/mohemm-action/delegate.png';
} }
if (actionName === 'Answer') { if (actionName === 'Answer') {
return '../assets/imgs/mohemm-action/info.png'; return '../assets/imgs/mohemm-action/answer.png';
} }
if (actionName === 'Question') { if (actionName === 'Question') {
return '../assets/imgs/mohemm-action/info.png'; return '../assets/imgs/mohemm-action/question.png';
} }
if (actionName === 'ReportGenerated') { if (actionName === 'ReportGenerated') {
return '../assets/imgs/mohemm-action/ReportGenerated.png'; return '../assets/imgs/mohemm-action/ReportGenerated.png';
@ -170,7 +170,7 @@ export class WorkListMainItgComponent implements OnInit {
return '../assets/imgs/mohemm-action/notDoable.png'; return '../assets/imgs/mohemm-action/notDoable.png';
} }
if (actionName === 'DataCorrected') { if (actionName === 'DataCorrected') {
return '../assets/imgs/mohemm-action/info.png'; return '../assets/imgs/mohemm-action/data-corrected.png';
} }
} }

@ -300,10 +300,10 @@ export class WorkListReplacementItgComponent implements OnInit {
const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === userID); const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === userID);
console.log(userIndex); console.log(userIndex);
if (userIndex === -1) { if (userIndex === -1) {
selEmp.IsFavorite = !selEmp.IsFavorite;
this.cs.presentConfirmDialog( this.cs.presentConfirmDialog(
confirmBoxhtml confirmBoxhtml
, () => { , () => {
selEmp.IsFavorite = !selEmp.IsFavorite;
const request = const request =
[ [
{ {

@ -445,27 +445,26 @@ export class WorkListReplacementRollComponent implements OnInit {
counter = 0; counter = 0;
onChangeSelect(select) { onChangeSelect(select) {
let selectValue = select.detail.value; let selectValue = select.detail.value;
if (selectValue == '1') { if (selectValue == '1') {
this.isSelect = true; this.isSelect = true;
this.isFilter = true; this.isFilter = true;
this.selectedType = 1; this.selectedType = 1;
this.listOfRealted = this.actionHistory; this.listOfRealted = this.actionHistory;
if (this.counter > 0) { // if (this.counter > 0) {
this.actionHistory.forEach((obj, i) => { this.actionHistory.forEach((obj, i) => {
if (this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) { if (this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) {
this.actionHistory[i].IsFavorite = true; this.actionHistory[i].IsFavorite = true;
} else { } else {
this.actionHistory[i].IsFavorite = false; this.actionHistory[i].IsFavorite = false;
} }
}); });
} // }
this.counter = 1; this.counter = 1;
} else if (selectValue === '4') { } else if (selectValue === '4') {
// if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) { // if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) {
this.getFavruite(); this.getFavruite();
// } // }
this.isFilter = true; this.isFilter = true;
this.selectedType = 4; this.selectedType = 4;
} else if (selectValue === '2' || selectValue === '3' || selectValue === '5') { } else if (selectValue === '2' || selectValue === '3' || selectValue === '5') {
this.isSelect = true; this.isSelect = true;
@ -523,7 +522,9 @@ export class WorkListReplacementRollComponent implements OnInit {
}); });
this.favLetter.forEach((obj, index) => { this.favLetter.forEach((obj, index) => {
if (this.activeSelectedLetter) { } if (this.activeSelectedLetter) {
this.selectedLetter(this.activeSelectedLetter);
}
if (index === 0) { if (index === 0) {
// this.selectedLetter(obj); // this.selectedLetter(obj);
this.favIsActive.push(true); this.favIsActive.push(true);
@ -531,150 +532,154 @@ export class WorkListReplacementRollComponent implements OnInit {
this.favIsActive.push(false); this.favIsActive.push(false);
} }
}); });
console.log(this.favLetter); console.log(this.favLetter);
console.log(this.favIsActive); console.log(this.favIsActive);
} }
}); });
// this.worklistService.getFavorite({}, () => { // this.worklistService.getFavorite({}, () => {
// }).subscribe((result) => { // }).subscribe((result) => {
// if (this.cs.validResponse(result)) { // if (this.cs.validResponse(result)) {
// this.cs.stopLoading(); // this.cs.stopLoading();
// this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; // this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
// this.listOfFav = this.favoriteUserList; // this.listOfFav = this.favoriteUserList;
// this.favoriteUserList.forEach((obj) => { // this.favoriteUserList.forEach((obj) => {
// obj.IsFavorite = true; // obj.IsFavorite = true;
// }); // });
// } // }
// }); // });
} }
saveUserFavruiteList(request, isFav: boolean) { saveUserFavruiteList(request, isFav: boolean) {
this.worklistService.saveFavoriteList(request, () => { this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => { }).subscribe((result) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (isFav) { if (isFav) {
this.cs.greenToastPK("replacementRoll", "favorite-saved"); this.cs.greenToastPK("replacementRoll", "favorite-saved");
} else { } else {
this.cs.redToastPK("replacementRoll", "favorite-unsaved"); this.cs.redToastPK("replacementRoll", "favorite-unsaved");
}
this.getFavruite();
} }
this.getFavruite(); });
} }
});
}
setFavorite(selEmp) { setFavorite(selEmp) {
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME; let confirmBoxhtml = `<div>
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
selEmp.IsFavorite = !selEmp.IsFavorite;
let confirmBoxhtml = `<div>
<h4>Do you want to add ` + 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/>
<br/> <br/>
<div class="fav-profileImageDiv"><ion-row>`; <div class="fav-profileImageDiv"><ion-row>`;
if (selEmp.EMPLOYEE_IMAGE) { if (selEmp.EMPLOYEE_IMAGE) {
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>'; confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>';
} }
if (!selEmp.EMPLOYEE_IMAGE) { if (!selEmp.EMPLOYEE_IMAGE) {
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="../assets/imgs/profile.png"></div>'; 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"> confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span> <span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
</ion-label> </ion-label>
</div></ion-row> </div> </div></ion-row> </div>
</div>`; </div>`;
const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === selEmp.USER_NAME) const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === selEmp.USER_NAME)
if (userIndex === -1) { if (userIndex === -1) {
this.cs.presentConfirmDialog( this.cs.presentConfirmDialog(
confirmBoxhtml confirmBoxhtml
, () => { , () => {
const request = 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 : '';
'USER_NAME': selEmp['USER_NAME'], selEmp.IsFavorite = !selEmp.IsFavorite;
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'], const request =
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS, [
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE, {
'IsFavorite': selEmp.IsFavorite 'USER_NAME': selEmp['USER_NAME'],
} 'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
]; 'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
this.saveUserFavruiteList(request, selEmp.IsFavorite); 'IsFavorite': selEmp.IsFavorite
}, () => { }); }
} else { ];
const request =
[ this.saveUserFavruiteList(request, selEmp.IsFavorite);
{ }, () => { });
'USER_NAME': selEmp['USER_NAME'], } else {
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'], selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS, selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE, selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
'IsFavorite': false selEmp.IsFavorite = !selEmp.IsFavorite;
} const request =
]; [
this.saveUserFavruiteList(request, false); {
'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, false);
}
} }
}
listOfRealted: any = []; listOfRealted: any = [];
listOfFav: any = []; listOfFav: any = [];
filterList(event) { filterList(event) {
const val = event.target.value; const val = event.target.value;
if (this.selectedType === 1) { if (this.selectedType === 1) {
if (val === '') { if (val === '') {
this.actionHistory = this.listOfRealted; this.actionHistory = this.listOfRealted;
} else { } else {
this.actionHistory = this.listOfRealted.filter((item) => { this.actionHistory = this.listOfRealted.filter((item) => {
return (item.NAME.toLowerCase().indexOf(val.toLowerCase()) > -1); return (item.NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
}); });
} }
} else if (this.selectedType === 4) { } else if (this.selectedType === 4) {
if (val === '') { if (val === '') {
this.favoriteUserList = this.listOfFav; this.favoriteUserList = this.listOfFav;
} else {
this.favoriteUserList = this.listOfFav.filter((item) => {
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
});
}
} else { } else {
this.favoriteUserList = this.listOfFav.filter((item) => { return;
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
});
} }
} else {
return;
} }
}
selectedLetter(el) { selectedLetter(el) {
this.isFavoriteLetterActive = true; this.isFavoriteLetterActive = true;
this.favLetter.forEach((letter, index) => { this.favLetter.forEach((letter, index) => {
if (letter === el) { if (letter === el) {
this.favIsActive[index] = true; this.favIsActive[index] = true;
this.activeSelectedLetter = el; this.activeSelectedLetter = el;
this.worklistService.getFavoriteByLetter(letter, () => { this.worklistService.getFavoriteByLetter(letter, () => {
}).subscribe((result) => { }).subscribe((result) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.cs.stopLoading(); this.cs.stopLoading();
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
this.listOfFav = this.favoriteUserList; this.listOfFav = this.favoriteUserList;
this.favoriteUserList.forEach((obj) => { this.favoriteUserList.forEach((obj) => {
obj.IsFavorite = true; obj.IsFavorite = true;
}); });
} }
}); });
} else { } else {
this.favIsActive[index] = false; this.favIsActive[index] = false;
} }
}); });
} }
returnIsActiveFunction(i) { returnIsActiveFunction(i) {
return this.favIsActive[i]; return this.favIsActive[i];
} }
clearSearchInput(){ clearSearchInput() {
this.inputSearch = ''; this.inputSearch = '';
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -3442,6 +3442,17 @@
"give-comments": { "give-comments": {
"en": "Please give us a comments", "en": "Please give us a comments",
"ar": "من فضلك اعطنا تعليقات" "ar": "من فضلك اعطنا تعليقات"
},
"survey-success":{
"en":"Your survey has been submitted successfully",
"ar":"تم تقديم الاستبيان الخاص بك بنجاح"
},
"erm-failed":{
"en":"Something went wrong please try again",
"ar":"حدث خطأ ما. أعد المحاولة من فضلك"
},"viedo-success":{
"en":"Thank you for watching this video",
"ar":"شكرا لك على مشاهدة هذا الفيديو"
} }
}, },
"transaction": { "transaction": {

Loading…
Cancel
Save