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='5'>
<img class="req_info" src="assets/imgs/delegate.svg"
(click)="selectAtion('Delegate')" />
(click)="selectAtion('Delegate', approvalInfo)" />
</ion-col>
</ion-row>
</ion-grid>

@ -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') {

@ -98,9 +98,9 @@
</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>
</ion-item>
@ -156,7 +156,7 @@
<!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} -->
</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" />
</div>
</div>
@ -168,7 +168,7 @@
<!-- related list -->
<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">
{{'replacementRoll, related' | translate}}
</div>
@ -177,7 +177,7 @@
<div (click)="select(employee,i)" *ngFor="let employee of relatedList;let i=index;" class="square">
<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">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
@ -185,8 +185,8 @@
<span>{{employee.Name}}</span>
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'">
<img src="assets/imgs/fav filled.svg" />
<div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'">
<img [src]="isfavEmp(employee)? 'assets/imgs/fav filled.svg':'assets/imgs/fav.svg' " />
</div>
</div>
</div>
@ -194,6 +194,7 @@
</div>
</div>
<!-- favorite list -->
<div [hidden]="isAnswer==true"
*ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '4'">
<div class="uk-margin">
@ -206,13 +207,13 @@
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep"
[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">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
</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" />
</div>
</div>
@ -254,7 +255,7 @@
<ion-footer>
<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>
</div>
<div class="centerDiv">

@ -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;

@ -39,28 +39,36 @@ 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();
console.log(this.direction);
}
// async ionViewWillEnter() {
// await this.getFavruite();
// }
ngOnInit() {
this.getFavruite();
if(!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined){
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) {
for (var i in this.arr) {
lookupObject[this.arr[i]['Name']] = this.arr[i];
}
console.log(lookupObject);
for(i in lookupObject) {
for (i in lookupObject) {
this.relatedList.push(lookupObject[i]);
}
}
} else {
this.select(this.delegtedEmp, 1);
}
}
SearchReplacementList() {
@ -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; }
}
}

Loading…
Cancel
Save