fixed itg issues

MOHEMM-Q2-DEV
umasoodch 4 years ago
parent 90fdf7e4a7
commit 0b67911dc4

@ -140,7 +140,7 @@
<ion-col size='2'></ion-col> <ion-col size='2'></ion-col>
<ion-col size='5'> <ion-col size='5'>
<img class="req_info" src="assets/imgs/delegate.svg" <img class="req_info" src="assets/imgs/delegate.svg"
(click)="selectAtion('Delegate')" /> (click)="selectAtion('Delegate', approvalInfo)" />
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>

@ -460,7 +460,7 @@ export class WorkListMainItgComponent implements OnInit {
} }
selectAtion(actionSelected) { selectAtion(actionSelected, info?) {
this.actionSelected = actionSelected; this.actionSelected = actionSelected;
if (this.actionSelected === 'Answer') { if (this.actionSelected === 'Answer') {
this.actionService(5, this.commentText); this.actionService(5, this.commentText);
@ -469,6 +469,7 @@ export class WorkListMainItgComponent implements OnInit {
this.actionService(1, this.commentText); this.actionService(1, this.commentText);
} }
if (this.actionSelected === 'Delegate') { if (this.actionSelected === 'Delegate') {
this.common.sharedService.setSharedData(info,'selectedEmpInfo'),
this.presentModal(4); this.presentModal(4);
} }
if (this.actionSelected === 'Doable') { if (this.actionSelected === 'Doable') {

@ -98,9 +98,9 @@
</ion-radio-group> </ion-radio-group>
<ion-item lines="none" class="search-box" *ngIf='!isFilter'> <ion-item lines="none" class="search-box" *ngIf='!isFilter && !userSelected'>
<ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" <ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'ltr'? 'filterInput':'filterInput-ar'"
[(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> [(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input>
</ion-item> </ion-item>
@ -156,7 +156,7 @@
<!-- <br>{{employee.USER_NAME}}<br> <!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} --> {{employee.EMAIL_ADDRESS}} -->
</ion-label> </ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)"> <div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" /> <img src="assets/imgs/fav.svg" />
</div> </div>
</div> </div>
@ -168,7 +168,7 @@
<!-- related list --> <!-- related list -->
<div [hidden]="isAnswer==true" <div [hidden]="isAnswer==true"
*ngIf="relatedList.length> 0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '1'"> *ngIf="relatedList?.length> 0 && !userSelected && ReplacementList?.length ==0 && searchKeySelect == '1'">
<div class="uk-margin"> <div class="uk-margin">
{{'replacementRoll, related' | translate}} {{'replacementRoll, related' | translate}}
</div> </div>
@ -177,7 +177,7 @@
<div (click)="select(employee,i)" *ngFor="let employee of relatedList;let i=index;" class="square"> <div (click)="select(employee,i)" *ngFor="let employee of relatedList;let i=index;" class="square">
<div class="profileImageDiv"> <div class="profileImageDiv">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" <img *ngIf="employee?.EMPLOYEE_IMAGE" class="empImgeRep"
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE"> [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png"> <img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details"> <ion-label class="employee-details">
@ -185,8 +185,8 @@
<span>{{employee.Name}}</span> <span>{{employee.Name}}</span>
</ion-label> </ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"> <div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'">
<img src="assets/imgs/fav filled.svg" /> <img [src]="isfavEmp(employee)? 'assets/imgs/fav filled.svg':'assets/imgs/fav.svg' " />
</div> </div>
</div> </div>
</div> </div>
@ -194,6 +194,7 @@
</div> </div>
</div> </div>
<!-- favorite list -->
<div [hidden]="isAnswer==true" <div [hidden]="isAnswer==true"
*ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '4'"> *ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '4'">
<div class="uk-margin"> <div class="uk-margin">
@ -206,13 +207,13 @@
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" <img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep"
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE"> [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png"> <img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details"> <ion-label class="employee-details">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
</ion-label> </ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"> <div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'">
<img src="assets/imgs/fav filled.svg" /> <img src="assets/imgs/fav filled.svg" />
</div> </div>
</div> </div>
@ -254,7 +255,7 @@
<ion-footer> <ion-footer>
<div class="centerDiv" *ngIf="userSelected ==true"> <div class="centerDiv" *ngIf="userSelected ==true">
<ion-button (click)="closePage()" class="footer-button" color="customnavy">{{'general, save' | translate}} <ion-button [disabled]="saveBtnDisabled()" (click)="closePage()" class="footer-button" color="customnavy">{{'general, save' | translate}}
</ion-button> </ion-button>
</div> </div>
<div class="centerDiv"> <div class="centerDiv">

@ -30,7 +30,7 @@
margin: 10px; margin: 10px;
} }
.star-fav-left{ .star-fav-left{
float: right; float: left;
margin: 10px 5px; margin: 10px 5px;
} }
.uk-margin{margin: 15px 15px 0px 15px; .uk-margin{margin: 15px 15px 0px 15px;
@ -262,10 +262,10 @@
bottom: 10px; bottom: 10px;
position: relative;} position: relative;}
.star-fav-left{ // .star-fav-left{
float: left; // float: left;
margin: 10px 5px; // margin: 10px 5px;
} // }
.top-radio-row{ .top-radio-row{
font-size: 12px; font-size: 12px;
display: block; display: block;

@ -39,27 +39,35 @@ export class WorkListReplacementItgComponent implements OnInit {
relatedList = []; relatedList = [];
public direction = ''; public direction = '';
arr = []; arr = [];
delegtedEmp;
constructor(public vacationRuleService: VacationRuleServiceService, constructor(public vacationRuleService: VacationRuleServiceService,
public ts: TranslatorService, public ts: TranslatorService,
public cs: CommonService, public cs: CommonService,
public worklistService: WorklistService, public worklistService: WorklistService,
public modalController: ModalController) { public modalController: ModalController) {
this.direction = TranslatorService.getCurrentDirection(); this.direction = TranslatorService.getCurrentDirection();
} console.log(this.direction);
}
// async ionViewWillEnter() {
// await this.getFavruite();
// }
ngOnInit() { ngOnInit() {
this.getFavruite(); this.delegtedEmp = this.cs.sharedService.getSharedData('selectedEmpInfo', true);
if(!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined){ if (this.delegtedEmp === undefined) {
this.arr = this.cs.sharedService.getSharedData('workflow-user', false); if (!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined) {
var lookupObject = {}; this.arr = this.cs.sharedService.getSharedData('workflow-user', false);
var lookupObject = {};
for(var i in this.arr) { for (var i in this.arr) {
lookupObject[this.arr[i]['Name']] = this.arr[i]; lookupObject[this.arr[i]['Name']] = this.arr[i];
} }
console.log(lookupObject); for (i in lookupObject) {
for(i in lookupObject) { this.relatedList.push(lookupObject[i]);
this.relatedList.push(lookupObject[i]); }
} }
} else {
this.select(this.delegtedEmp, 1);
} }
} }
@ -139,6 +147,7 @@ export class WorkListReplacementItgComponent implements OnInit {
// } // }
closePage() { closePage() {
console.log(this.selEmp);
this.isSave = true; this.isSave = true;
let data: any = null; let data: any = null;
if (this.isSave == true) { if (this.isSave == true) {
@ -160,7 +169,7 @@ export class WorkListReplacementItgComponent implements OnInit {
} }
} }
closeFunction(){ closeFunction() {
this.modalController.dismiss({ this.modalController.dismiss({
'dismissed': true, 'dismissed': true,
// comments: this.userNote // comments: this.userNote
@ -168,17 +177,22 @@ export class WorkListReplacementItgComponent implements OnInit {
} }
onChangeSelect(select) { onChangeSelect(select) {
console.log(select.detail.value);
let selectValue = select.detail.value; let selectValue = select.detail.value;
this.searchKey = '';
if (selectValue == "1") { if (selectValue == "1") {
this.listOfRealted = this.relatedList; this.listOfRealted = this.relatedList;
console.log(this.relatedList);
this.isSelect = true; this.isSelect = true;
this.isFilter = true; this.isFilter = true;
} else if(selectValue == "4" ){ this.ReplacementList = [];
} else if (selectValue == "4") {
this.listOfFav = this.favoriteUserList; this.listOfFav = this.favoriteUserList;
this.isFilter = true; 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.isSelect = true;
this.isFilter = false; this.isFilter = false;
} }
@ -200,12 +214,10 @@ export class WorkListReplacementItgComponent implements OnInit {
}, 3000); }, 3000);
} }
select(selectEmp, index) { select(selectEmp, index) {
console.log(selectEmp);
this.selEmp = selectEmp this.selEmp = selectEmp
this.userSelected = true; this.userSelected = true;
this.active = index; this.active = index;
this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.Name; this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.Name;
console.log(this.searchKey)
//this.closePage(); //this.closePage();
} }
@ -272,6 +284,7 @@ export class WorkListReplacementItgComponent implements OnInit {
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'];
console.log(this.favoriteUserList);
} }
}) })
} }
@ -279,28 +292,36 @@ export class WorkListReplacementItgComponent implements OnInit {
listOfRealted = []; listOfRealted = [];
listOfFav = [] listOfFav = []
filterList(event){ filterList(event) {
console.log(this.relatedList);
console.log(this.favoriteUserList);
const val = event.target.value; const val = event.target.value;
if(this.searchKeySelect === '1'){ if (this.searchKeySelect === '1') {
if(val === '') { if (val === '') {
this.relatedList = this.listOfRealted; this.relatedList = this.listOfRealted;
} else { } else {
this.relatedList = this.listOfRealted.filter((item) => { this.relatedList = this.listOfRealted.filter((item) => {
return (item.Name.toLowerCase().indexOf(val.toLowerCase()) > -1); return (item.Name.toLowerCase().indexOf(val.toLowerCase()) > -1);
}); });
} }
} else if(this.searchKeySelect ==='4') { } else if (this.searchKeySelect === '4') {
if(val === '') { if (val === '') {
this.favoriteUserList = this.listOfFav; this.favoriteUserList = this.listOfFav;
} else { } else {
this.favoriteUserList = this.listOfFav.filter((item) => { this.favoriteUserList = this.listOfFav.filter((item) => {
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1); return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
}); });
} }
}else{ } else {
return; 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; }
}
} }

Loading…
Cancel
Save