fixing design issues in bussines card for all mobile type, favorite issues fixed in worklist and itg worklist

MOHEMM-Q3-DEV-LATEST
enadhilal 4 years ago
parent 4ce2fb486a
commit 00ef78271c

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

@ -287,7 +287,9 @@ export class AppComponent implements OnInit {
return await modal.present(); return await modal.present();
} }
async openBusinessCard() { 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({ const modal = await this.modalController.create({
component: BusinessCardComponent, component: BusinessCardComponent,
cssClass: 'digital-id-modal-css', cssClass: 'digital-id-modal-css',

@ -1,11 +1,12 @@
<ion-content dir="ltr" *ngIf="userInfo.company_type == 'CS'"> <ion-content dir="ltr" *ngIf="false">
<ion-grid style="transform: rotate(90deg); padding: 20px;"> <!-- <ion-content dir="ltr" *ngIf="userInfo.company_type == 'CS'"> -->
<ion-grid class="card-size">
<ion-row> <ion-row>
<ion-col size='6'> <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>
<ion-col size='6'> <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-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
@ -16,8 +17,7 @@
</ion-col> </ion-col>
<ion-col size='6'> <ion-col size='6'>
<ion-label> <ion-label>
<h1 class='font-text-style' <h1 class='font-text-style name-ar-style'>{{userInfo.name_ar}}</h1>
style="font-size: 25px !important; position: relative; left: 314px; text-align: end; padding: 10px; width: 225px;">{{userInfo.name_ar}}</h1>
</ion-label> </ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
@ -63,17 +63,17 @@
</div> </div>
</ion-footer> --> </ion-footer> -->
<ion-content dir="ltr" *ngIf="true">
<ion-content dir="ltr" *ngIf="userInfo.company_type != 'CS'"> <!-- <ion-content dir="ltr" *ngIf="userInfo.company_type != 'CS'"> -->
<ion-grid style="transform: rotate(90deg); padding: 25px;"> <ion-grid class="cs-card-size">
<ion-row> <ion-row>
<ion-col style="padding-left: 315px;"> <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-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <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-col> <ion-col>
<ion-label> <ion-label>

@ -34,4 +34,200 @@
font-weight: bold; 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 public common: CommonService
) { } ) { }
ngOnInit() {} ngOnInit() {
console.log(this.userInfo);
}
dismiss() { dismiss() {

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

@ -103,7 +103,8 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.logintype= localStorage.getItem("login-type"); this.logintype= localStorage.getItem("login-type");
this.lastLoginDate= localStorage.getItem("login-at"); this.lastLoginDate= localStorage.getItem("login-at");
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); 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) { if (this.employee) {
this.getEmpSubordinate(userID); this.getEmpSubordinate(userID);
// this.isFavorite = false; // this.isFavorite = false;
this.getFavorit(); // this.getFavorit();
this.isFavorite = this.employee.IsFavorite;
} }
} }

@ -614,6 +614,8 @@ export class HomeComponent implements OnInit {
Count() { Count() {
const datas = []; const datas = [];
const names = []; const names = [];
this.ITGSegment = [];
this.ITGItem = [];
this.workListService.getITGCount('', '', this.isPostNoLoad) this.workListService.getITGCount('', '', this.isPostNoLoad)
.subscribe((result: any) => { .subscribe((result: any) => {
if (result.RequestType.length > 0) { 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 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.request_info.ItemID === this.all_request_names[i].data[j].ItemID) {
this.index2 = j + 1; 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 if (this.all_request_names[i].data.length !== this.index2) {// if there is another request with same type
this.clearDataArray(); this.clearDataArray();
this.changeITGForm(this.all_request_names[i].data[this.index2], this.all_request_names[i].code); this.changeITGForm(this.all_request_names[i].data[this.index2], this.all_request_names[i].code);
return false; 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.clearDataArray();
this.changeITGForm(this.all_request_names[this.index].data[0], this.all_request_names[this.index].code); this.changeITGForm(this.all_request_names[this.index].data[0], this.all_request_names[this.index].code);
return false; return false;

@ -150,15 +150,20 @@
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE"> [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep" <img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep"
src="../assets/imgs/profile.png"> 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> <span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<!-- <br>{{employee.USER_NAME}}<br> <!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} --> {{employee.EMAIL_ADDRESS}} -->
</ion-label> </ion-label>
<div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'" (click)="setFavorite(employee)"> <div *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
<img src="assets/imgs/fav.svg" /> (click)="setFavorite(employee)">
</div> <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>
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>
@ -174,26 +179,31 @@
</div> </div>
<div class="square-container uk-padding"> <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"> <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 || 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>{{employee.Name}}</span> <span (click)="select(employee,i)">{{employee.Name}}</span>
</ion-label> </ion-label>
<div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'"> <div *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
<img [src]="isfavEmp(employee)? 'assets/imgs/fav filled.svg':'assets/imgs/fav.svg' " /> (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>
</div> </div>
</div> </div>
</div> </div>
<!-- favorite list --> <!-- 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'">
@ -202,20 +212,26 @@
</div> </div>
<div class="square-container uk-padding"> <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"> <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 || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep" src="../assets/imgs/profile.png"> <img *ngIf="employee.EMPLOYEE_IMAGE == null || employee.EMPLOYEE_IMAGE == ''" class="empImgeRep"
<ion-label class="employee-details"> 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> </ion-label>
<div [ngClass]="direction == 'ltr' ? 'star-fav' : 'star-fav-left'"> <div *ngIf='!employee.IsFavorite' [ngClass]="direction == 'en' ? 'star-fav-left':'star-fav'"
<img src="assets/imgs/fav filled.svg" /> (click)="setFavorite(employee)">
</div> <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> </div>
@ -255,7 +271,8 @@
<ion-footer> <ion-footer>
<div class="centerDiv" *ngIf="userSelected ==true"> <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> </ion-button>
</div> </div>
<div class="centerDiv"> <div class="centerDiv">

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

@ -24,23 +24,33 @@
<ion-row class="top-radio-row" style="display: flex;"> <ion-row class="top-radio-row" style="display: flex;">
<ion-item lines='none'> <ion-item lines='none'>
<ion-radio mode="md" value="1" checked></ion-radio> <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>
<ion-item lines='none'> <ion-item lines='none'>
<ion-radio mode="md" value="4"></ion-radio> <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>
<ion-item lines='none'> <ion-item lines='none'>
<ion-radio mode="md" value="2"></ion-radio> <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>
<ion-item lines='none'> <ion-item lines='none'>
<ion-radio mode="md" value="3"></ion-radio> <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>
<ion-item lines='none'> <ion-item lines='none'>
<ion-radio mode="md" value="5"></ion-radio> <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-item>
</ion-row> </ion-row>
</ion-radio-group> </ion-radio-group>
@ -76,8 +86,7 @@
</div> </div>
<!-- <div [hidden]="isAnswer==true" <!-- <div [hidden]="isAnswer==true"
*ngIf="actionHistory.length >0 && !userSelected && ReplacementList.length==0 && searchBy === '1'"> --> *ngIf="actionHistory.length >0 && !userSelected && ReplacementList.length==0 && searchBy === '1'"> -->
<div [hidden]="isAnswer==true" <div [hidden]="isAnswer==true" *ngIf="actionHistory.length >0 && !userSelected && searchBy === '1'">
*ngIf="actionHistory.length >0 && !userSelected && searchBy === '1'">
<div class="uk-margin"> <div class="uk-margin">
{{'replacementRoll, related' | translate}} {{'replacementRoll, related' | translate}}
</div> </div>
@ -94,10 +103,12 @@
<span (click)="select(employee,i)">{{employee.NAME}}</span> <span (click)="select(employee,i)">{{employee.NAME}}</span>
</ion-label> </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" /> <img src="assets/imgs/fav.svg" />
</div> </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" /> <img src="assets/imgs/fav filled.svg" />
</div> </div>
</div> </div>
@ -108,9 +119,8 @@
<br /> <br />
<!-- <div [hidden]="isAnswer==true" <!-- <div [hidden]="isAnswer==true"
*ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchBy == '4'"> --> *ngIf="favoriteUserList.length> 0 && !userSelected && ReplacementList.length ==0 && searchBy == '4'"> -->
<div [hidden]="isAnswer==true" <div [hidden]="isAnswer==true" *ngIf="favoriteUserList.length >0 && !userSelected && searchBy === '4'">
*ngIf="favoriteUserList.length >0 && !userSelected && searchBy === '4'"> <div class="uk-margin">
<div class="uk-margin">
{{'replacementRoll, favorite' | translate}} {{'replacementRoll, favorite' | translate}}
</div> </div>
@ -127,7 +137,12 @@
<span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <span (click)="select(employee,i)">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
</ion-label> </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" /> <img src="assets/imgs/fav filled.svg" />
</div> </div>
</div> </div>
@ -150,7 +165,7 @@
<div class="square-container"> <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"> <div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> --> <!-- <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"> <img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
<ion-label class="employee-details"> <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> <!-- <br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}} --> {{employee.EMAIL_ADDRESS}} -->
</ion-label> </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" /> <img src="assets/imgs/fav.svg" />
</div> </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> </div>
@ -209,7 +229,7 @@
(click)="submitAction()"> (click)="submitAction()">
{{'general, submit' | translate}}</ion-button> {{'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 style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button
(click)="submitAction()"> (click)="submitAction()">
{{'general, submit' | translate}}</ion-button> {{'general, submit' | translate}}</ion-button>

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Loading…
Cancel
Save