fixed business card issues

MOHEMM-HUAWEI-RELEASE
umasoodch 4 years ago
parent f2232c544a
commit bc9c5e9deb

@ -5,19 +5,19 @@
<ion-content padding>
<div [ngClass]=" direction === 'en' ? 'custom-text-area-element Field-en' : 'custom-text-area-element Field-ar'" >
<!-- <div [ngClass]=" direction === 'en' ? 'custom-text-area-element Field-en' : 'custom-text-area-element Field-ar'" >
<label class="label" position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </label>
<select class="label-Select" [(ngModel)]="absenceType" (change)="onTypeAbsenceChange()" required>
<option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </option>
</select>
</div>
<!-- <ion-item class='dynamicField'>
</div> -->
<ion-item class='dynamicField'>
<ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','absenceType')}} </ion-label>
<ion-select (ionChange)="calcDay()" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required> -->
<ion-select (ionChange)="calcDay()" okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" [(ngModel)]="absenceType" (ionChange)="onTypeAbsenceChange()" required>
<!-- let item of AbsenceType; let i=index; -->
<!-- <ion-select-option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </ion-select-option>
<ion-select-option value= "{{item.ABSENCE_ATTENDANCE_TYPE_ID}}" *ngFor="let item of absenceTypeList; let i=index;">{{item.ABSENCE_ATTENDANCE_TYPE_NAME}} </ion-select-option>
</ion-select>
</ion-item> -->
</ion-item>
<ion-item class='dynamicField'>
<ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','startDate')}} </ion-label>

@ -1,6 +1,6 @@
<ion-app [dir]="direction">
<ion-split-pane>
<ion-menu side='start' *ngIf="direction ==='ltr'">
<ion-menu [swipeGesture]="false" side='start' *ngIf="direction ==='ltr'">
<ion-content class="sidebar-menu">
<div class="header-div">
<div>
@ -99,7 +99,7 @@
</ion-content>
</ion-menu>
<ion-menu side='end' *ngIf="direction ==='rtl'">
<ion-menu [swipeGesture]="false" side='end' *ngIf="direction ==='rtl'">
<ion-content class="sidebar-menu">
<div class="header-div">
<div>

@ -150,7 +150,9 @@ export class AppComponent implements OnInit {
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
console.log(user);
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log('ENAD TEST')
console.log(this.userInfo)
localStorage.setItem("digitalIDUser", JSON.stringify(user));
this.digitalIDUser = user//JSON.stringify(user);
this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png';
@ -287,7 +289,7 @@ export class AppComponent implements OnInit {
return await modal.present();
}
async openBusinessCard() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
// 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({

@ -11,7 +11,7 @@
<ion-row>
<ion-col size='6'>
<ion-label>
<h1 class='font-text-style' style="font-size: 25px !important; width: 400px;">{{userInfo.name_en}}</h1>
<h1 class='font-text-style' style="font-size: 20px !important; width: 200%;">{{userInfo.name_en}}</h1>
</ion-label>
</ion-col>
<ion-col size='6'>

@ -38,14 +38,17 @@
// CS
.card-size{
transform: rotate(90deg) !important;
padding: 10px !important;
// padding: 5% !important;
// padding-right: 0px !important;
padding-right: 0px !important;
padding-left: 15% !important;
}
.qr-style{
left: 410px !important;
left: 260% !important;
}
.name-ar-style{
left: 320px !important;
left: 175% !important;
padding: 0%;
}
// HMG
.logo-img-hmg-style{
@ -60,14 +63,15 @@
// CS
.card-size{
transform: rotate(90deg) !important;
padding: 10px !important;
padding-right: 0px !important;
padding: 6% !important;
padding-right: 2% !important;
}
.qr-style{
left: 324px !important;
width: 80%;
left: 220% !important;
}
.name-ar-style{
left: 230px !important;
left: 140% !important;
}
// HMG
@ -83,14 +87,14 @@
// CS
.card-size{
transform: rotate(90deg) !important;
padding: 5px !important;
padding: 6% !important;
padding-right: 0px !important;
}
.qr-style{
left: 400px !important;
left: 280% !important;
}
.name-ar-style{
left: 310px !important;
left: 205%!important;
}
// HMG
.logo-img-hmg-style{
@ -125,14 +129,14 @@
@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;
padding: 6% !important;
padding-right: 0% !important;
}
.qr-style{
left: 280px !important;
left: 200% !important;
}
.name-ar-style{
left: 190px !important;
left: 116% !important;
}
// HMG
.logo-img-hmg-style{
@ -146,26 +150,26 @@
.card-size{
transform: rotate(90deg) !important;
position: relative;
bottom: 30px;
left: 26px;
bottom: 3%;
left: 8%;
}
.qr-style{
width: 80px !important;
margin-top: 50px !important;
width: 70% !important;
margin-top: 30% !important;
position: relative !important;
left: 265px !important;
left: 200% !important;
}
.name-ar-style{
font-size: 15px !important;
position: relative !important;
left: 130px !important;
left: 115% !important;
text-align: end !important;
padding: 10px !important;
width: 225px !important;
padding: 1% !important;
width: 170% !important;
}
.logo-img-style{
width: 80px !important;
margin-top: 50px !important;
width: 60% !important;
margin-top: 35% !important;
}
// HMG
@ -193,23 +197,24 @@
.card-size{
transform: rotate(90deg);
padding: 6%;
}
.qr-style{
width: 130px;
width: 70%;
margin-top: 0px;
position: relative;
left: 410px;
left: 200%;
}
.name-ar-style{
font-size: 25px;
font-size: 20px;
position: relative;
left: 314px;
left: 120%;
text-align: end;
padding: 10px;
width: 225px;
padding: 1%;
width: 145%;
}
.logo-img-style{
width: 120px;
width: 70%;
}
.logo-img-hmg-style{

@ -10,7 +10,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class BusinessCardComponent implements OnInit {
@Input() userInfo: any;
public userInfo: any;
public userJobName: any;
constructor(
public modalCtrl: ModalController,
@ -19,6 +19,7 @@ export class BusinessCardComponent implements OnInit {
) { }
ngOnInit() {
this.userInfo = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log(this.userInfo);
}

@ -475,11 +475,12 @@ export class ConfirmLoginComponent implements OnInit {
return await modal.present();
}
checkAccess(el: any, isDigitalID = false, buttonType?) {
checkAccess(el: any, isDigitalID = false, buttonType?, isBusinessID = false,) {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
if (isDigitalID) {
if (isDigitalID || isBusinessID) {
const sourceType = isDigitalID === true ? 'digitalID' : 'businessID';
this.button();
this.checkButtonType(buttonType);
this.checkButtonType(buttonType, sourceType);
}
else {
console.log(data);
@ -497,7 +498,7 @@ export class ConfirmLoginComponent implements OnInit {
}
}
checkButtonType(typeNumber) {
checkButtonType(typeNumber, sourceType) {
let buttonSelected;
this.buttons.forEach(element => {
element.forEach(elementValue => {
@ -508,7 +509,11 @@ export class ConfirmLoginComponent implements OnInit {
}
});
});
this.sharedData.setSharedData(true, "loginWithDigitalIDButton");
if (sourceType === 'digitalID') {
this.sharedData.setSharedData(true, "loginWithDigitalIDButton");
} else {
this.sharedData.setSharedData(true, "loginWithBusinessIDButton");
}
this.loginType = buttonSelected;
this.checkAppUpdated();
}

@ -215,8 +215,6 @@ 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');
console.log(JSON.stringify(this.businessInfo));
localStorage.setItem('bussiness-card-info', JSON.stringify(this.businessInfo));
// this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');

@ -34,7 +34,7 @@ export class AttendScanService {
userData: any = {};
public isFakeLocationUsed = false;
public isGpsRequired = false;
public collection = 'HMG';
public collection = 'CS';
constructor(private device: Device,
private zbar: ZBar,

@ -142,8 +142,8 @@ export class AuthenticationService {
} else {
mobileType = 'android';
}
request.VersionID = 3.1;
request.Channel = 33;
request.VersionID = 3.2;
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType;
@ -218,7 +218,7 @@ export class AuthenticationService {
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
request.P_APP_VERSION = "HMG";
request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
}
@ -475,7 +475,7 @@ export class AuthenticationService {
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.P_APP_VERSION = "HMG";
request.P_APP_VERSION = "CS";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
}

@ -1,4 +1,4 @@
<ion-content has-bouncing="false" forceOverscroll="false" class="ion-no-padding">
<ion-content has-bouncing="false" class="ion-no-padding" >
<ion-grid padding>
<!-- <ion-row>
<ion-col [size]="12">
@ -58,8 +58,8 @@
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-button *ngIf="userBusiness?.show_business" class="button-digital-id" (click)="openBusinessCard()">
<ion-col style="padding-bottom: 100px !important;">
<ion-button *ngIf="showBusinessCard" class="button-digital-id" (click)="loginWithBusinessCard()" >
<p style="color: black;">{{ts.trPK('general','business-card')}}</p>
<img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png">
</ion-button>

@ -17,7 +17,6 @@ import { ButtonSettings } from '../button/models/button-settingsl';
import { Events, ModalController } from '@ionic/angular';
import { SharedDataService } from '../../services/shared-data-service/shared-data.service';
import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component";
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({
selector: "welcome-login",
@ -76,6 +75,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
user_name: string;
userInfo: any;
userBusiness: any;
showBusinessCard = false;
constructor(
public ts: TranslatorService,
@ -94,7 +94,13 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
false
);
console.log( "this.user in welcome login"+ this.user);
console.log( "this.user in welcome login"+ JSON.stringify(this.user));
if (this.user && this.user.BusinessCardPrivilege) {
this.showBusinessCard = true
} else {
this.showBusinessCard = false;
}
this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password");
@ -104,6 +110,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.lastLoginDate= localStorage.getItem("login-at");
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
this.userBusiness = JSON.parse(localStorage.getItem('bussiness-card-info'));
console.log('userBusiness' + this.userBusiness);
// this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);
@ -229,7 +236,11 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
}
loginWithDigitalID(){
this.confimLogin.checkAccess(this.logintype, true, this.logintype);
this.confimLogin.checkAccess(this.logintype, true, this.logintype, false);
}
loginWithBusinessCard() {
this.confimLogin.checkAccess(this.logintype, false, this.logintype, true);
}
@ -254,16 +265,4 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
return await modal.present();
}
async openBusinessCard() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo': this.userBusiness
}
});
return await modal.present();
}
}

@ -40,6 +40,7 @@ import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'
import { NFC, Ndef } from "@ionic-native/nfc/ngx"
import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
@Component({
selector: 'app-home',
@ -167,6 +168,7 @@ export class HomePage implements OnInit {
ngOnInit() {
let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true);
let openBusinessCard = this.sharedData.getSharedData("loginWithBusinessIDButton", true);
this.direction = TranslatorService.getCurrentLanguageName();
this.myTeamTitle = this.ts.trPK('myTeam', 'myTeam-header');
this.vacationRuleTitle = this.ts.trPK('vacation-rule', 'vacationRule');
@ -175,9 +177,11 @@ export class HomePage implements OnInit {
this.events.subscribe('getNotCount', badge => {
this.notBadge = badge;
});
if (openDigitalIDCard === true) {
if (openDigitalIDCard) {
console.log("DONE");
this.openDigitalId();
} else if (openBusinessCard) {
this.openBusinessCard();
}
}
@ -787,6 +791,16 @@ export class HomePage implements OnInit {
});
return await modal.present();
}
async openBusinessCard() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css'
});
return await modal.present();
}
itemForSale() {
this.common.navigateForward('/itemforsale/items');
}

@ -91,9 +91,9 @@ export class HomeComponent implements OnInit {
data: [0, 0, 0, 0, 0, 0],
backgroundColor: [
'#18a169',
'#38c9b3',
'#114475',
'#3cb9d5',
'#114475',
'#38c9b3',
'#cc3232',
'#9e7e97'
],
@ -119,10 +119,10 @@ export class HomeComponent implements OnInit {
},
{
value: 0,
name: 'PO',
name: 'MR',
active: false,
color: '#38c9b3',
key: 'POAPPRV',
color: '#3cb9d5',
key: 'INVMOA',
disable: false
},
{
@ -135,10 +135,10 @@ export class HomeComponent implements OnInit {
},
{
value: 0,
name: 'MR',
name: 'PO',
active: false,
color: '#3cb9d5',
key: 'INVMOA',
color: '#38c9b3',
key: 'POAPPRV',
disable: false
},
{
@ -158,6 +158,7 @@ export class HomeComponent implements OnInit {
disable: false
}
];
public slideOptsOne = {
slidesPerView: 4.3,
spaceBetween: 10
@ -236,9 +237,9 @@ export class HomeComponent implements OnInit {
this.ngZone.run(() => {
this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.filters[1].value = this.totalHR;
this.filters[2].value = this.totalPO;
this.filters[2].value = this.totalMR;
this.filters[3].value = this.totalPR;
this.filters[4].value = this.totalMR;
this.filters[4].value = this.totalPO;
this.filters[6].value = this.totalIC;
});
@ -269,14 +270,14 @@ export class HomeComponent implements OnInit {
if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[1].value = this.totalHR;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[2].value = this.totalPO;
} else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[2].value = this.totalMR;
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[3].value = this.totalPR;
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[4].value = this.totalMR;
} else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[4].value = this.totalPO;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVITEM') {
this.filters[6].value = this.totalIC;

@ -29,6 +29,8 @@ export class WorklistMainService {
public static getMONotificationBody = "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY";
public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY";
public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY";
public static getBasicDetailNotificationBody = "Services/ERP.svc/REST/GET_BASIC_DET_NTF_BODY";
public static getAddressNotificationBody = "Services/ERP.svc/REST/GET_ADDRESS_NOTIFICATION_BODY";
public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY";
public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY";
public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS";
@ -107,7 +109,7 @@ export class WorklistMainService {
);
}
public getICNotificationBody(
public getBasicDetailNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
@ -115,7 +117,22 @@ export class WorklistMainService {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getICNotificationBody,
WorklistMainService.getBasicDetailNotificationBody,
request,
onError,
errorLabel
);
}
public getAddressNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getAddressNotificationBody,
request,
onError,
errorLabel
@ -169,6 +186,21 @@ export class WorklistMainService {
);
}
public getICNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getICNotificationBody,
request,
onError,
errorLabel
);
}
public getQutationAnalysis(
qutationAnalysis: any,
onError?: any,

@ -100,8 +100,30 @@
<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-input (ionInput)="onChangeInput()" [ngClass]="direction == 'ltr'? 'filterInput':'filterInput-ar'"
[(ngModel)]="searchKey" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> -->
<!-- <ion-input class='replacmentSearchBar'
style="height: 45px; border: 1px solid lightgray; border-radius: 50px; width: 350px;"
[(ngModel)]="searchKey"
[placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true">
<ion-button (click)='onChangeInput()' style="--background: transparent; background: transparent; color: black"><ion-icon name="search"></ion-icon></ion-button>
</ion-input> -->
<ion-grid>
<ion-row style="height: 45px; border: 1px solid lightgray; border-radius: 50px;">
<ion-col size='9'>
<ion-input class='replacmentSearchBar' style="height: 35px;"
[(ngModel)]="searchKey" [placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true">
<ion-icon style="width: 50px; height: 21px;" name="search"></ion-icon>
</ion-input>
</ion-col>
<ion-col size='3'>
<button [disabled]='searchKey == undefined || 1 > searchKey.length' (click)='onChangeInput()'
style="--background: white; background: transparent; margin-top: 4px; --background-hover: transparent !important;">
<ion-label><p style="color: #269db8;">{{"general, search" | translate}}</p></ion-label>
</button>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>

@ -100,6 +100,12 @@ export class WorkListReplacementItgComponent implements OnInit {
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
break;
}
case '5': {
this.P_SEARCH_EMAIL_ADDRESS = "";
this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.searchKey;
break;
}
default: {
this.P_SEARCH_USER_NAME = "";
this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
@ -211,12 +217,13 @@ export class WorkListReplacementItgComponent implements OnInit {
}
onChangeInput() {
this.ReplacementList = [];
clearTimeout(this.typingTimer);
this.typingTimer = setTimeout(() => {
if (this.searchKey.length > 2) {
this.SearchReplacementList();
}
}, 3000);
this.SearchReplacementList();
// clearTimeout(this.typingTimer);
// this.typingTimer = setTimeout(() => {
// if (this.searchKey.length > 2) {
// this.SearchReplacementList();
// }
// }, 3000);
}
select(selectEmp, index) {
this.selEmp = selectEmp
@ -268,7 +275,7 @@ export class WorkListReplacementItgComponent implements OnInit {
"IsFavorite": selEmp.IsFavorite
}
];
this.saveUserFavruiteList(request);
this.saveUserFavruiteList(request, selEmp.IsFavorite);
}, () => {
});
} else {
@ -283,16 +290,21 @@ export class WorkListReplacementItgComponent implements OnInit {
"IsFavorite": false
}
];
this.saveUserFavruiteList(request);
this.saveUserFavruiteList(request, false);
}
}
saveUserFavruiteList(request) {
saveUserFavruiteList(request, isFav: boolean) {
this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => {
if (this.cs.validResponse(result)) {
this.cs.toastPK("replacementRoll", "favorite-saved");
if (isFav) {
this.cs.greenToastPK("replacementRoll", "favorite-saved");
} else {
this.cs.redToastPK("replacementRoll", "favorite-unsaved");
}
this.getFavruite();
}
})
});
}
getFavruite() {
this.cs.startLoading();

@ -60,10 +60,21 @@
<div style="padding: 5px;" *ngIf="!isFilter">
<!-- <ion-input (ionInput)="onChangeInput()" [ngClass]="direction == 'en'? 'filterInput':'filterInput-ar'" [(ngModel)]="inputSearch" [placeholder]='getPlaceHolder()' clearInput="true"></ion-input> -->
<ion-input class='replacmentSearchBar' (ionInput)="onChangeInput()" style="height: 45px; --padding-start: 20px;"
class="searchbar-input sc-ion-searchbar-md" [(ngModel)]="inputSearch"
[placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true"></ion-input>
<ion-grid>
<ion-row style="height: 45px; border: 1px solid lightgray; border-radius: 50px;">
<ion-col size='9'>
<ion-input class='replacmentSearchBar' style="height: 35px;"
[(ngModel)]="inputSearch" [placeholder]='"replacementRoll, searchbyname" | translate' clearInput="true">
<ion-icon style="width: 50px; height: 21px;" name="search"></ion-icon>
</ion-input>
</ion-col>
<ion-col size='3'>
<button [disabled]='inputSearch == undefined || inputSearch.length < 1' (click)='onChangeInput()' style="--background: white;background: transparent;--background-hover: transparent !important; margin-top: 4px;">
<ion-label><p style="color: #269db8;">{{"general, search" | translate}}</p></ion-label>
</button>
</ion-col>
</ion-row>
</ion-grid>
</div>
<div *ngIf="isFilter">
@ -156,12 +167,12 @@
</p>
</ion-label>
</div>
<div [hidden]="isAnswer==true" *ngIf="ReplacementList.length>0 && !userSelected" class="uk-margin">
<div [hidden]="isAnswer==true" *ngIf="ReplacementList.length>0 && !userSelected && searchBy !== '1' && searchBy !== '4'" class="uk-margin">
{{'replacementRoll, search-result' | translate}}
</div>
<br />
<ion-item [hidden]="isAnswer==true" lines="none" *ngIf="!userSelected">
<ion-item [hidden]="isAnswer==true" lines="none" *ngIf="ReplacementList.length>0 && !userSelected && searchBy !== '1' && searchBy !== '4'">
<div class="square-container">

@ -340,17 +340,17 @@ export class WorkListReplacementRollComponent implements OnInit {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
//this.modalCtrl.dismiss(succ);
this.modalCtrl.dismiss({
'dismissed': true,
data: "Success"
});
if (this.selEmp && this.isAnswer == false) {
this.setFavorite(this.selEmp);
}
}, 5000);
// setTimeout(() => {
this.messageSuccess = false;
//this.modalCtrl.dismiss(succ);
this.modalCtrl.dismiss({
'dismissed': true,
data: "Success"
});
// if (this.selEmp && this.isAnswer == false) {
// this.setFavorite(this.selEmp);
// }
// }, 5000);
this.cs.openNotificationPage();
// this.messageSuccess = true;
@ -433,6 +433,7 @@ export class WorkListReplacementRollComponent implements OnInit {
}
selectedType;
counter=0;
onChangeSelect(select) {
let selectValue = select.detail.value;
@ -441,9 +442,20 @@ export class WorkListReplacementRollComponent implements OnInit {
this.isFilter = true;
this.selectedType = 1;
this.listOfRealted = this.actionHistory;
if(this.counter > 0)
{
this.actionHistory.forEach((obj, i) => {
if(this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) {
this.actionHistory[i].IsFavorite = true;
}else{
this.actionHistory[i].IsFavorite = false;
}
});
}
this.counter = 1;
} else if (selectValue === '4') {
// if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) {
this.getFavruite();
this.getFavruite();
// }
this.isFilter = true;
this.selectedType = 4;
@ -461,11 +473,11 @@ export class WorkListReplacementRollComponent implements OnInit {
onChangeInput() {
this.ReplacementList = [];
clearTimeout(this.typingTimer);
this.typingTimer = setTimeout(() => {
if (this.inputSearch.length > 2) {
// this.typingTimer = setTimeout(() => {
// if (this.inputSearch.length > 2) {
this.getreplacmentemployee();
}
}, 3000);
// }
// }, 3000);
// if (this.inputSearch.length > 0) {
@ -509,12 +521,12 @@ export class WorkListReplacementRollComponent implements OnInit {
this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => {
if (this.cs.validResponse(result)) {
if(isFav){
this.cs.toastPK("replacementRoll", "favorite-saved");
} else{
this.cs.toastPK("replacementRoll", "favorite-unsaved");
if (isFav) {
this.cs.greenToastPK("replacementRoll", "favorite-saved");
} else {
this.cs.redToastPK("replacementRoll", "favorite-unsaved");
}
this.getFavruite();
}
})
}

@ -542,7 +542,7 @@
for="">{{ts.trPK('worklistMain','TotalPOAmountWithVAT')}}
</label>
<br />
<label for="">{{header.TOT_PO_AMT}} </label>
<label for="">{{header.LOC_CUR_TOT_PO_AMT}} </label>
</ion-col>
</ion-row>
<ion-row>

@ -46,7 +46,9 @@
</ion-row>
<ion-row>
<ion-col>
<!-- NOT ADDRESS & BASIC_DETAILS -->
<ion-col
*ngIf="getPassNotificationDetails?.REQUEST_TYPE != 'ADDRESS' && getPassNotificationDetails?.REQUEST_TYPE != 'BASIC_DETAILS' ">
<div *ngIf="notificationBodyRes?.length > 0 ">
<ion-card *ngFor="let item of notificationBodyRes;let i=index; "
style="width: 91%;">
@ -117,6 +119,45 @@
</ion-grid>
</ion-item>
</ion-col>
<!-- IF BASIC_DETAILS -->
<ion-col *ngIf="getPassNotificationDetails?.REQUEST_TYPE == 'BASIC_DETAILS' ||
getPassNotificationDetails?.REQUEST_TYPE == 'ADDRESS'">
<div *ngIf='notificationBodyRes.length > 0'>
<ion-card style="width: 91%;">
<ion-card-content>
<div>
<ion-row>
<ion-col class="rowBorder" style="background: #269db8;">
<ion-label>
<p style="color: white;">Current</p>
</ion-label>
</ion-col>
<ion-col class="rowBorder" style="background: #269db8;">
<ion-label>
<p style="color: white;">Proposed</p>
</ion-label>
</ion-col>
</ion-row>
<ion-row *ngFor="let item of notificationBodyRes;let i=index;">
<ion-col class="rowBorder" size="6"
[hidden]="item.UPDATED_FLAG == 'N'">
<label class="colItemReq">{{item.SEGMENT_PROMPT}}</label>
<br />
<label>{{item.PREV_SEGMENT_VALUE_DSP}}</label>
</ion-col>
<ion-col class="rowBorder" size="6"
[hidden]="item.UPDATED_FLAG == 'N'">
<label class="colItemReq">{{item.SEGMENT_PROMPT}}</label>
<br />
<label>{{item.SEGMENT_VALUE_DSP}}</label>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-card>
</div>
</ion-col>
</ion-row>
</ion-grid>
@ -304,7 +345,7 @@
<ion-slide>
<ng-container *ngIf="activeSegment === 'action-history'">
<ion-card class="cardContent action-history" style="width: 100%;">
<ion-card class="cardContent action-history" style="width: 100%;">
<ion-card-content>
<div class="noDataDiv" [hidden]="actionHistoryRes && actionHistoryRes.length > 0">
@ -345,7 +386,8 @@
</div>
<button class="showMore"
(click)="actionHistory.visible = !actionHistory.visible">
{{actionHistory.visible ? 'Show less': 'Show More' }}</button>
{{actionHistory.visible ? 'Show less': 'Show More'
}}</button>
</div>
</div>
<ion-label

@ -273,9 +273,28 @@ export class WorklistMainComponent implements OnInit {
this.getMONotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") {
this.getPRNotificationDetails(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'ADDRESS') {
this.getAddressNotification(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'BASIC_DETAILS') {
this.getBasicDetailsNotification(this.WorkListBodyObj)
}
}
getBasicDetailsNotification(notificationBodyObj) {
this.worklistMainService
.getBasicDetailNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "BASIC_DETAILS");
});
}
getAddressNotification(notificationBodyObj) {
this.worklistMainService
.getAddressNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "ADDRESS");
});
}
getPRNotificationDetails(notificationBodyObj) {
this.worklistMainService
.getPRNotificationBody(notificationBodyObj)
@ -343,11 +362,23 @@ export class WorklistMainComponent implements OnInit {
this.getSubordinatesleave(obj)
}
} else if (Type == "PR") {
} else if (Type === "PR") {
if (result.GetAbsenceCollectionNotificationBodyList) {
this.notificationBodyRes =
result.GetAbsenceCollectionNotificationBodyList;
}
} else if (Type === "ADDRESS"){
if (result.GetAddressNotificationBodyList) {
this.notificationBodyRes =
result.GetAddressNotificationBodyList;
console.log(result);
}
} else if (Type === "BASIC_DETAILS"){
if (result.GetBasicDetNtfBodyList) {
this.notificationBodyRes =
result.GetBasicDetNtfBodyList;
console.log(result);
}
}
}
} //End handleWorkListBodyResult

@ -2202,11 +2202,11 @@
"ar": "أدخل ملاحظة"
},
"favorite-saved": {
"en": "Your Favorite saved successfully",
"en": "Your Favorite has been saved successfully",
"ar": "تم حفظ مفضلتك بنجاح"
},
"favorite-unsaved": {
"en": "Your Favorite had been deleted successfully",
"en": "Your Favorite has been deleted successfully",
"ar": "تم حفظ مفضلتك بنجاح"
},
"msg": {

@ -612,3 +612,10 @@ left: 66px;
font-size: 16px;
text-align: left;
}
ion-input .replacmentSearchBar .native-input{
position: absolute !important;
}
ion-input .replacmentSearchBar .input-clear-icon{
display: none !important;
}
Loading…
Cancel
Save