issues resolved

arabic-version^2
umasoodch 6 years ago
commit cb67e2670a

@ -15,11 +15,15 @@
<preference name="ScrollEnabled" value="false" /> <preference name="ScrollEnabled" value="false" />
<preference name="BackupWebStorage" value="none" /> <preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" /> <preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" /> <preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashShowOnlyFirstTime" value="false" /> <preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" /> <preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" /> <preference name="SplashScreenDelay" value="3000" />
<preference name="fullscreen" value="false" /> <preference name="fullscreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="orientation" value="portrait" />
<platform name="android"> <platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/network_security_config" /> <application android:networkSecurityConfig="@xml/network_security_config" />

@ -13,7 +13,7 @@
</ion-header> </ion-header>
<ion-content > <ion-content class="colorBG">
<!-- colorBG --> <!-- colorBG -->
<div class="contentEit" style="background: #f3f1f1;"> <div class="contentEit" style="background: #f3f1f1;">
<div class="header-div"> <div class="header-div">
@ -130,7 +130,7 @@
<div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" > <div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" >
<ion-row> <ion-row>
<img class="empty-data" src="../assets/imgs/noData.png"/> <img class="empty-data" src="../assets/imgs/box.png"/>
</ion-row> </ion-row>

@ -10,6 +10,9 @@ import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/mod
import { PushService } from '../../src/app/hmg-common/services/push/push.service'; import { PushService } from '../../src/app/hmg-common/services/push/push.service';
import { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service"; import { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service";
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
// import { SplashScreen } from '@ionic-native/splash-screen';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
@Component({ @Component({
selector: "app-root", selector: "app-root",
@ -29,10 +32,12 @@ export class AppComponent implements OnInit, AfterViewInit {
companyDesc: string = "Powered By Cloud Solutions"; companyDesc: string = "Powered By Cloud Solutions";
public direction = "ltr"; public direction = "ltr";
User_Job_name: string; User_Job_name: string;
public logoutFlage: any =false;
requestGetLoginInfo: { requestGetLoginInfo: {
DeviceType: string; DeviceToken: string; //this.deviceToken DeviceType: string; DeviceToken: string; //this.deviceToken
}; };
user: boolean; user: boolean;
deviceToken: string;
TeamFlag :string = "false"; TeamFlag :string = "false";
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -44,7 +49,9 @@ export class AppComponent implements OnInit, AfterViewInit {
private menu: MenuController, private menu: MenuController,
private authService: AuthenticationService, private authService: AuthenticationService,
private sanitizer: DomSanitizer, private sanitizer: DomSanitizer,
public pushService: PushService public pushService: PushService,
private splashScreen: SplashScreen
) { ) {
this.events.subscribe("img-change", displayImg => { this.events.subscribe("img-change", displayImg => {
console.log("app compont: "+displayImg); console.log("app compont: "+displayImg);
@ -80,6 +87,11 @@ export class AppComponent implements OnInit, AfterViewInit {
private startReceivingPushService() { private startReceivingPushService() {
console.log("platform.ready") console.log("platform.ready")
this.pushService.startReceiving(); this.pushService.startReceiving();
setTimeout(() => {
console.log(" in setTimeout startReceiving");
this.getLastLoginInfo();
},4000);
} }
subscribeEvents() { subscribeEvents() {
this.events.subscribe("setMenu", () => { this.events.subscribe("setMenu", () => {
@ -139,8 +151,14 @@ export class AppComponent implements OnInit, AfterViewInit {
} }
logout() { logout() {
this.cs.sharedService.clearAll(); this.cs.sharedService.clearAll();
this.menu.toggle(); //this.menu.toggle();
this.cs.openLogin(); this.menu.enable(false);
this.logoutFlage=true;
this.events.publish('logoutFlage', this.logoutFlage);
this.getLastLoginInfo();
// this.cs.openLogin();
} }
@ -183,6 +201,86 @@ export class AppComponent implements OnInit, AfterViewInit {
this.menu.toggle(); this.menu.toggle();
} }
getLastLoginInfo(){
console.log(" getLastLoginInfo");
console.log("get method :"+this.cs.getDeviceToken());
this.deviceToken= this.cs.getDeviceToken();
//this.cs.sharedService.getSharedData("new-device-token",false);// localStorage.getItem('devicyeToken');
console.log("let deviceToken app" + this.cs.sharedService.getSharedData("new-device-token",false));
console.log("localStorage.getItem app" + localStorage.getItem('devicyeToken'));
console.log("sheard DEVICE_TOKEN" + this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false));
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
} else {
console.log("no deviceToken" );
this.pushService.startReceiving();
setTimeout(() => {
this.deviceToken= localStorage.getItem('deviceToken');
console.log('login enabled second time: ' + this.deviceToken);
}, 1000);
}
this.requestGetLoginInfo= {
DeviceType:this.cs.getDeviceType(),//'Android',
DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken
}
this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if(res.Mohemm_GetMobileLoginInfoList.length > 0){
this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0],
res.Mohemm_GetMobileLoginInfoList[0],
AuthenticationService.IMEI_USER_DATA
);
this.user = true;
this.events.publish('user', this.user);
setTimeout(() => {
this.splashScreen.hide();
},3000);
if(this.logoutFlage){
this.cs.openLogin();
}
}
else{
this.user = false;
this.events.publish('user', this.user);
setTimeout(() => {
this.splashScreen.hide();
},3000);
if(this.logoutFlage){
this.cs.openLogin();
}
}
}else{
// this.user = false;
// this.splashScreen.hide();
// if(this.logoutFlage){
// this.cs.openLogin();
// }
}
});
}
} }

@ -67,19 +67,19 @@
<ion-row class="rowBorder"> <ion-row class="rowBorder">
<ion-col [size]="6" class="colBorder"> <ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-in')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-in')}}</ion-label>
<ion-label class="shift-text shift-title">08:00</ion-label> <ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SWIPE_IN | slice:0:-3}}</ion-label>
</ion-col> </ion-col>
<ion-col [size]="6" class="colBorder"> <ion-col [size]="6" class="colBorder" style="border-right: none;">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-out')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-out')}}</ion-label>
<ion-label class="shift-text shift-title">08:00 </ion-label> <ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SWIPE_OUT | slice:0:-3}}</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row style="text-align: center"> <ion-row style="text-align: center">
<ion-col [size]="6" class="colBorder"> <ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','late-in')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','late-in')}}</ion-label>
<ion-label class="shift-text shift-title">08:00 </ion-label> <ion-label class="shift-text shift-title">{{attendanceTrackingList.P_LATE_IN_HOURS | slice:0:-3}}</ion-label>
</ion-col> </ion-col>
<ion-col [size]="6" class="colBorder"> <ion-col [size]="6" class="colBorder" style="border-right: none;">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','regular')}}</ion-label> <ion-label class="shift-title"> {{ts.trPK('attendance-tracking','regular')}}</ion-label>
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SCHEDULED_HOURS | slice:0:-3}} </ion-label> <ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SCHEDULED_HOURS | slice:0:-3}} </ion-label>
</ion-col> </ion-col>

@ -2,7 +2,7 @@ import { Component, OnInit, NgZone, OnDestroy } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { Router } from "@angular/router"; import { Router } from "@angular/router";
import { AlertController, Platform } from "@ionic/angular"; import { AlertController, Platform, Events } from "@ionic/angular";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response"; import { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response";
import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service"; import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service";
@ -49,6 +49,8 @@ export class LoginComponent implements OnInit, OnDestroy {
user: boolean =false; user: boolean =false;
DeviceType: string; DeviceType: string;
requestGetLoginInfo:any; requestGetLoginInfo:any;
logoutFlage: boolean ;
getuser:any="";
constructor( constructor(
public cs: CommonService, public cs: CommonService,
@ -58,40 +60,89 @@ export class LoginComponent implements OnInit, OnDestroy {
public ts: TranslatorService, public ts: TranslatorService,
public smsService: SmsReaderService, public smsService: SmsReaderService,
private faio: FingerprintAIO, private faio: FingerprintAIO,
public events:Events,
public ngZone: NgZone, public ngZone: NgZone,
public device: Device, public device: Device,
public splash: SplashScreen, public splash: SplashScreen,
public sharedData: SharedDataService, public sharedData: SharedDataService,
public plt: Platform, public plt: Platform,
public pushService: PushService public pushService: PushService
) { } ) {
this.events.subscribe("logoutFlage", logoutFlage => {
console.log("login compont logoutFlage: "+logoutFlage);
if(logoutFlage == true){
console.log(" subscribe check logoutFlage: "+logoutFlage);
this.logoutFlage = logoutFlage;
localStorage.setItem('logoutFlage',logoutFlage);
}
});
this.getuser = this.cs.sharedService.getSharedData(
AuthenticationService.IMEI_USER_DATA,
false
);
// alert(" this.getuser "+this.getuser);
if(this.getuser){
this.user = true;
}
else{
this.user = false;
}
}
ngOnInit() { ngOnInit() {
// this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); // this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
// console.log("get deviceToken login"+ this.deviceToken) // console.log("get deviceToken login"+ this.deviceToken)
// this.getuser = this.cs.sharedService.getSharedData(
// AuthenticationService.IMEI_USER_DATA,
// false
// );
// if(this.getuser){
// console.log("this.getuser"+this.getuser);
// this.logoutFlage = true;
// }
this.events.subscribe("user", user => {
console.log("login compont: "+user);
this.user = user;
});
this.deviceToken= localStorage.getItem('devicyeToken'); this.deviceToken= localStorage.getItem('devicyeToken');
console.log("let deviceToken" + this.deviceToken); console.log("let deviceToken" + this.deviceToken);
if (this.deviceToken) { if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken); console.log('login enabled first time: ' + this.deviceToken);
} else { } else {
console.log("no deviceToken" ); console.log("no deviceToken" );
this.pushService.startReceiving(); this.pushService.startReceiving();
setTimeout(() => { setTimeout(() => {
this.deviceToken= localStorage.getItem('deviceToken'); // alert('login enabled second time: ' + this.deviceToken);
console.log('login enabled second time: ' + this.deviceToken);
}, 1000); }, 1000);
} }
setTimeout(() => { // setTimeout(() => {
// alert("this.logoutFlage in setTime" +localStorage.getItem('logoutFlage'));
// alert("this.this.user in setTime" + this.user);
this.getLastLoginInfo(); // if(localStorage.getItem('logoutFlage')== "true"){
},5000); // this.getLastLoginInfo();
// }
// },1000);
@ -355,12 +406,14 @@ export class LoginComponent implements OnInit, OnDestroy {
getLastLoginInfo(){ getLastLoginInfo(){
this.requestGetLoginInfo= { this.requestGetLoginInfo= {
DeviceType:this.cs.getDeviceType(), DeviceType:this.cs.getDeviceType(),//"Android",//this.cs.getDeviceType(),
DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken
} }
this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => { this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) { if (this.cs.validResponse(res)) {
if(res.Mohemm_GetMobileLoginInfoList.length > 0){ if(res.Mohemm_GetMobileLoginInfoList.length > 0){
this.cs.sharedService.setSharedData( this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0], // res.Patient_SELECTDeviceIMEIbyIMEIList[0],
res.Mohemm_GetMobileLoginInfoList[0], res.Mohemm_GetMobileLoginInfoList[0],

@ -6,7 +6,7 @@
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content> <ion-content class="colorBG">
<div class=""> <div class="">
<!-- class="colorBG" --> <!-- class="colorBG" -->
<div class="content" [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'"> <div class="content" [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'">
@ -158,7 +158,7 @@
*ngIf="!getResEITTransactionList || getResEITTransactionList[0]?.Collection_Transaction.length <= 0"> *ngIf="!getResEITTransactionList || getResEITTransactionList[0]?.Collection_Transaction.length <= 0">
<!-- <div class="no-dataDiv"> --> <!-- <div class="no-dataDiv"> -->
<ion-row> <ion-row>
<img class="empty-data" src="../assets/imgs/noData.png" /> <img class="empty-data" src="../assets/imgs/box.png" />
</ion-row> </ion-row>
<h4> {{'general, noData' | translate}}</h4> <h4> {{'general, noData' | translate}}</h4>
</div> </div>
@ -229,12 +229,12 @@
</div> </div>
</ion-content> </ion-content>
<ion-footer> <!-- <ion-footer>
<div class="centerDiv"> <div class="centerDiv"> -->
<!-- <button *ngIf="getPassMnuEntryObj.ADD_BUTTON == 'Y'" ion-button (click)="addEITRrq()">{{'requestEit.add' <!-- <button *ngIf="getPassMnuEntryObj.ADD_BUTTON == 'Y'" ion-button (click)="addEITRrq()">{{'requestEit.add'
| translate}} </button> --> | translate}} </button> -->
<!-- <ion-button class="footer-button" color="customnavy" ion-button (click)="addEITRrq()"> <!-- <ion-button class="footer-button" color="customnavy" ion-button (click)="addEITRrq()">
{{'general, add' | translate}}</ion-button> --> {{'general, add' | translate}}</ion-button> -->
</div> <!-- </div>
</ion-footer> </ion-footer> -->

@ -80,6 +80,7 @@ export class CommonService {
private loadingProgress: any; private loadingProgress: any;
public updateImage:boolean=false; public updateImage:boolean=false;
public setUpdateImg:any; public setUpdateImg:any;
DT: any;
constructor( constructor(
public nav: NavController, public nav: NavController,
public router: Router, public router: Router,
@ -1412,6 +1413,13 @@ public getMonthNameAr(value: number): string {
return objImg; return objImg;
} }
setDeviceToken(deviceToken){
this.DT=deviceToken;
}
getDeviceToken(){
return this.DT;
}
} }

@ -222,7 +222,12 @@ export class PushService {
this.firebasex.getToken().then(token => { this.firebasex.getToken().then(token => {
// alert("token: "+ token); // alert("token: "+ token);
this.cs.sharedService.setSharedData(token, "new-device-token");
localStorage.setItem('deviceToken', token);
this.cs.setDeviceToken(token); //last way to set the device Token to get it through getDeviceToken
this.registerInBackend(token); this.registerInBackend(token);
}).catch(error => console.error('Error getting token', error)); }).catch(error => console.error('Error getting token', error));

@ -1,6 +1,6 @@
<div class="main-container" [ngStyle]="active === true ? {'background': color} : {}"> <div class="main-container" [ngStyle]="active === true ? {'background': color} : {}">
<div class="main-container-radius" [ngStyle]="active === true ? {'background-color': '#ffffff'} : {'background-color': color}"></div> <div class="main-container-radius" [ngStyle]="active === true ? {'background-color': '#ffffff'} : {'background-color': color}"></div>
<span class="number-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{value}}</span> <span *ngIf="text != 'All'" class="number-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{value}}</span>
<span class="text-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{text}}</span> <span class="text-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{text}}</span>
</div> </div>

@ -87,7 +87,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
false false
); );
console.log( this.user); console.log( "this.user in welcome login"+ this.user);
this.userName = localStorage.getItem("user"); this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password"); this.password = localStorage.getItem("password");

@ -563,7 +563,7 @@ export class HomePage implements OnInit {
(result: OpenMissingSwipesResponse) => { (result: OpenMissingSwipesResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
const key = "GetOpenMissingSwipesList"; const key = "GetOpenMissingSwipesList";
this.statsButtons[1].statsValue = result[key].P_OPEN_MISSING_SWIPES; this.statsButtons[1].statsValue = Math.floor(result[key].P_OPEN_MISSING_SWIPES);
} }
} }
); );
@ -634,7 +634,7 @@ openPeriodDateDashbored() {
ITGCountAllNotification() { ITGCountAllNotification() {
this.workListService.getITGDetails().subscribe((result: any) => { this.workListService.getITGDetails().subscribe((result: any) => {
this.statsButtons[0].statsValue = this.statsButtons[0].statsValue =
this.countAllNotification + result.TotalCount; Math.floor(this.countAllNotification + result.TotalCount);
}); });
} }
@ -714,7 +714,7 @@ getSubordinatesAttStatus() {
"HMG Annual Vacation Accrual Plan" "HMG Annual Vacation Accrual Plan"
) { ) {
this.statsButtons[2].statsValue = this.statsButtons[2].statsValue =
accrualBalance.ACCRUAL_NET_ENTITLEMENT; Math.floor(accrualBalance.ACCRUAL_NET_ENTITLEMENT);
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
accrualBalance, accrualBalance,
"leaveAccrualBalance" "leaveAccrualBalance"
@ -732,7 +732,7 @@ getSubordinatesAttStatus() {
totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
} }
} }
this.statsButtons[3].statsValue = totalTicketsLeft; this.statsButtons[3].statsValue = Math.floor(totalTicketsLeft);
} }
}); });
} }

@ -3,7 +3,7 @@
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/home"></nav-buttons> <nav-buttons backLink="/home"></nav-buttons>
</ion-buttons> </ion-buttons>
<ion-title>{{'home,worklist' | translate}}</ion-title> <ion-title>WORK LIST</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
@ -12,13 +12,18 @@
<div class="contentBg"> <div class="contentBg">
<div class="result-graph"> <div class="result-graph">
<div class="request-heading"> <div class="request-heading">
<span>{{'work-list,open-analysis' | translate}}</span> <span>Open Request Analysis</span>
</div> </div>
<div class="result-text-container"> <div class="result-text-container" [ngStyle]="showChart === false ? {'visibility': 'hidden'} : {}">
<h2>{{totalRequestCount}}</h2> <span *ngIf="selectedFilter === 'ALL'">{{newWorkListResponse.length + ITGCount}} of </span>
<span>{{'work-list,total' | translate}} <br>{{'work-list,open-reqest' | translate}} </span> <span *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} of </span>
<h2 *ngIf="!showSearchButton">{{totalRequestCount}}</h2>
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}</h2>
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2>
<span>TOTAL <br> OPEN REQUEST</span>
</div> </div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart> <p-chart *ngIf="!showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<p-chart *ngIf="showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div> </div>
<ion-row class="filters-row"> <ion-row class="filters-row">
@ -37,12 +42,12 @@
<ion-row class="search-container"> <ion-row class="search-container">
<ion-col style="float: left;" size=[6] *ngIf="showSearchButton" (click)="clearSearch()"> <ion-col style="float: left;" size=[6] *ngIf="showSearchButton" (click)="clearSearch()">
<span style="margin-left: 5px;">{{'work-list,clear-search' | translate}}</span> <span style="margin-left: 5px;">Clear Search</span>
<ion-icon name="close" ></ion-icon> <ion-icon name="close" ></ion-icon>
</ion-col> </ion-col>
<ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter === 'ALL'"> <ion-col style="float: right;" size=[6] (click)="openSearchModal()" *ngIf="selectedFilter === 'ALL'">
<ion-icon name="search" ></ion-icon> <ion-icon name="search" ></ion-icon>
<span>{{'work-list,advanced-search' | translate}}</span> <span>Advanced Search</span>
</ion-col> </ion-col>
</ion-row> </ion-row>
<!-- <div class="total-result" *ngIf="isEmptyObject() && selectedFilter === 'ALL' && showSearchButton === false"> <!-- <div class="total-result" *ngIf="isEmptyObject() && selectedFilter === 'ALL' && showSearchButton === false">
@ -61,34 +66,37 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<div [ngClass]="isEmptyObject() && direction =='en' ? 'work-list-container-en' : 'work-list-container-ar'" *ngIf='selectedFilter != "ITG"'> <div style="position: relative;">
<div *ngFor="let data of showFormattedData | keyvalue; let i = index"> <div [ngClass]="showFormattedData.length > 0 ? 'work-list-container' : ''" *ngIf='selectedFilter != "ITG"'>
<span [ngClass]="direction == 'en'? 'date-span':'date-span-ar'">{{data.key}}</span> <div *ngFor="let formattedData of showFormattedData; let i = index">
<div (click)="openNotificationDetail(data.value)" class="date-data" *ngFor="let workList of data.value; let j = index"> <span class="date-span">{{formattedData.date}}</span>
<p>{{workList.SUBJECT}}</p> <div class="date-data" *ngFor="let workList of formattedData.data; let j = index">
<p (click)="openNotificationDetail(workList)">{{workList.SUBJECT}}</p>
</div>
</div> </div>
</div> </div>
</div> </div>
<div [ngClass]="isEmptyObject() && direction =='en' ? 'work-list-container-en' : 'work-list-container-ar'" *ngIf="selectedFilter == 'ITG'" > <div [ngClass]="showFormattedData.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'> <div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'>
<span [ngClass]="direction == 'en'? 'date-span':'date-span-ar'">{{segmentInfo.ModifiedDate |date}}</span> <span class="date-span">{{segmentInfo.ModifiedDate |date}}</span>
<div class="date-data"> <div class="date-data">
<p>{{segmentInfo.Title}}</p> <p>{{segmentInfo.Title}}</p>
</div>
</div> </div>
</div> </div>
<div class="no-data-available" *ngIf="showFormattedData.length === 0">
<span>No Data Available</span>
</div>
</div> </div>
<div class="no-data-available" *ngIf="!isEmptyObject()">
<span>{{'work-list,No-data-available' | translate}}</span>
</div>
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <!-- </div> -->
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="selectedFilter === 'ALL' || itemType !== ''">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> </ion-infinite-scroll>
</ion-content> </ion-content>

@ -1,460 +1,420 @@
.bar-stable {
background-color: var(--cusgray) !important;
}
.tabs{
background-color: var(--cusgray) !important;
}
.icon-size-lg {
font-size: 40px;
}
.bar-stable { /*Timeline*/
background-color: var(--cusgray) !important;
}
.tabs{
background-color: var(--cusgray) !important;
}
.icon-size-lg {
font-size: 40px;
}
/*Timeline*/ .pos-absolute-right {
position: absolute;
right: 8px;
}
.pos-absolute-right { .timelineMain {
position: absolute; position: relative;
right: 8px; margin: 15px 0 0 0;
} }
.timelineMain { .timelineMain:before {
position: relative;
margin: 15px 0 0 0;
}
.timelineMain:before { content: '';
position: absolute;
top: 0;
bottom: 0;
width: 1.5%;
height: 99%;
background: #e4e4e4;
z-index: 1;
/* margin-left: -10px; */
/* z-index: 1; */
}
content: ''; .timelineMain .timelineMain-thumb {
position: absolute;
top: 0;
bottom: 0;
width: 1.5%;
height: 99%;
background: #e4e4e4;
z-index: 1;
/* margin-left: -10px; */
/* z-index: 1; */
}
.timelineMain .timelineMain-thumb {
border-radius: 500px;
width: 50px;
z-index: 2;
position: absolute;
// :root[dir="ltr"]{
// left: 37px;
// }
// :root[dir="rtl"]{
// right: 37px;
// }
width: 50px;
float: right;
top: 0px;
}
.timelineMain .timelineMain-thumb.timelineMain-icon { border-radius: 500px;
height: 50px; width: 50px;
// text-align: center; z-index: 2;
// color: white; position: absolute;
// border: 5px solid #CBD0D3; // :root[dir="ltr"]{
transform: scale(0.3); // left: 37px;
} // }
// :root[dir="rtl"]{
// right: 37px;
// }
width: 50px;
float: right;
top: 0px;
}
.timelineMain .timelineMain-thumb.timelineMain-icon {
height: 50px;
// text-align: center;
// color: white;
// border: 5px solid #CBD0D3;
transform: scale(0.3);
}
.timelineMain .timelineMain-item {
width: 50px;
} .timelineMain .timelineMain-item {
width: 50px;
.timelineMain .timelineMain-stats { }
position: relative;
font-size: 12px;
color: var(--darkgray);
} .timelineMain .timelineMain-stats {
position: relative;
font-size: 12px;
color: var(--darkgray);
}
.divider-title {
background: #e4e4e4;
padding: 5px 15px;
}
.divider-title {
background: #e4e4e4;
padding: 5px 15px;
}
.color-red {
color: var(--danger) !important;
}
.bg-color-dot { .color-red {
// background-color: #ff3b30 !important; color: var(--danger) !important;
background: var(--primary); }
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); .bg-color-dot {
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); // background-color: #ff3b30 !important;
background: var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
} }
.notification-list{ .notification-list{
background: none; background: none;
ion-item{ ion-item{
// margin-top: 5px; // margin-top: 5px;
// margin-bottom: 5px; // margin-bottom: 5px;
background-color: transparent;
.item-date{
width: 100%;
font-size: 16px;
font-weight: bold;
text-align: start;
padding: 0;
margin: 0;
position: absolute;
left: 0;
top: 12%;
}
ion-label , [item-end]{
white-space: normal;
font-size: 14px;
padding-top: 15%;
// :root[dir="ltr"]{
// margin-left: 10px;
// }
// :root[dir="rtl"]{
// margin-right: 10px;
// }
}
background-color: transparent;
.item-date{
width: 100%;
font-size: 16px;
font-weight: bold;
text-align: start;
padding: 0;
margin: 0;
position: absolute;
left: 0;
top: 12%;
} }
ion-label , [item-end]{
white-space: normal;
font-size: 14px;
padding-top: 15%;
// :root[dir="ltr"]{
// margin-left: 10px;
// }
// :root[dir="rtl"]{
// margin-right: 10px;
// }
}
}
} }
.input-wrapper { .input-wrapper {
--flex:none; --flex:none;
} }
ion-input ,ion-datetime{ ion-input ,ion-datetime{
border-bottom: #dedede 1px solid; border-bottom: #dedede 1px solid;
} }
.left { .left {
--background: #f0efef; --background: #f0efef;
.timelineMain:before{ .timelineMain:before{
left: 21px; left: 21px;
}
.notification-list ion-item{
padding-left: 3px;
margin-left: -12%;
}
.timelineMain-thumb{
left: 9%;
top: 30%;
}
}
.right {
--background: #f0efef;
.timelineMain:before{
right: 62px;
} }
.notification-list ion-item{ .notification-list ion-item{
padding-left: 3px; padding-right: 3px;
margin-left: -12%;
} }
.timelineMain-thumb{ .timelineMain-thumb{
left: 9%; right: 37px;
top: 30%;
} }
}
.right {
--background: #f0efef;
.timelineMain:before{
right: 62px;
}
.notification-list ion-item{
padding-right: 3px;
}
.timelineMain-thumb{
right: 37px;
}
} }
.menuList{ .menuList{
margin-left: -40px; margin-left: -40px;
height: 160%; height: 160%;
padding-top: 370%; padding-top: 370%;
} }
.colorBG{ .colorBG{
--background: #f0efef; --background: #f0efef;
} }
.menuListCol{ .menuListCol{
padding-left: 50px; padding-left: 50px;
margin-left: -33px; margin-left: -33px;
} }
.menuListItem{ .menuListItem{
padding-top: 9%; padding-top: 9%;
margin: -20%; margin: -20%;
padding-left: 13%; padding-left: 13%;
} }
.menuListBtn{ .menuListBtn{
width: 100%; width: 100%;
background: white; background: white;
--background: white; --background: white;
} }
.activeTabMenu{ .activeTabMenu{
--background: #ff726f; --background: #ff726f;
} }
.notifincationList{ .notifincationList{
margin-left: 5%; margin-left: 5%;
margin-top: 6%; margin-top: 6%;
} }
.itemListNotification{ .itemListNotification{
padding-bottom: 18px; padding-bottom: 18px;
} }
.footerSearchBtn{ .footerSearchBtn{
padding: 0px !important; padding: 0px !important;
background: #f0efef !important; background: #f0efef !important;
} }
.viewAndSearch{ .viewAndSearch{
margin-bottom: 13px; margin-bottom: 13px;
} }
.toSearchBtn{ .toSearchBtn{
margin-top: 4%; margin-top: 4%;
} }
.emptyItem{ .emptyItem{
white-space: normal; white-space: normal;
padding-left: 10%; padding-left: 10%;
} }
///////////////////////////////////////////NEW DESIGN///////////////////////////////////// ///////////////////////////////////////////NEW DESIGN/////////////////////////////////////
.profile-image-container{ .profile-image-container{
position: relative; position: relative;
z-index: 999; z-index: 999;
img { img {
width: 32px; width: 32px;
float: right; float: right;
border-radius: 20px; border-radius: 20px;
height: 32px; height: 32px;
margin-right: 10px; margin-right: 10px;
} }
} }
ion-title{ ion-title{
color: white; color: white;
position: absolute; position: absolute;
top: 0; top: 0;
text-align: center; text-align: center;
// left: 15%; left: 15%;
// right: 15%; right: 15%;
font-size: 0.42cm; font-size: 0.42cm;
font-weight: bold; font-weight: bold;
height: 100%; height: 100%;
} }
.contentBg:before { .contentBg:before {
position: absolute; position: absolute;
content: ""; content: "";
background: #22c6b3; background: #22c6b3;
height: 140px; height: 140px;
width: 100%; width: 100%;
left: 0; left: 0;
top: 0px; top: 0px;
z-index: 1; z-index: 1;
} }
ion-content { ion-content {
--ion-background-color: whitesmoke; --ion-background-color: whitesmoke;
} }
.request-heading { .request-heading {
span { span {
text-align: center; text-align: center;
display: block; display: block;
padding-top: 8px; padding-top: 8px;
font-family: workSans-Regular; font-family: workSans-Regular;
} }
} }
.result-graph { .result-graph {
position: relative; position: relative;
background: white; background: white;
margin-right: 20px; margin-right: 20px;
margin-left: 20px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
border-radius: 20px; border-radius: 20px;
z-index: 1; z-index: 1;
} }
.result-text-container { .result-text-container {
padding: 0; padding: 0;
margin: 0; margin: 0;
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
display: block;
text-align: center;
transform: translate(-50%, -50%);
h2 {
font-size: 38px;
font-family: WorkSans-Bold;
margin: 0 auto;
line-height: 36px;
}
span {
width: 125px;
display: block; display: block;
text-align: center; margin: 0 auto;
transform: translate(-50%, -50%); font-size: 12px;
h2 { font-family: workSans-Regular;
font-size: 38px; }
font-family: WorkSans-Bold; }
margin: 0 auto; .today-graph {
line-height: 36px; width: 100%;
} max-height: 4cm;
span { }
width: 125px;
display: block;
margin: 0 auto;
font-size: 12px;
font-family: workSans-Regular;
}
}
.today-graph {
width: 100%;
max-height: 4cm;
}
.swiper-container { .swiper-container {
margin: 0 !important; margin: 0 !important;
width: 100% !important; width: 100% !important;
} }
.filters-row { .filters-row {
margin-top: 10px; margin-top: 10px;
margin-left: 20px; margin-left: 20px;
} }
.work-list-container-en { .work-list-container {
position: relative; position: relative;
padding-left: 60px; padding-left: 60px;
clear: both; clear: both;
min-height: 200px; min-height: 200px;
margin-bottom: 80px; margin-bottom: 80px;
padding-top: 15px; padding-top: 15px;
} }
.work-list-container-en:before{ .work-list-container:before{
content: ""; content: "";
position: absolute; position: absolute;
height: 100%; height: 100%;
width: 4px; width: 4px;
left: 30px; left: 30px;
top: 15px; top: 15px;
background-color: #dddddd; background-color: #dddddd;
}
.work-list-container-ar {
position: relative;
padding-right: 60px;
clear: both;
min-height: 200px;
margin-bottom: 80px;
padding-top: 15px;
}
.work-list-container-ar:before{
content: "";
position: absolute;
height: 100%;
width: 4px;
right: 30px;
top: 15px;
background-color: #dddddd;
} }
.search-container{ .search-container{
margin-top: 15px; margin-top: 15px;
display: block; display: block;
padding: 0 20px; padding: 0 20px;
ion-col{ position: relative;
background: white; z-index: 99;
border-radius: 12px; ion-col{
padding-right: 10px; background: white;
flex: none; border-radius: 12px;
ion-icon{ padding-right: 10px;
margin-right: 3px; flex: none;
font-size: 14px; ion-icon{
margin-left: 3px; margin-right: 3px;
vertical-align: middle; font-size: 14px;
} margin-left: 3px;
span{ vertical-align: middle;
font-size: 12px;
vertical-align: middle;
}
} }
span{
font-size: 12px;
vertical-align: middle;
}
}
} }
.date-span { .date-span {
position: relative; position: relative;
display: block; display: block;
margin-bottom: 10px; margin-bottom: 10px;
} }
.date-span:before{ .date-span:before{
content: ""; content: "";
position: absolute; position: absolute;
left: -35px; left: -35px;
border-radius: 50%; border-radius: 50%;
width: 15px; width: 15px;
height: 15px; height: 15px;
background-color: #38c9b3; background-color: #38c9b3;
top: 1px; top: 1px;
} }
.date-data{ .date-data{
background-color: white; background-color: white;
padding: 1px; padding: 1px;
border-radius: 20px; border-radius: 20px;
font-family: WorkSans-Regular; font-family: WorkSans-Regular;
padding-left: 15px; padding-left: 15px;
margin-right: 20px; margin-right: 20px;
margin-bottom: 15px; margin-bottom: 15px;
p{ p{
font-size: 14px; font-size: 14px;
} }
} }
.no-data-available { .no-data-available {
background: white; background: white;
font-family: WorkSans-Regular; font-family: WorkSans-Regular;
padding: 30px; padding: 30px;
position: absolute; position: absolute;
left: 50%; left: 85px;
margin-left: -100px; top: 50px;
margin-top: 100px;
} }
.disable-filter { .disable-filter {
pointer-events: none; pointer-events: none;
opacity: .3; opacity: .3;
} }
.total-result { .total-result {
margin-top: 55px; margin-top: 55px;
padding-left: 20px; padding-left: 20px;
color: #888; color: #888;
font-size: 15px; font-size: 15px;
} }
.text-span{ .text-span{
font-size: 14px; font-size: 14px;
color: #888; color: #888;
background-color: white; background-color: white;
width: 93%; width: 93%;
height: 30px; height: 30px;
border: 1px solid; border: 1px solid;
border-radius: 15px; border-radius: 15px;
} }
.text-span-active{ .text-span-active{
font-size: 14px; font-size: 14px;
color: #888; color: #888;
background-color:#22c6b3; background-color:#22c6b3;
width: 93%; width: 93%;
height: 30px; height: 30px;
border: 1px solid; border: 1px solid;
border-radius: 15px; border-radius: 15px;
} }
.slideCss{ .slideCss{
width: 200px !important; width: 200px !important;
}
.date-span-ar {
position: relative;
display: block;
margin-bottom: 10px;
}
.date-span-ar:before{
content: "";
position: absolute;
right: -35px;
border-radius: 50%;
width: 15px;
height: 15px;
background-color: #38c9b3;
top: 1px;
} }

@ -9,6 +9,8 @@ import { IonInfiniteScroll } from '@ionic/angular';
import { WorklistMainService } from '../service/work-list.main.service'; import { WorklistMainService } from '../service/work-list.main.service';
import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component'; import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component';
import { DatePipe } from '@angular/common'; import { DatePipe } from '@angular/common';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -58,10 +60,18 @@ export class HomeComponent implements OnInit {
public worklistNotifications: any; public worklistNotifications: any;
public totalRequestCount = 0; public totalRequestCount = 0;
public newWorkListResponse = []; public newWorkListResponse = [];
public showFormattedData = {}; public showFormattedData = [];
public allFormattedData = [];
public selectedFilter = 'ALL'; public selectedFilter = 'ALL';
public showSearchButton = false; public showSearchButton = false;
public itemType = ''; public itemType = '';
public totalHR = 0;
public totalPO = 0;
public totalPR = 0;
public totalMR = 0;
public showChart = false;
public options = { public options = {
cutoutPercentage: 80, cutoutPercentage: 80,
tooltips: { enabled: false }, tooltips: { enabled: false },
@ -138,9 +148,11 @@ export class HomeComponent implements OnInit {
constructor( constructor(
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
// tslint:disable-next-line: no-shadowed-variable
public WorklistService: WorklistService, public WorklistService: WorklistService,
public workListService: WorklistMainService, public workListService: WorklistMainService,
public modalController: ModalController public modalController: ModalController,
public DS: DashboredService
) { ) {
this.WorkListObj = new WorkListRequest(); this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = '1'; this.WorkListObj.P_NOTIFICATION_TYPE = '1';
@ -153,56 +165,63 @@ export class HomeComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.direction = TranslatorService.getCurrentLanguageName()//TranslatorService.getCurrentDirection(); this.direction = TranslatorService.getCurrentLanguageName();
console.log(">>>>>>>>>>>>>>>>>>"+this.direction);
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
this.openNotificationsDashboard();
}
callWorkListServices() {
this.Details(); this.Details();
this.Count(); this.Count();
this.assignDataToFilters();
this.getAllPushNotificationFun(); this.getAllPushNotificationFun();
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER; }
openNotificationsDashboard() {
this.DS.getOpenNotifications().subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
this.worklistNotifications = result;
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.common.sharedService.setSharedData(result, 'worklistNotifications');
this.callWorkListServices();
}
});
} }
assignDataToFilters() { assignDataToFilters() {
this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER; this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList; const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
for (const notification of openNotificationsArray) { for (const notification of openNotificationsArray) {
if (notification.ITEM_TYPE === 'HRSSA') { if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[1].value = notification.OPEN_NTF_NUMBER; this.filters[1].value = this.totalHR;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'POAPPRV') { } else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[2].value = notification.OPEN_NTF_NUMBER; this.filters[2].value = this.totalPO;
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'REQAPPRV') { } else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[3].value = notification.OPEN_NTF_NUMBER; this.filters[3].value = this.totalPR;
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVMOA') { } else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[4].value = notification.OPEN_NTF_NUMBER; this.filters[4].value = this.totalMR;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'ITG') { } else if (notification.ITEM_TYPE === 'ITG') {
this.filters[5].value = notification.OPEN_NTF_NUMBER; this.filters[5].value = notification.OPEN_NTF_NUMBER;
this.data.datasets[0].data[4] = notification.OPEN_NTF_NUMBER; this.data.datasets[0].data[4] = notification.OPEN_NTF_NUMBER;
}
} }
} this.showChart = true;
} }
activeFilter(index: number) { activeFilter(index: number) {
if (this.currentActiveIndex !== index) { if (this.currentActiveIndex !== index) {
this.showFormattedData = {};
this.previousActiveIndex = this.currentActiveIndex; this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index; this.currentActiveIndex = index;
this.filters[this.previousActiveIndex].active = false; this.filters[this.previousActiveIndex].active = false;
this.filters[this.currentActiveIndex].active = true; this.filters[this.currentActiveIndex].active = true;
if (this.filters[this.currentActiveIndex].value !== 0) {
const selectedKey = this.filters[this.currentActiveIndex].key;
this.resetData();
this.itemType = (selectedKey !== 'ITG' && selectedKey !== 'ALL') ? this.filters[this.currentActiveIndex].key : '';
this.getAllPushNotificationFun();
}
this.selectedFilter = this.filters[this.currentActiveIndex].key; this.selectedFilter = this.filters[this.currentActiveIndex].key;
if (this.selectedFilter !== 'ITG') {
this.getFilteredData(this.selectedFilter);
}
} }
} }
@ -232,13 +251,13 @@ export class HomeComponent implements OnInit {
async openSearchModal() { async openSearchModal() {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: WorklistAdvancedSearchComponent, component: WorklistAdvancedSearchComponent,
cssClass: 'advanced-search-modal', cssClass: 'advanced-search-modal-custom',
backdropDismiss: false, backdropDismiss: false,
componentProps: {} componentProps: {}
}); });
modal.onDidDismiss().then(result => { modal.onDidDismiss().then(result => {
if (result.data) { if (result.data) {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') { if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.showSearchButton = true; this.showSearchButton = true;
this.itemType = result.data.itemType; this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType; this.notificationType = result.data.notificationType;
@ -247,7 +266,7 @@ export class HomeComponent implements OnInit {
this.inputSearch = result.data.inputSearch; this.inputSearch = result.data.inputSearch;
this.WorkListObj.P_PAGE_NUM = 1; this.WorkListObj.P_PAGE_NUM = 1;
this.newWorkListResponse = []; this.newWorkListResponse = [];
this.showFormattedData = {}; this.showFormattedData = [];
this.selectedFilter = 'ALL'; this.selectedFilter = 'ALL';
this.filters[this.currentActiveIndex].active = false; this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0; this.currentActiveIndex = 0;
@ -270,7 +289,7 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : ''; this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3') this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
? moment(this.inputDate).format('DD-MMM-YYYY') : ''; ? moment(this.inputDate).format('DD-MMM-YYYY') : '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : ''; ; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';
this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : ''; this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1'; this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
if (this.selectedValue === '5') { if (this.selectedValue === '5') {
@ -279,7 +298,6 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = ''; this.WorkListObj.P_SEARCH_SUBJECT = '';
} }
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => { this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList); this.handleWorkListResult(result.GetWorkList);
@ -288,24 +306,83 @@ export class HomeComponent implements OnInit {
); );
} }
categorizeData(arrayToCategorize: any) { getFilteredData(filter: string) {
const datePipe = new DatePipe('en-US'); if (filter === 'ALL') {
const formattedData = {}; this.showFormattedData = this.allFormattedData;
for (const workList of arrayToCategorize) { } else {
workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); let arrayToFilter;
if (!(workList.FORMATTED_DATE in formattedData)) { arrayToFilter = this.newWorkListResponse.filter((workList) => {
formattedData[workList.FORMATTED_DATE] = new Array(); return workList.ITEM_TYPE === filter;
formattedData[workList.FORMATTED_DATE].push(workList); });
} else { const sortData = this.sortArray(arrayToFilter);
formattedData[workList.FORMATTED_DATE].push(workList); this.showFormattedData = this.categorizeData(sortData);
}
}
checkDateExistance(currentDate: any, formattedData: any) {
let existsBefore = false;
let index = 0;
for (let i = 0; i < formattedData.length; i++) {
if (formattedData[i].date === currentDate) {
existsBefore = true;
index = i;
break;
} }
}
return {
exists: existsBefore,
indexNumber: index
};
}
addCountInFilters(workList: any) {
if (workList.ITEM_TYPE === 'HRSSA') {
this.totalHR = this.totalHR + 1;
} else if (workList.ITEM_TYPE === 'POAPPRV') {
this.totalPO = this.totalPO + 1;
} else if (workList.ITEM_TYPE === 'REQAPPRV') {
this.totalPR = this.totalPR + 1;
} else if (workList.ITEM_TYPE === 'INVMOA') {
this.totalMR = this.totalMR + 1;
}
}
categorizeData(arrayToCategorize: any) {
this.totalHR = 0;
this.totalPO = 0;
this.totalPR = 0;
this.totalMR = 0;
const datePipe = new DatePipe('en-US');
const formattedData = [];
for (const workList of arrayToCategorize) {
this.addCountInFilters(workList);
const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
const currentObject = {
date: '',
data: []
};
if (formattedData.length === 0) {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
} else {
const existsBefore = this.checkDateExistance(currentDate, formattedData);
if (existsBefore.exists) {
formattedData[existsBefore.indexNumber].data.push(workList);
} else {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
}
}
} }
return formattedData; return formattedData;
} }
sortArray(arrayToSort: any) { sortArray(arrayToSort: any) {
return arrayToSort.sort((a: any, b: any) => return arrayToSort.sort((a: any, b: any) =>
new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime() new Date(b.date).getTime() - new Date(a.date).getTime()
); );
} }
@ -332,9 +409,10 @@ export class HomeComponent implements OnInit {
} else { } else {
this.newWorkListResponse = this.newWorkListResponse.concat(result); this.newWorkListResponse = this.newWorkListResponse.concat(result);
} }
this.newWorkListResponse = this.sortArray(this.newWorkListResponse); const categorizedWorkListResponse = this.categorizeData(this.newWorkListResponse);
console.log(this.newWorkListResponse); this.assignDataToFilters();
this.showFormattedData = this.categorizeData(this.newWorkListResponse); this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.allFormattedData = this.showFormattedData;
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR); this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
} else { } else {
this.newWorkListResponse = []; this.newWorkListResponse = [];
@ -342,22 +420,18 @@ export class HomeComponent implements OnInit {
} }
openNotificationDetail(obj) { openNotificationDetail(obj) {
this.common.sharedService.setSharedData(obj[0], HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') { if (obj.REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage(); this.common.openWorklistMainPRPage();
} else if (obj[0].REQUEST_TYPE === 'PO') { } else if (obj.REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage(); this.common.openWorklistMainPOPage();
} else if (obj[0].REQUEST_TYPE === 'MO') { } else if (obj.REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage(); this.common.openWorklistMainMRPage();
} else { } else {
this.common.openWorklistMainPage(); this.common.openWorklistMainPage();
} }
} }
isEmptyObject() {
return (this.showFormattedData && (Object.keys(this.showFormattedData).length > 0) || this.ITGItem.length > 0);
}
resetData() { resetData() {
if (this.infiniteScroll) { if (this.infiniteScroll) {
this.infiniteScroll.complete(); this.infiniteScroll.complete();
@ -368,7 +442,8 @@ export class HomeComponent implements OnInit {
this.inputDate = ''; this.inputDate = '';
this.inputSearch = ''; this.inputSearch = '';
this.newWorkListResponse = []; this.newWorkListResponse = [];
this.showFormattedData = {}; this.showFormattedData = [];
this.allFormattedData = [];
this.WorkListObj.P_SEARCH_FROM_USER = ''; this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_SEARCH_SENT_DATE = ''; this.WorkListObj.P_SEARCH_SENT_DATE = '';
@ -418,13 +493,13 @@ export class HomeComponent implements OnInit {
Details() { Details() {
this.workListService.getITGDetails() this.workListService.getITGDetails()
.subscribe((result: any) => { .subscribe((result: any) => {
this.ITGCount = result.TotalCount;
this.totalRequestCount = this.totalRequestCount + result.TotalCount; this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.filters[5].value = result.TotalCount; this.filters[5].value = result.TotalCount;
}); });
} }
ITGNotification() { ITGNotification() {
// this.Details();
this.isAll = false; this.isAll = false;
this.isPR = false; this.isPR = false;
this.isPO = false; this.isPO = false;

@ -25,7 +25,7 @@
</ion-list-header> --> </ion-list-header> -->
<ion-radio-group> <ion-radio-group>
<ion-item *ngFor="let RepList of getRepList"> <ion-item lines="none" *ngFor="let RepList of getRepList">
<!-- <ion-col> --> <!-- <ion-col> -->
<ion-label>{{RepList.USER_NAME}}</ion-label> <ion-label>{{RepList.USER_NAME}}</ion-label>
<ion-label>{{RepList.EMPLOYEE_DISPLAY_NAME}}</ion-label> <ion-label>{{RepList.EMPLOYEE_DISPLAY_NAME}}</ion-label>

@ -8,7 +8,7 @@
<ion-content > <ion-content >
<ion-list style="margin-bottom:2px !important" [hidden]="isAnswer==true"> <ion-list style="margin-bottom:2px !important" [hidden]="isAnswer==true">
<ion-item> <ion-item lines="none">
<ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label> <ion-label class="boldTxtNav">{{'replacementRoll, searchBy' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}' <ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="searchBy"> [(ngModel)]="searchBy">

@ -199,7 +199,6 @@ export class WorkListReplacementRollComponent implements OnInit {
} }
submitAction() { submitAction() {
this.selEmp
if (this.selEmp && this.isAnswer == false) { if (this.selEmp && this.isAnswer == false) {
// this.selectedUserInf = this.ReplacementList[this.selEmp]; // this.selectedUserInf = this.ReplacementList[this.selEmp];
@ -212,6 +211,7 @@ export class WorkListReplacementRollComponent implements OnInit {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
this.modalCtrl.dismiss();
this.workListMainService.actionButton(this.WorkListActionObj). this.workListMainService.actionButton(this.WorkListActionObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -233,6 +233,7 @@ export class WorkListReplacementRollComponent implements OnInit {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = null; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = null;
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
this.modalCtrl.dismiss();
this.workListMainService.actionButton(this.WorkListActionObj). this.workListMainService.actionButton(this.WorkListActionObj).
subscribe((result: any) => { subscribe((result: any) => {
@ -252,10 +253,15 @@ export class WorkListReplacementRollComponent implements OnInit {
handleApplayActionResult(result) { handleApplayActionResult(result) {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (result.MessageStatus == 1) {
// let msg=this.translate.translate("general.success"); // let msg=this.translate.translate("general.success");
// this.cs.showAlert(msg); // this.cs.showAlert(msg);
// this.navCtrl.push("HomePage"); // this.navCtrl.push("HomePage");
// here show succsfull msg
this.cs.openNotificationPage(); this.cs.openNotificationPage();
}
} // valid it } // valid it
} }

@ -22,7 +22,7 @@
<ion-item> <ion-item lines="none">
<div class="square-container"> <div class="square-container">
<div (click)="select(rfcEmployeeList,i)" *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;" <div (click)="select(rfcEmployeeList,i)" *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;"
class="square"> class="square">

@ -100,6 +100,8 @@ export class WorkListRfcComponent implements OnInit {
this.WorkListActionObj.P_ACTION_MODE = "RFC"; this.WorkListActionObj.P_ACTION_MODE = "RFC";
this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr
this.WorkListActionObj.P_APPROVER_INDEX = this.seqNo; this.WorkListActionObj.P_APPROVER_INDEX = this.seqNo;
this.modalCtrl.dismiss();
this.workListMainService.actionButton(this.WorkListActionObj). this.workListMainService.actionButton(this.WorkListActionObj).
subscribe((result: any) => { subscribe((result: any) => {
this.handleApplayActionResult(result); this.handleApplayActionResult(result);
@ -126,6 +128,8 @@ export class WorkListRfcComponent implements OnInit {
// this.common.showAlert(msg); // this.common.showAlert(msg);
// this.navCtrl.push("HomePage"); // this.navCtrl.push("HomePage");
// this.cs.openHome(); // this.cs.openHome();
// here show succsfull msg
this.cs.openNotificationPage(); this.cs.openNotificationPage();
} }
} // valid it } // valid it

@ -327,7 +327,7 @@ export class WorklistMainMRComponent implements OnInit {
actionButton(action) { actionButton(action) {
console.log("actionButton" + action); console.log("actionButton" + action);
alert("don't forget"); // alert("don't forget");
//let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action; let ButtonAction: string = action;
var responseAttrDic = this.notExampleJsonObject; var responseAttrDic = this.notExampleJsonObject;

@ -364,7 +364,7 @@ export class WorklistMainPoComponent implements OnInit {
actionButton(action) { actionButton(action) {
console.log("actionButton" + action); console.log("actionButton" + action);
alert("don't forget"); // alert("don't forget");
//let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action; let ButtonAction: string = action;

@ -362,7 +362,7 @@ export class WorklistMainPRComponent implements OnInit {
actionButton(action) { actionButton(action) {
console.log("actionButton" + action); console.log("actionButton" + action);
alert("don't forget"); //alert("don't forget");
//let ButtonAction: string = this.actionType; //let ButtonAction: string = this.actionType;
let ButtonAction: string = action; let ButtonAction: string = action;

@ -324,6 +324,7 @@ export class WorklistMainComponent implements OnInit {
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
applyAction(WorkListActionObj) { applyAction(WorkListActionObj) {
console.log("MemberLoginList");
this.worklistMainService this.worklistMainService
.actionButton(WorkListActionObj) .actionButton(WorkListActionObj)
.subscribe((result: any) => { .subscribe((result: any) => {
@ -413,7 +414,7 @@ export class WorklistMainComponent implements OnInit {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_COMMENTS = "";
// this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,

@ -2,12 +2,13 @@ import { NgModule } from '@angular/core';
import { DateStringPipe } from './date-string/date-string'; import { DateStringPipe } from './date-string/date-string';
import { FilterLangPipe } from './filter-lang/filter-lang'; import { FilterLangPipe } from './filter-lang/filter-lang';
import { TurncatePipe } from './turncate/turncate.pipe'; import { TurncatePipe } from './turncate/turncate.pipe';
import{ JsonDatePipe} from './json-date/json-date'
@NgModule({ @NgModule({
declarations: [DateStringPipe, declarations: [DateStringPipe,JsonDatePipe,
FilterLangPipe, FilterLangPipe,
TurncatePipe], TurncatePipe],
imports: [], imports: [],
exports: [DateStringPipe, exports: [DateStringPipe,
FilterLangPipe,TurncatePipe] FilterLangPipe,TurncatePipe,JsonDatePipe]
}) })
export class PipesModule {} export class PipesModule {}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -767,7 +767,7 @@
"ar": "أنت تحاول حذف صف تم حذفه بالفعل." "ar": "أنت تحاول حذف صف تم حذفه بالفعل."
}, },
"noData": { "noData": {
"en": "There are no requests", "en": "No request found",
"ar": "لا توجد طلبات" "ar": "لا توجد طلبات"
}, },
"noFileSelect": { "noFileSelect": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -952,9 +952,9 @@ div.no-dataDiv{
border-color:var(--cusgray); border-color:var(--cusgray);
} }
h4 { h4 {
font-size: 2.2rem; font-size: 140%;
text-align: center; text-align: center;
color: var(--dark); color: #888888;
} }
.empty-data { .empty-data {
@ -1275,7 +1275,7 @@ border:0px
// } // }
.advanced-search-modal { .advanced-search-modal {
--height: 9cm !important; --height: 12cm !important;
--width: 88% !important; --width: 88% !important;
--border-radius: 0.6cm; --border-radius: 0.6cm;
} }
@ -1361,8 +1361,8 @@ border:0px
} }
.advanced-search-modal { .advanced-search-modal-custom {
--height: 12cm !important; --height: 9cm !important;
--width: 80% !important; --width: 80% !important;
--border-radius: 0.4cm; --border-radius: 0.4cm;
} }

Loading…
Cancel
Save