diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html index 3cdc7f66..d6286590 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -140,7 +140,7 @@ + (click)="selectAtion('Delegate', approvalInfo)" /> diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts index 4db168ab..539e308d 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -460,7 +460,7 @@ export class WorkListMainItgComponent implements OnInit { } - selectAtion(actionSelected) { + selectAtion(actionSelected, info?) { this.actionSelected = actionSelected; if (this.actionSelected === 'Answer') { this.actionService(5, this.commentText); @@ -469,6 +469,7 @@ export class WorkListMainItgComponent implements OnInit { this.actionService(1, this.commentText); } if (this.actionSelected === 'Delegate') { + this.common.sharedService.setSharedData(info,'selectedEmpInfo'), this.presentModal(4); } if (this.actionSelected === 'Doable') { diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html index aec4a7d0..604ac00a 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html @@ -98,9 +98,9 @@ - + - @@ -156,7 +156,7 @@ -
+
@@ -168,7 +168,7 @@
+ *ngIf="relatedList?.length> 0 && !userSelected && ReplacementList?.length ==0 && searchKeySelect == '1'">
{{'replacementRoll, related' | translate}}
@@ -177,7 +177,7 @@
- @@ -185,8 +185,8 @@ {{employee.Name}} -
- +
+
@@ -194,6 +194,7 @@
+
@@ -206,13 +207,13 @@ - + {{employee.EMPLOYEE_DISPLAY_NAME}} -
+
@@ -254,7 +255,7 @@
- {{'general, save' | translate}} + {{'general, save' | translate}}
diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss index 5f0ca300..9ea7dfa7 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss @@ -30,7 +30,7 @@ margin: 10px; } .star-fav-left{ - float: right; + float: left; margin: 10px 5px; } .uk-margin{margin: 15px 15px 0px 15px; @@ -262,10 +262,10 @@ bottom: 10px; position: relative;} - .star-fav-left{ - float: left; - margin: 10px 5px; - } + // .star-fav-left{ + // float: left; + // margin: 10px 5px; + // } .top-radio-row{ font-size: 12px; display: block; diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts index a1c5c5c1..711d9aa8 100644 --- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts @@ -39,27 +39,35 @@ export class WorkListReplacementItgComponent implements OnInit { relatedList = []; public direction = ''; arr = []; + delegtedEmp; constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, public worklistService: WorklistService, - public modalController: ModalController) { - this.direction = TranslatorService.getCurrentDirection(); - } + public modalController: ModalController) { + this.direction = TranslatorService.getCurrentDirection(); + console.log(this.direction); + } + + // async ionViewWillEnter() { + // await this.getFavruite(); + // } ngOnInit() { - this.getFavruite(); - if(!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined){ - this.arr = this.cs.sharedService.getSharedData('workflow-user', false); - var lookupObject = {}; - - for(var i in this.arr) { - lookupObject[this.arr[i]['Name']] = this.arr[i]; - } - console.log(lookupObject); - for(i in lookupObject) { - this.relatedList.push(lookupObject[i]); - } + this.delegtedEmp = this.cs.sharedService.getSharedData('selectedEmpInfo', true); + if (this.delegtedEmp === undefined) { + if (!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined) { + this.arr = this.cs.sharedService.getSharedData('workflow-user', false); + var lookupObject = {}; + for (var i in this.arr) { + lookupObject[this.arr[i]['Name']] = this.arr[i]; + } + for (i in lookupObject) { + this.relatedList.push(lookupObject[i]); + } + } + } else { + this.select(this.delegtedEmp, 1); } } @@ -139,6 +147,7 @@ export class WorkListReplacementItgComponent implements OnInit { // } closePage() { + console.log(this.selEmp); this.isSave = true; let data: any = null; if (this.isSave == true) { @@ -160,7 +169,7 @@ export class WorkListReplacementItgComponent implements OnInit { } } - closeFunction(){ + closeFunction() { this.modalController.dismiss({ 'dismissed': true, // comments: this.userNote @@ -168,17 +177,22 @@ export class WorkListReplacementItgComponent implements OnInit { } onChangeSelect(select) { - console.log(select.detail.value); let selectValue = select.detail.value; - + this.searchKey = ''; if (selectValue == "1") { this.listOfRealted = this.relatedList; + console.log(this.relatedList); this.isSelect = true; this.isFilter = true; - } else if(selectValue == "4" ){ + this.ReplacementList = []; + } else if (selectValue == "4") { this.listOfFav = this.favoriteUserList; this.isFilter = true; - } else if(selectValue === '2' || selectValue === '3' || selectValue === '5'){ + this.ReplacementList = []; + if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined){ + this.getFavruite(); + } + } else if (selectValue === '2' || selectValue === '3' || selectValue === '5') { this.isSelect = true; this.isFilter = false; } @@ -200,12 +214,10 @@ export class WorkListReplacementItgComponent implements OnInit { }, 3000); } select(selectEmp, index) { - console.log(selectEmp); this.selEmp = selectEmp this.userSelected = true; this.active = index; this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.Name; - console.log(this.searchKey) //this.closePage(); } @@ -272,6 +284,7 @@ export class WorkListReplacementItgComponent implements OnInit { if (this.cs.validResponse(result)) { this.cs.stopLoading(); this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList']; + console.log(this.favoriteUserList); } }) } @@ -279,28 +292,36 @@ export class WorkListReplacementItgComponent implements OnInit { listOfRealted = []; listOfFav = [] - filterList(event){ - console.log(this.relatedList); - console.log(this.favoriteUserList); + filterList(event) { const val = event.target.value; - if(this.searchKeySelect === '1'){ - if(val === '') { + if (this.searchKeySelect === '1') { + if (val === '') { this.relatedList = this.listOfRealted; } else { this.relatedList = this.listOfRealted.filter((item) => { return (item.Name.toLowerCase().indexOf(val.toLowerCase()) > -1); }); } - } else if(this.searchKeySelect ==='4') { - if(val === '') { + } else if (this.searchKeySelect === '4') { + if (val === '') { this.favoriteUserList = this.listOfFav; } else { this.favoriteUserList = this.listOfFav.filter((item) => { return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1); }); } - }else{ + } else { return; } } + isfavEmp(emp) { + let isEmp = this.favoriteUserList.find(elm => elm.USER_NAME === emp.EmployeeID); + return isEmp; + } + + saveBtnDisabled() { + if (!this.userNote || this.userNote === '') + return true; + else { return false; } + } }