Merge branch 'enad-Q3' into MOHEMM-HUAWEI-RELEASE

MOHEMM-SFH-COLORS
umasoodch 4 years ago
commit 948a83aa38

@ -76,7 +76,7 @@
</ion-label>
</ion-item>
<ion-item *ngIf='userInfo?.show_business' (click)="openBusinessCard()">
<ion-item (click)="openBusinessCard()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/business-card-design.png" item-left>
</ion-thumbnail>
@ -175,7 +175,7 @@
</ion-label>
</ion-item>
<ion-item *ngIf='userInfo?.show_business' (click)="openBusinessCard()">
<ion-item (click)="openBusinessCard()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/business-card-design.png" item-left>
</ion-thumbnail>

@ -287,7 +287,9 @@ export class AppComponent implements OnInit {
return await modal.present();
}
async openBusinessCard() {
this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false);
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log(this.userInfo);
//this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false);
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css',

@ -1,11 +1,12 @@
<ion-content dir="ltr" *ngIf="userInfo.company_type == 'CS'">
<ion-grid style="transform: rotate(90deg); padding: 20px;">
<ion-content dir="ltr" *ngIf="false">
<!-- <ion-content dir="ltr" *ngIf="userInfo.company_type == 'CS'"> -->
<ion-grid class="card-size">
<ion-row>
<ion-col size='6'>
<img style="width: 120px;" [src]='userInfo.company_logo' alt="https://hmgwebservices.com/images/Moheem/CS.jpg"/>
<img class="logo-img-style" [src]='userInfo.company_logo' alt="https://hmgwebservices.com/images/Moheem/CS.jpg"/>
</ion-col>
<ion-col size='6'>
<img style="width: 130px;margin-top: 0px;position: relative;left: 410px;" [src]="userInfo.qr"/>
<img class="qr-style" [src]="userInfo.qr"/>
</ion-col>
</ion-row>
<ion-row>
@ -16,8 +17,7 @@
</ion-col>
<ion-col size='6'>
<ion-label>
<h1 class='font-text-style'
style="font-size: 25px !important; position: relative; left: 314px; text-align: end; padding: 10px; width: 225px;">{{userInfo.name_ar}}</h1>
<h1 class='font-text-style name-ar-style'>{{userInfo.name_ar}}</h1>
</ion-label>
</ion-col>
</ion-row>
@ -63,17 +63,17 @@
</div>
</ion-footer> -->
<ion-content dir="ltr" *ngIf="userInfo.company_type != 'CS'">
<ion-grid style="transform: rotate(90deg); padding: 25px;">
<ion-content dir="ltr" *ngIf="true">
<!-- <ion-content dir="ltr" *ngIf="userInfo.company_type != 'CS'"> -->
<ion-grid class="cs-card-size">
<ion-row>
<ion-col style="padding-left: 315px;">
<img style="width: 380px; position: fixed; left: 340; height: 81px;" [src]='userInfo.company_logo' alt="../assets/imgs/HMG_LOGO.png"/>
<img class="logo-img-hmg-style" [alt]='userInfo.company_logo' src="../assets/icon/HMG_LOGO.png"/>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<img style="width: 130px;margin-top: 0px;position: relative;left: 560px; top: 160px;" [src]="userInfo.qr"/>
<img class="qr-img-hmg-style" [src]="userInfo.qr"/>
</ion-col>
<ion-col>
<ion-label>

@ -34,4 +34,200 @@
font-weight: bold;
}
@media screen and (min-width: 400px)and (min-height:800px) and (max-height: 900px) {
// CS
.card-size{
transform: rotate(90deg) !important;
padding: 10px !important;
padding-right: 0px !important;
}
.qr-style{
left: 410px !important;
}
.name-ar-style{
left: 320px !important;
}
// HMG
.logo-img-hmg-style{
left: 360px !important;
}
.qr-img-hmg-style{
left: 580px !important;
}
}
@media screen and (min-width: 400px) and (min-height:700px) and (max-height: 799px){
// CS
.card-size{
transform: rotate(90deg) !important;
padding: 10px !important;
padding-right: 0px !important;
}
.qr-style{
left: 324px !important;
}
.name-ar-style{
left: 230px !important;
}
// HMG
.logo-img-hmg-style{
left: 275px !important;
}
.qr-img-hmg-style{
left: 495px !important;
}
}
@media screen and (min-width: 325px) and (max-width:399px) and (max-height: 812px){
// CS
.card-size{
transform: rotate(90deg) !important;
padding: 5px !important;
padding-right: 0px !important;
}
.qr-style{
left: 400px !important;
}
.name-ar-style{
left: 310px !important;
}
// HMG
.logo-img-hmg-style{
left: 360px !important;
}
.qr-img-hmg-style{
left: 550px !important;
}
}
@media screen and (min-width: 325px) and (max-width:399px) and (max-height: 700px){
.card-size{
transform: rotate(90deg) !important;
padding: 5px !important;
padding-right: 0px !important;
}
.qr-style{
left: 280px !important;
}
.name-ar-style{
left: 190px !important;
}
// HMG
.logo-img-hmg-style{
left: 360px !important;
}
.qr-img-hmg-style{
left: 550px !important;
}
}
@media screen and (min-width: 325px) and (max-width:399px) and (max-height: 699px){
.card-size{
transform: rotate(90deg) !important;
padding: 5px !important;
padding-right: 0px !important;
}
.qr-style{
left: 280px !important;
}
.name-ar-style{
left: 190px !important;
}
// HMG
.logo-img-hmg-style{
left: 245px !important;
}
.qr-img-hmg-style{
left: 430px !important;
}
}
@media screen and (min-width: 1px) and (max-width:320px) {
.card-size{
transform: rotate(90deg) !important;
position: relative;
bottom: 30px;
left: 26px;
}
.qr-style{
width: 80px !important;
margin-top: 50px !important;
position: relative !important;
left: 265px !important;
}
.name-ar-style{
font-size: 15px !important;
position: relative !important;
left: 130px !important;
text-align: end !important;
padding: 10px !important;
width: 225px !important;
}
.logo-img-style{
width: 80px !important;
margin-top: 50px !important;
}
// HMG
.logo-img-hmg-style{
width: 380px !important;
position: fixed !important;
left: 200px !important;
height: 81px !important;
bottom: 205px !important;
}
.qr-img-hmg-style{
width: 105px !important;
margin-top: 0px !important;
position: relative !important;
left: 390px !important;
top: 160px !important;
}
.cs-card-size{
padding: 15px !important;
padding-top: 0px !important;
padding-left: 1px !important;
}
}
.card-size{
transform: rotate(90deg);
}
.qr-style{
width: 130px;
margin-top: 0px;
position: relative;
left: 410px;
}
.name-ar-style{
font-size: 25px;
position: relative;
left: 314px;
text-align: end;
padding: 10px;
width: 225px;
}
.logo-img-style{
width: 120px;
}
.logo-img-hmg-style{
width: 380px;
position: fixed;
left: 340;
height: 81px;
}
.qr-img-hmg-style{
width: 130px;
margin-top: 0px;
position: relative;
left: 560px;
top: 160px;
}
.cs-card-size{
transform: rotate(90deg);
padding: 25px;
}

@ -18,7 +18,9 @@ export class BusinessCardComponent implements OnInit {
public common: CommonService
) { }
ngOnInit() {}
ngOnInit() {
console.log(this.userInfo);
}
dismiss() {

@ -215,10 +215,10 @@ export class SmsPageComponent implements OnInit {
// Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
// console.log('enad test');
// console.log(this.businessInfo.toString());
// localStorage.setItem('bussines-card-info', this.businessInfo.toString());
this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');
console.log('ENAD');
console.log(JSON.stringify(this.businessInfo));
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
// this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');
AuthenticationService.servicePrivilage = result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => {

@ -103,7 +103,8 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.logintype= localStorage.getItem("login-type");
this.lastLoginDate= localStorage.getItem("login-at");
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);
this.userBusiness = JSON.parse(localStorage.getItem('bussiness-card-info'));
// this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);

@ -541,7 +541,8 @@ export class DetailsComponent implements OnInit {
if (this.employee) {
this.getEmpSubordinate(userID);
// this.isFavorite = false;
this.getFavorit();
// this.getFavorit();
this.isFavorite = this.employee.IsFavorite;
}
}

@ -614,6 +614,8 @@ export class HomeComponent implements OnInit {
Count() {
const datas = [];
const names = [];
this.ITGSegment = [];
this.ITGItem = [];
this.workListService.getITGCount('', '', this.isPostNoLoad)
.subscribe((result: any) => {
if (result.RequestType.length > 0) {

@ -200,12 +200,13 @@ export class WorkListMainItgComponent implements OnInit {
if (this.request_info.ID === this.all_request_names[i].data[j].ID
&& this.request_info.ItemID === this.all_request_names[i].data[j].ItemID) {
this.index2 = j + 1;
this.index = i + 1;
if (this.all_request_names[i].data.length !== this.index2) {// if there is another request with same type
this.clearDataArray();
this.changeITGForm(this.all_request_names[i].data[this.index2], this.all_request_names[i].code);
return false;
} else if (this.index !== this.all_request_names.length) { // if there is another deffernet type.
}
this.index = i + 1;
if (this.index !== this.all_request_names.length) { // if there is another deffernet type.
this.clearDataArray();
this.changeITGForm(this.all_request_names[this.index].data[0], this.all_request_names[this.index].code);
return false;

@ -150,15 +150,20 @@
[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">
<ion-label style="white-space: pre-wrap;" 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 == 'ltr' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
<div *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
<div *ngIf='employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
@ -174,26 +179,31 @@
</div>
<div class="square-container uk-padding">
<div (click)="select(employee,i)" *ngFor="let employee of relatedList;let i=index;" class="square">
<div *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">
<img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE === ''" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label style="white-space: pre-wrap;" class="employee-details">
<span>{{employee.Name}}</span>
<span (click)="select(employee,i)">{{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 *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
<div *ngIf='employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
</div>
</div>
</div>
</div>
<!-- favorite list -->
<div [hidden]="isAnswer==true"
*ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '4'">
@ -202,20 +212,26 @@
</div>
<div class="square-container uk-padding">
<div (click)="select(employee,i)" *ngFor="let employee of favoriteUserList;let i=index;" class="square">
<div *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">
<img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep"
src="../assets/imgs/profile.png">
<ion-label style="white-space: pre-wrap;" class="employee-details">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<span (click)="select(employee,i)">{{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 *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
<div *ngIf='employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
</div>
</div>
@ -255,7 +271,8 @@
<ion-footer>
<div class="centerDiv" *ngIf="userSelected ==true">
<ion-button [disabled]="saveBtnDisabled()" (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">

@ -58,14 +58,17 @@ export class WorkListReplacementItgComponent implements OnInit {
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) {
let lookupObject = {};
// tslint:disable-next-line: forin
for (const i in this.arr) {
lookupObject[this.arr[i]['Name']] = this.arr[i];
}
for (i in lookupObject) {
// tslint:disable-next-line: forin
for (const i in lookupObject) {
this.relatedList.push(lookupObject[i]);
}
}
this.getFavruite();
} else {
this.select(this.delegtedEmp, 1);
}
@ -128,6 +131,8 @@ export class WorkListReplacementItgComponent implements OnInit {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.ReplacementList)) {
this.ReplacementList = result.ReplacementList;
console.log("___________________________________")
console.log(this.ReplacementList);
this.P_PAGE_NUM++;
let lastItemIndex = this.ReplacementList.length - 1;
if (result.ReplacementList[lastItemIndex]) {
@ -189,9 +194,9 @@ export class WorkListReplacementItgComponent implements OnInit {
this.listOfFav = this.favoriteUserList;
this.isFilter = true;
this.ReplacementList = [];
if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined){
this.getFavruite();
}
// if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined){
this.getFavruite();
// }
} else if (selectValue === '2' || selectValue === '3' || selectValue === '5') {
this.isSelect = true;
this.isFilter = false;
@ -223,56 +228,69 @@ export class WorkListReplacementItgComponent implements OnInit {
setFavorite(selEmp) {
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
var confirmBoxhtml = `<div>
<h4>Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
console.log(selEmp);
let name = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.Name;
let userImg = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
let userEmail = selEmp.Email ? selEmp.Email : selEmp.EMAIL_ADDRESS;
let userID = selEmp.EmployeeID ? selEmp.EmployeeID : selEmp.USER_NAME;
console.log(name)
console.log(userImg)
console.log(userEmail)
let confirmBoxhtml = `<div>
<h4>Do you want to add ` + name + ` in your favorite list </h4>
<br/>
<br/>
<div class="fav-profileImageDiv"><ion-row>`;
if (selEmp.EMPLOYEE_IMAGE)
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>';
if (!selEmp.EMPLOYEE_IMAGE)
if (userImg) {
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + userImg + '"></div>';
}
if (!userImg) {
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="../assets/imgs/profile.png"></div>';
}
confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
<span>` + name + `</span></ion-label></div></ion-row> </div></div>`;
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
</ion-label>
</div></ion-row> </div>
</div>`
let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
if (userIndex == -1)
const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === userID);
console.log(userIndex);
if (userIndex === -1) {
selEmp.IsFavorite = !selEmp.IsFavorite;
this.cs.presentConfirmDialog(
confirmBoxhtml
, () => {
var request =
[{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
const request =
[
{
'USER_NAME': userID,
"EMPLOYEE_DISPLAY_NAME": name,
"EMAIL_ADDRESS": userEmail,
"EMPLOYEE_IMAGE": userImg,
"IsFavorite": selEmp.IsFavorite
}
];
this.saveUserFavruiteList(request);
}, () => {
})
// if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
// this.isSelect = true;
// }
// else {
// this.isSelect = false;
// }
});
} else {
selEmp.IsFavorite = false;
const request =
[
{
'USER_NAME': userID,
"EMPLOYEE_DISPLAY_NAME": name,
"EMAIL_ADDRESS": userEmail,
"EMPLOYEE_IMAGE": userImg,
"IsFavorite": false
}
];
this.saveUserFavruiteList(request);
}
}
saveUserFavruiteList(request) {
this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => {
if (this.cs.validResponse(result)) {
this.cs.toastPK("replacementRoll", "favorite-saved");
}
})
}
@ -284,13 +302,24 @@ export class WorkListReplacementItgComponent implements OnInit {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
console.log(this.favoriteUserList);
this.favoriteUserList.forEach((obj) => {
obj.IsFavorite = true;
});
this.relatedList.forEach((obj) => {
if (this.favoriteUserList.some(x => x.USER_NAME === obj.EmployeeID)) {
obj.IsFavorite = true;
} else {
obj.IsFavorite = false;
}
});
console.log('enad test');
console.log(this.relatedList);
}
})
});
}
listOfRealted = [];
listOfFav = []
listOfFav = [];
filterList(event) {
const val = event.target.value;

@ -24,23 +24,33 @@
<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-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-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-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-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-label class="radio-label">
<p class="textSearchType">{{'replacementRoll, employee-name' | translate}}</p>
</ion-label>
</ion-item>
</ion-row>
</ion-radio-group>
@ -76,8 +86,7 @@
</div>
<!-- <div [hidden]="isAnswer==true"
*ngIf="actionHistory.length >0 && !userSelected && ReplacementList.length==0 && searchBy === '1'"> -->
<div [hidden]="isAnswer==true"
*ngIf="actionHistory.length >0 && !userSelected && searchBy === '1'">
<div [hidden]="isAnswer==true" *ngIf="actionHistory.length >0 && !userSelected && searchBy === '1'">
<div class="uk-margin">
{{'replacementRoll, related' | translate}}
</div>
@ -94,10 +103,12 @@
<span (click)="select(employee,i)">{{employee.NAME}}</span>
</ion-label>
<div *ngIf='!employee.isInFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<div *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
<div *ngIf='employee.isInFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)">
<div *ngIf='employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
@ -108,9 +119,8 @@
<br />
<!-- <div [hidden]="isAnswer==true"
*ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchBy == '4'"> -->
<div [hidden]="isAnswer==true"
*ngIf="favoriteUserList.length >0 && !userSelected && searchBy === '4'">
<div class="uk-margin">
<div [hidden]="isAnswer==true" *ngIf="favoriteUserList.length >0 && !userSelected && searchBy === '4'">
<div class="uk-margin">
{{'replacementRoll, favorite' | translate}}
</div>
@ -127,7 +137,12 @@
<span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
</ion-label>
<div [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'">
<div *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
<div *ngIf='employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
@ -150,7 +165,7 @@
<div class="square-container">
<div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
@ -159,13 +174,18 @@
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details">
<span>{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<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'">
<div *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav.svg" />
</div>
<div *ngIf='employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav' : 'star-fav-left'"
(click)="setFavorite(employee)">
<img src="assets/imgs/fav filled.svg" />
</div>
</div>
@ -209,7 +229,7 @@
(click)="submitAction()">
{{'general, submit' | translate}}</ion-button>
<ion-button *ngIf="isAnswer" class="footer-button"
<ion-button *ngIf="isAnswer" class="footer-button"
style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button
(click)="submitAction()">
{{'general, submit' | translate}}</ion-button>

@ -47,7 +47,7 @@ export class WorkListReplacementRollComponent implements OnInit {
userSelected: boolean;
actionHistory = [];
arr = [];
favoriteUserList: [] = [];
favoriteUserList: any = [];
isFilter = true;
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
this.P_PAGE_NUM = 1;
@ -488,8 +488,10 @@ export class WorkListReplacementRollComponent implements OnInit {
this.cs.stopLoading();
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
this.listOfFav = this.favoriteUserList;
/**** THIS CODE TO CHECK STAR OF EMPLOYEE IF THE IT IS IN FAVOORIT LIST AND SHOW IN WORKFLOW LIST****/
this.favoriteUserList.forEach((obj) => {
obj.IsFavorite = true;
});
/**** THIS CODE TO CHECK STAR OF EMPLOYEE IF IT IS IN FAVORITE LIST AND SHOW IN WORKFLOW LIST****/
// this.actionHistory.forEach((obj, i) => {
// if(this.favoriteUserList.some(x => x['USER_NAME'] === obj.USER_NAME)) {
// this.actionHistory[i].isInFavorite = true;
@ -517,6 +519,7 @@ export class WorkListReplacementRollComponent implements OnInit {
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
selEmp.IsFavorite = !selEmp.IsFavorite;
if (this.favoriteUserList.some(x => x['USER_NAME'] === selEmp.USER_NAME)) {
let confirmBoxhtml = `<div>
<h4>Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
@ -547,12 +550,24 @@ export class WorkListReplacementRollComponent implements OnInit {
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
'IsFavorite': true
'IsFavorite': selEmp.IsFavorite
}
];
this.saveUserFavruiteList(request);
}, () => { });
} else {
const request =
[
{
'USER_NAME': selEmp['USER_NAME'],
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
'IsFavorite': false
}
];
this.saveUserFavruiteList(request);
}
} else {
const request =
@ -565,10 +580,11 @@ export class WorkListReplacementRollComponent implements OnInit {
'IsFavorite': false
}
];
this.saveUserFavruiteList(request);
this.saveUserFavruiteList(request);
}
}
listOfRealted: any = [];
listOfFav: any = [];

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Loading…
Cancel
Save