Merge branch 'MOHEMM-Q2-DEV' into enad-Q3

MOHEMM-HUAWEI-RELEASE
enadhilal 4 years ago
commit ff0492718e

@ -186,7 +186,7 @@ export class AttendScanService {
public updateFirebaseDocument(resultObject: any) {
try {
let currentFirebaseDocument = this.common.sharedService.getSharedData('firebase-document');
let currentFirebaseDocument = this.common.sharedService.getSharedData('firebase-document', false);
let currentSwipeArray = currentFirebaseDocument.document.swipeData;
if (currentSwipeArray) {
currentSwipeArray.push(resultObject);
@ -200,7 +200,12 @@ export class AttendScanService {
};
console.log(updatedDocument);
this.firebasex.updateDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, updatedDocument, this.collection, () => {
console.log("Successfully added document with id=" + this.userData.EMPLOYEE_NUMBER);
console.log("Successfully updated document with id = " + this.userData.EMPLOYEE_NUMBER);
const result = {
isDocumentAvailable: true,
document: updatedDocument
};
this.common.sharedService.setSharedData(result, 'firebase-document');
}, (error) => {
console.error("Error adding document: " + error);
});
@ -247,6 +252,11 @@ export class AttendScanService {
};
this.firebasex.setDocumentInFirestoreCollection(this.userData.EMPLOYEE_NUMBER, newDocument, this.collection, () => {
console.log("Successfully added document");
const result = {
isDocumentAvailable: true,
document: newDocument
};
this.common.sharedService.setSharedData(result, 'firebase-document');
}, (error) => {
console.error("Error adding document: "+error);
});

@ -119,21 +119,31 @@
</div>
</div>
<ion-label
[ngClass]="{'bg-blue-txt' : approvalInfo.Action === 'Submit' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}"
<!-- <ion-label
[ngClass]="{'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}"
class=""> {{approvalInfo.Action}}</ion-label> -->
<ion-label
[ngClass]="backgroundColor(approvalInfo.Action)"
class=""> {{approvalInfo.Action}}</ion-label>
<ion-label *ngIf="approvalInfo.Date != ''"
class="dateActionHistory">
{{returnDateTime(approvalInfo.Date) }} </ion-label>
</ion-col>
<ion-col size="4">
<img class="req_info" src="assets/imgs/req info.svg"
(click)="selectAtion('RequestInformation')" />
<img class="req_info deligate" src="assets/imgs/delegate.svg"
(click)="selectAtion('Delegate')" />
<ion-grid>
<ion-row>
<ion-col size='5'>
<img class="req_info" src="assets/imgs/req info.svg"
(click)="selectAtion('RequestInformation')" />
</ion-col>
<ion-col size='2'></ion-col>
<ion-col size='5'>
<img class="req_info" src="assets/imgs/delegate.svg"
(click)="selectAtion('Delegate', approvalInfo)" />
</ion-col>
</ion-row>
</ion-grid>
</ion-col>
</ion-item>
</div>

@ -23,7 +23,7 @@
}
.footer-btn-img{
max-width: none;
width: 60px;
width: 50px;
}
.timeline-item{
margin: 0;

@ -105,8 +105,9 @@ export class WorkListMainItgComponent implements OnInit {
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length };
this.segmentsArray = [this.segmentsArray[1], this.segmentsArray[2], this.segmentsArray[0]];
this.segmentData = [this.segmentData[1], this.segmentData[0]];
// this.workList = this.request_details.WFHistory.reverse();
this.workList = this.request_details.WFHistory;
this.workList = this.request_details.WFHistory.reverse();
this.common.sharedService.setSharedData(this.workList, 'workflow-user');
// this.workList = this.request_details.WFHistory;
this.options = this.request_details.AllowedActions;
this.activeSegment = this.segmentsArray[0].name;
for (let i = 0; i < this.options.length; i++) {
@ -283,21 +284,21 @@ export class WorkListMainItgComponent implements OnInit {
if (!comments) {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
} else {
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
if (result.MessageStatus !== 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
if (result.MessageStatus !== 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
setTimeout(() => {
this.messageSuccess = true;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(2);
this.skip();
this.messageSuccess = false;
}, 2000);
}
});
} else if (result.MessageStatus === 1) {
setTimeout(() => {
this.messageSuccess = true;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(2);
this.skip();
this.messageSuccess = false;
}, 2000);
}
});
}
} else if (action === 3) {// request more info
request.NewUserEMPId = this.replcamentID;
@ -459,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);
@ -468,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') {
@ -506,12 +508,14 @@ export class WorkListMainItgComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
this.replcamentID = data.data.empData.USER_NAME;
this.commentText = data.data.comments;
if (actionNumber === 3) {
this.actionService(3, this.commentText);
} else if (actionNumber === 4) {
this.actionService(4);
if(data.data.empData){
this.replcamentID = data.data.empData.USER_NAME ? data.data.empData.USER_NAME : data.data.empData.EmployeeID;
this.commentText = data.data.comments ? data.data.comments: null;
if (actionNumber === 3) {
this.actionService(3, this.commentText);
} else if (actionNumber === 4) {
this.actionService(4);
}
}
});
@ -534,34 +538,47 @@ export class WorkListMainItgComponent implements OnInit {
}
}
returnDateTime(stringDate: string){
returnDateTime(stringDate: string) {
let allDateTime = stringDate.split(' ');
let time = allDateTime[1].split(':', 2);
let fullDate = this.transform(stringDate);
let dateArr= allDateTime[0].split('/')
let correctDate = dateArr[1]+'/'+dateArr[0]+'/'+dateArr[2];
let fullDate = this.transform(correctDate);
return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
}
locale = {
en: {
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
// month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
}
};
};
transform(value: string) {
let x = new Date(Date.parse(value));
//return value.toLowerCase();
let month = this.getMonthNameShort('en',x.getMonth())
return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
let month = this.getMonthNameShort('en', x.getMonth())
return "" + x.getDate() + " " + month + " " + x.getFullYear();
}
getMonthNameShort(lang,month) {
getMonthNameShort(lang, month) {
lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month];
};
}
backgroundColor(statusName: string){
// {'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}
switch (statusName) {
case 'Submit':
return 'bg-blue-txt';
case 'Pending':
return 'bg-orange-txt';
case 'Not Doable' || 'Rejected':
return 'bg-red-txt';
default:
return 'bg-green-txt';
}
}
}

@ -1,19 +1,19 @@
<ion-header>
<ion-toolbar style="--background: #269DB8;">
<!-- <nav-buttons></nav-buttons> -->
<ion-title color="light">{{ 'vacation-rule, search-employee' | translate}}</ion-title>
<ion-buttons slot="primary">
<ion-button style="background: none !important;" (click)="closePage()">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<div style="padding: 0 10px;" [innerHTML]='"vacation-rule, replacement-employee-tip" | translate'></div>
<!-- <ion-item lines="none">
<ion-toolbar>
<!-- <nav-buttons></nav-buttons> -->
<ion-title>{{ 'worklistMain, delegate' | translate}}</ion-title>
<ion-buttons slot="primary">
<ion-button style="background: none !important;" (click)="closePage()">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content padding>
<!-- <div style="padding: 0 10px;" [innerHTML]='"vacation-rule, replacement-employee-tip" | translate'></div> -->
<!-- <ion-item lines="none">
<ion-label class="boldTxtNav">{{'vacation-rule, search-by' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="searchKeySelect">
@ -29,11 +29,11 @@
<ion-icon slot="icon-only" name="search"></ion-icon>
</ion-button>
</ion-item> -->
<ion-list>
<ion-list-header>
<ion-list>
<!-- <ion-list-header>
<ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label>
</ion-list-header>
<ion-radio-group [(ngModel)]="searchKeySelect">
@ -58,20 +58,62 @@
</ion-radio-group>
</ion-radio-group> -->
<ion-list-header>
<ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label>
</ion-list-header>
<ion-radio-group [(ngModel)]="searchKeySelect" (ionChange)="onChangeSelect($event)">
<ion-row class="top-radio-row" style="display: flex;">
<ion-item lines='none'>
<ion-radio mode="md" value="1" checked></ion-radio>
<ion-label class="radio-label">
<p class="textSearchType">{{'replacementRoll, workflow' | translate}}</p>
</ion-label>
</ion-item>
<ion-item lines='none'>
<ion-radio mode="md" value="4"></ion-radio>
<ion-label class="radio-label">
<p class="textSearchType">{{'replacementRoll, favorite' | translate}}</p>
</ion-label>
</ion-item>
<ion-item lines='none'>
<ion-radio mode="md" value="2"></ion-radio>
<ion-label class="radio-label">
<p class="textSearchType">{{'replacementRoll, employee-id' | translate}}</p>
</ion-label>
</ion-item>
<ion-item lines='none'>
<ion-radio mode="md" value="3"></ion-radio>
<ion-label class="radio-label">
<p class="textSearchType">{{'replacementRoll, employee-email' | translate}}</p>
</ion-label>
</ion-item>
<ion-item lines='none'>
<ion-radio mode="md" value="5"></ion-radio>
<ion-label class="radio-label">
<p class="textSearchType">{{'replacementRoll, employee-name' | translate}}</p>
</ion-label>
</ion-item>
</ion-row>
</ion-radio-group>
<ion-item lines="none" class="search-box" *ngIf='!isFilter && !userSelected'>
<ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'ltr'? 'filterInput':'filterInput-ar'"
[(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input>
<ion-item lines="none" class="search-box">
<ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input>
</ion-item>
<div *ngIf="isFilter && !userSelected">
<ion-searchbar class="filterClass" mode='md' (ionInput)="filterList($event)" placeholder="Filter">
</ion-searchbar>
</div>
</ion-list>
<!-- <ion-item>
<!-- <ion-item>
<ion-list [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
<ion-label><span class="boldTxt">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <br>{{employee.USER_NAME}}<br>
@ -80,8 +122,8 @@
</ion-item>
</ion-list>
</ion-item> -->
<!-- <ion-list>
<!-- <ion-list>
<ion-radio-group mode="md" [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
<ion-label><span class="boldTxt">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <br>{{employee.USER_NAME}}<br>
@ -91,85 +133,115 @@
</ion-radio-group>
</ion-list> -->
<div *ngIf="!userSelected">
<div *ngIf="ReplacementList.length>0" class="uk-margin">
<div *ngIf="ReplacementList.length>0" class="uk-margin">
{{'replacementRoll, search-result' | translate}}
</div>
<br/>
<br />
<!-- <ion-item lines="none"> -->
<div class="square-container" >
<div *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<!-- <br>{{employee.USER_NAME}}<br>
<div class="square-container">
<div *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep"
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep"
src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} -->
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
</div>
</ion-label>
<div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
</div>
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> -->
</div>
</div>
<!--
</ion-item> -->
</div>
<div [hidden]="isAnswer==true" *ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '4'">
</div>
<!-- related list -->
<div [hidden]="isAnswer==true"
*ngIf="relatedList?.length> 0 && !userSelected && ReplacementList?.length ==0 && searchKeySelect == '1'">
<div class="uk-margin">
{{'replacementRoll, favorite' | translate}}
{{'replacementRoll, related' | translate}}
</div>
<div class="square-container uk-padding">
<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"
[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">
<span>{{employee.Name}}</span>
</ion-label>
<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>
</div>
</div>
</div>
<div class="square-container uk-padding" >
<div (click)="select(employee,i)" *ngFor="let employee of favoriteUserList;let i=index;" class="square">
<div class="profileImageDiv">
<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">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
<!-- favorite list -->
<div [hidden]="isAnswer==true"
*ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '4'">
<div class="uk-margin">
{{'replacementRoll, favorite' | translate}}
</div>
<div class="square-container uk-padding">
<div (click)="select(employee,i)" *ngFor="let employee of favoriteUserList;let i=index;" class="square">
<div class="profileImageDiv">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep"
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<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 == 'ltr' ? 'star-fav' : 'star-fav-left'">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
</div>
</div>
</div>
<div *ngIf='messageSuccess' class="succssfullMSG">
<ion-col size="12">
<ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
</ion-col>
<ion-col size="12">
<div style="font-size: 30px !important"> Transaction Successful </div>
</ion-col>
</div>
</div>
<div *ngIf='messageSuccess' class="succssfullMSG">
<ion-col size="12">
<ion-icon class="succssfullIcon" name="checkmark"></ion-icon>
</ion-col>
<ion-col size="12"> <div style="font-size: 30px !important"> Transaction Successful </div> </ion-col>
</div>
</ion-content>
<ion-footer>
<ion-footer *ngIf="isAnswer== false && userSelected ==true">
<div class="noteInput">
<div class="noteInput" *ngIf="isAnswer== false && userSelected ==true">
<!-- <ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
<!-- <ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label> -->
<ion-item>
<ion-textarea [(ngModel)]="userNote" [placeholder]="'replacementRoll, enterNote' | translate"></ion-textarea>
</ion-item>
</div>
<br/>
<ion-item>
<ion-textarea [(ngModel)]="userNote" [placeholder]="'replacementRoll, enterNote' | translate"></ion-textarea>
</ion-item>
</div>
<br />
<!-- <div class="centerDiv">
<ion-button *ngIf="userSelected ==true" class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()">
{{'general, submit' | translate}}</ion-button>
@ -178,12 +250,16 @@
{{'general, cancel' | translate}}</ion-button>
</div> -->
</ion-footer>
<ion-footer *ngIf="userSelected ==true">
<div class="centerDiv">
<ion-button (click)="closePage()" class="footer-button" color="customnavy">{{'general, save' | translate}}
</ion-button>
</div>
</ion-footer>
<ion-footer>
<div class="centerDiv" *ngIf="userSelected ==true">
<ion-button [disabled]="saveBtnDisabled()" (click)="closePage()" class="footer-button" color="customnavy">{{'general, save' | translate}}
</ion-button>
</div>
<div class="centerDiv">
<ion-button (click)="closeFunction()" class="footer-button" color="customnavy">{{'general, close' | translate}}
</ion-button>
</div>
</ion-footer>

@ -30,7 +30,7 @@
margin: 10px;
}
.star-fav-left{
float: right;
float: left;
margin: 10px 5px;
}
.uk-margin{margin: 15px 15px 0px 15px;
@ -64,4 +64,217 @@
}
.top-radio-row{
font-size: 12px;
}
}
button.item-button.button.button-md.button-clear.button-clear-md {
background-color: transparent;
}
.footer-button {
background: #dbdbdb;
border-radius: 10px;
color: black;
--background: transparent;
font-weight: bold;
width: 75%;
}
// ion-item {
// margin-top: 5%;
// margin-right: 7%;
// width: 100%;
// }
.ionItem{
border: #e4e4e4 solid;
/* margin: 6px; */
/* padding: 11px; */
height: 85px;
width: 164px;
border-radius: 5px;
text-align: center;
}
.profileImageDiv{
z-index: 3;
position: relative;
top: 0;
}
.profileImage{
width:60px !important;
}
.activated{
border: #209a83 0.02cm solid ;
}
.deactivated{ border: #e4e4e4 0.02cm solid;
}
.repContentDiv{
text-align: center;
width: 85%;
font-size: 14px;
border: #e4e4e4 solid;
border-radius: 5px;
padding: 20px 8px 8px 8px;
margin-top: -9px;
margin-right: -35px
}
.selIEmpDiv{
text-align: right;
margin-bottom: -26px;
margin-right: 0px;
z-index: 3;
position: relative;
top: 0;
}
.selIEmpImage{
width:22px !important
}
.noteInput{
border: solid var(--gray) 1px;
border-radius: 15px;
margin: 8px 17px 0px 17px;
padding: 10px 2px 10px 2px;
}
.filterInput{
border: solid var(--gray) 1px;
border-radius: 21px;
padding-left: 10px !important;
}
.filterInput-ar{
// border: solid var(--gray) 1px;
// border-radius: 21px;
// padding-left: 10px !important;
border: solid var(--gray) 1px;
border-radius: 21px;
// width:250px
// padding-left: 145px !important;
//margin-left: 123px;
// padding-right: 129px;
//margin-right: -136px;
}
.filterBtn{
background: var(--newgreen);
--background: var (--newgreen);
border-radius: 50%;
height: 60px;
width: 60px;
}
.filterBtn-ar{
// background: var(--newgreen);
// --background: var (--newgreen);
// border-radius: 50%;
// height: 60px;
// width: 60px;
background: var(--newgreen);
--background: var (--newgreen);
border-radius: 50%;
height: 60px;
width: 60px;
margin-left: -183px;
margin-right: 260px;
}
*{
box-sizing: border-box;
}
.square-container{
// padding: 8px;
width:100%;
}
.square{
// width:calc(100% / 2);
width:100%;
float:left;
position: relative;
// padding-bottom: calc(100% / 2);
}
.square .content{
width: calc(100% - 16px) !important;
height: calc(100% - 16px) !important;
margin: 8px;
padding: 16px;
// position: absolute;
color: white;
border-radius: 9px;
text-align: center;
min-height: 92px;
// background-color: #0095ff;
// box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
}
.disabledButton{
opacity:.5;
}
.radio-label{
font-size: 9px;
margin: 4px;
position: relative;
bottom: 4px;
}
ion-radio{
--color-checked: #269db8;
}
.center{text-align: center;padding: 5px;}
.boldTxtNav{
font-weight: bold;
padding: 5px;
}
.employee-details{
display:inline-block;
margin: 10px;
text-overflow: ellipsis;
white-space: nowrap;
width: 70%;
}
.empImgeRep{
display: inline-block;
height: 40px;
width: 40px;
}
.star-fav{
float: right;
margin: 15px 0px 0px 0px;
}
.uk-margin{margin: 15px 15px 0px 15px;
font-weight: bold;
clear: both;
position: relative;
top: 10px;}
.uk-padding{ padding: 20px;}
.uk-padding .employee-details{
bottom: 10px;
position: relative;}
// .star-fav-left{
// float: left;
// margin: 10px 5px;
// }
.top-radio-row{
font-size: 12px;
display: block;
padding-bottom: 25px;
padding-top: 15px;
}
.textSearchType{
padding-top: 8px;
font-size: 12px;
}

@ -33,19 +33,42 @@ export class WorkListReplacementItgComponent implements OnInit {
userSelected: any;
active: any;
isAnswer: boolean = false;
favoriteUserList: [] = [];
favoriteUserList = [];
userNote: any;
isFilter = true;
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();
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);
}
}
SearchReplacementList() {
@ -124,6 +147,7 @@ export class WorkListReplacementItgComponent implements OnInit {
// }
closePage() {
console.log(this.selEmp);
this.isSave = true;
let data: any = null;
if (this.isSave == true) {
@ -145,12 +169,32 @@ export class WorkListReplacementItgComponent implements OnInit {
}
}
closeFunction() {
this.modalController.dismiss({
'dismissed': true,
// comments: this.userNote
});
}
onChangeSelect(select) {
console.log(select.detail.value);
let selectValue = select.detail.value;
if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
this.searchKey = '';
if (selectValue == "1") {
this.listOfRealted = this.relatedList;
console.log(this.relatedList);
this.isSelect = true;
this.isFilter = true;
this.ReplacementList = [];
} else if (selectValue == "4") {
this.listOfFav = this.favoriteUserList;
this.isFilter = true;
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;
}
else {
this.isSelect = false;
@ -170,11 +214,10 @@ export class WorkListReplacementItgComponent implements OnInit {
}, 3000);
}
select(selectEmp, index) {
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp = selectEmp
this.userSelected = true;
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;
//this.closePage();
}
@ -241,7 +284,44 @@ export class WorkListReplacementItgComponent implements OnInit {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
console.log(this.favoriteUserList);
}
})
}
listOfRealted = [];
listOfFav = []
filterList(event) {
const val = event.target.value;
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 === '') {
this.favoriteUserList = this.listOfFav;
} else {
this.favoriteUserList = this.listOfFav.filter((item) => {
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
});
}
} 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; }
}
}

@ -1117,6 +1117,6 @@ export class WorklistMainComponent implements OnInit {
getMonthNameShort(lang,month) {
lang = lang && (lang in this.locale) ? lang : 'en';
return this.locale[lang].month_names_short[month];
};
}
}

@ -36,9 +36,12 @@ export class OfferDetailsComponent implements OnInit {
}
share() {
console.log(this.details);
const offerMessage = this.direction === 'ltr' ? this.details.Description : this.details.Description_AR;
const offerSubject = this.direction === 'ltr' ? this.details.Title : this.details.Title_AR;
const options = {
message: this.stripHtml(this.details.Description),
subject: this.stripHtml(this.details.Title),
message: this.stripHtml(offerMessage),
subject: this.stripHtml(offerSubject),
files: [this.details.Banner_Image]
}
this.socialSharing.shareWithOptions(options).then((result) => {

Loading…
Cancel
Save