|
|
|
|
@ -55,6 +55,8 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
spaceBetween: 5
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public activeSelectedLetter:string;
|
|
|
|
|
|
|
|
|
|
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
|
|
|
|
|
this.P_PAGE_NUM = 1;
|
|
|
|
|
this.P_PAGE_LIMIT = 50;
|
|
|
|
|
@ -509,22 +511,28 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
this.worklistService.getFavoriteWithoutImage({}, () => {
|
|
|
|
|
}).subscribe((result) => {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
|
this.favoriteUserList.forEach((obj) => {
|
|
|
|
|
// this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
|
let favList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
|
favList.forEach((obj) => {
|
|
|
|
|
obj.IsFavorite = true;
|
|
|
|
|
this.favLetter.push(obj.EMPLOYEE_DISPLAY_NAME.charAt(0).toUpperCase());
|
|
|
|
|
});
|
|
|
|
|
this.favLetter = this.favLetter.filter((elem, index, self) => {
|
|
|
|
|
return index === self.indexOf(elem);
|
|
|
|
|
});
|
|
|
|
|
this.favLetter.forEach((obj, index) => {
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
this.selectedLetter(obj);
|
|
|
|
|
this.favIsActive.push(true);
|
|
|
|
|
} else {
|
|
|
|
|
this.favIsActive.push(false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (this.activeSelectedLetter) {
|
|
|
|
|
this.selectedLetter(this.activeSelectedLetter);
|
|
|
|
|
} else {
|
|
|
|
|
this.favLetter.forEach((obj, index) => {
|
|
|
|
|
if(this.activeSelectedLetter) {}
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
this.selectedLetter(obj);
|
|
|
|
|
this.favIsActive.push(true);
|
|
|
|
|
} else {
|
|
|
|
|
this.favIsActive.push(false);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
console.log(this.favLetter);
|
|
|
|
|
console.log(this.favIsActive);
|
|
|
|
|
}
|
|
|
|
|
@ -554,7 +562,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
this.getFavruite();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setFavorite(selEmp) {
|
|
|
|
|
@ -645,6 +653,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
this.favLetter.forEach((letter, index) => {
|
|
|
|
|
if (letter === el) {
|
|
|
|
|
this.favIsActive[index] = true;
|
|
|
|
|
this.activeSelectedLetter = el;
|
|
|
|
|
this.worklistService.getFavoriteByLetter(letter,() => {
|
|
|
|
|
}).subscribe((result) => {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
|