Merge branch 'work-list' of https://hmg.git.cloudforge.com/mohemmionic5 into work-list

MOE_DEV_NEW_TEMPORARY_DESIGN
Mohamed Mekawy 6 years ago
commit 23059e2fcc

@ -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">
@ -148,7 +148,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);
@ -57,6 +64,7 @@ export class AppComponent implements OnInit, AfterViewInit {
ngOnInit() { ngOnInit() {
this.initializeApp(); this.initializeApp();
} }
ngAfterViewInit() {} ngAfterViewInit() {}
initializeApp() { initializeApp() {
@ -79,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", () => {
@ -94,9 +107,13 @@ export class AppComponent implements OnInit, AfterViewInit {
? user.CompanyImageDescription ? user.CompanyImageDescription
: "Powered By Cloud Solutions"; : "Powered By Cloud Solutions";
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME; this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
if(this.cs.getUpdateImage().status){
this.user_image =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img);
}else{
this.user_image = user.EMPLOYEE_IMAGE this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE ? "data:image/png;base64," + user.EMPLOYEE_IMAGE
: "../assets/imgs/profile.png"; : "../assets/imgs/profile.png";
}
this.User_Job_name=user.JOB_NAME; this.User_Job_name=user.JOB_NAME;
console.log(user); console.log(user);
@ -134,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();
} }
@ -178,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>

@ -13,11 +13,11 @@
[ngClass]="{'content-class':accessFromOutSide, 'ion-padding': !accessFromOutSide}" has-bouncing="false" forceOverscroll="false" scrollY="false" class="ion-no-padding"> [ngClass]="{'content-class':accessFromOutSide, 'ion-padding': !accessFromOutSide}" has-bouncing="false" forceOverscroll="false" scrollY="false" class="ion-no-padding">
<ion-grid class="ion-justify-content-center"> <ion-grid class="ion-justify-content-center">
<ion-row *ngIf="!accessFromOutSide"> <!-- <ion-row *ngIf="!accessFromOutSide">
<ion-col [size]="4"> <ion-col [size]="4">
<img [src]="logo" class="logo" /> <img [src]="logo" class="logo" />
</ion-col> </ion-col>
</ion-row> </ion-row> -->
<ion-row class="description" *ngIf="!accessFromOutSide"> <ion-row class="description" *ngIf="!accessFromOutSide">
<ion-col size="12"> <ion-col size="12">
<!-- <type-writer *ngIf="onlySMSBox" [text]="'login,verify-login-with' | translate" class="description" <!-- <type-writer *ngIf="onlySMSBox" [text]="'login,verify-login-with' | translate" class="description"

@ -19,13 +19,13 @@
</div> </div>
</ion-row> </ion-row>
<ion-row *ngIf="user "> <!-- <ion-row *ngIf="user ">
<ion-col [size]="4"> <ion-col [size]="4">
<img [src]="logo" class="logo" /> <img [src]="logo" class="logo" />
<!-- <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img> --> <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col> </ion-col>
</ion-row> </ion-row> -->

@ -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],

@ -9,13 +9,13 @@
<ion-content padding> <ion-content padding>
<ion-grid> <ion-grid>
<ion-row> <!-- <ion-row>
<ion-col [size]="4"> <ion-col [size]="4">
<img [src]="logo" class="logo" /> <img [src]="logo" class="logo" />
<!-- <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img> --> <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col> </ion-col>
</ion-row> </ion-row> -->
<br/> <br/>
<br/> <br/>
<ion-row> <ion-row>

@ -5,7 +5,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'">
@ -157,7 +157,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>
@ -228,12 +228,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,5 +1,5 @@
<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>

@ -1,11 +1,3 @@
// .modalCss .modal-Wrapper {
// width: 600px;
// height: 300px;
// }
.chart-modal .modal-Wrapper { .chart-modal .modal-Wrapper {
--background: rgb(116, 108, 108) !important; --background: rgb(116, 108, 108) !important;
--border-color:white!important ; --border-color:white!important ;
@ -18,12 +10,9 @@
font-size: 10px !important; font-size: 10px !important;
--background: #22C6B3 !important; --background: #22C6B3 !important;
color: aliceblue !important; color: aliceblue !important;
// margin-top: 10px !important;
} }
.menu{ .menu {
// margin-left:330px !important;
margin-top: 0px !important; margin-top: 0px !important;
font-size: 35px !important; font-size: 35px !important;
background: #22C6B3; background: #22C6B3;
@ -33,7 +22,6 @@
} }
.person{ .person{
margin-left:100px !important; margin-left:100px !important;
margin-top: 0px !important; margin-top: 0px !important;
font-size: 23px !important; font-size: 23px !important;
@ -43,20 +31,19 @@
} }
.grid{ .grid{
margin-bottom: 550px !important; margin-bottom: 550px !important;
margin-top: 20px !important; margin-top: 20px !important;
margin-left: 15px !important; margin-left: 15px !important;
margin-right: 15px !important; margin-right: 15px !important;
background-color:white !important; background-color:white !important;
border-radius: 20px !important; border-radius: 20px !important;
height: 250px !important; height: 250px !important;
} }
.ionSliders{ .ionSliders{
margin: 0px !important; margin: 0px !important;
padding: 0px !important; padding: 0px !important;
}
}
.ionSlide{ .ionSlide{

@ -17,11 +17,6 @@ import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-re
styleUrls: ['./circle-calendar.component.scss'] styleUrls: ['./circle-calendar.component.scss']
}) })
export class CircleCalendarComponent implements OnInit { export class CircleCalendarComponent implements OnInit {
@Input() eventsdateDayOff: any = [];
@Input() eventsdateAttend: any = [];
@Input() eventsdateAbsent: any = [];
@Input() normalDays: any = [];
@Input() dayHoursTypeDetailsList: any = []; @Input() dayHoursTypeDetailsList: any = [];
@Input() currentDateParent: string; @Input() currentDateParent: string;
@Output() monthTitle = new EventEmitter(); @Output() monthTitle = new EventEmitter();
@ -86,10 +81,7 @@ export class CircleCalendarComponent implements OnInit {
} }
reRenderCalendar() { reRenderCalendar() {
this.renderDate(this.eventsdateAbsent, 'absent'); this.renderDate(this.dayHoursTypeDetailsList);
this.renderDate(this.eventsdateAttend, 'present');
this.renderDate(this.eventsdateDayOff, 'dayoff');
this.renderDate(this.normalDays, 'scheduleDay');
} }
public async dateModal(shiftDetails) { public async dateModal(shiftDetails) {
@ -106,14 +98,23 @@ export class CircleCalendarComponent implements OnInit {
await modal.present(); await modal.present();
} }
public renderDate(arrayDays, cssClass) { public renderDate(arrayDays) {
const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)'); const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)');
arrayDays.forEach(dateObj => { arrayDays.forEach(dateObj => {
const date = dateObj.startTime; const date = dateObj.customScheduleDate;
td.forEach(element => { td.forEach(element => {
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
if (date.getDate() == element.textContent.trim()) { if (date.getDate() == element.textContent.trim() && dateObj.customPresent === true) {
element.classList.add(cssClass); element.classList.add('present');
// tslint:disable-next-line: triple-equals
} else if (date.getDate() == element.textContent.trim() && dateObj.customAbsent === true) {
element.classList.add('absent');
// tslint:disable-next-line: triple-equals
} else if (date.getDate() == element.textContent.trim() && dateObj.customDaysOff === true) {
element.classList.add('dayoff');
// tslint:disable-next-line: triple-equals
} else if (date.getDate() == element.textContent.trim() && dateObj.customSchedule === true) {
element.classList.add('scheduleDay');
} }
}); });
}); });
@ -124,7 +125,7 @@ export class CircleCalendarComponent implements OnInit {
console.log(event.selectedTime.getDate()); console.log(event.selectedTime.getDate());
const selectedIndex = event.selectedTime.getDate(); const selectedIndex = event.selectedTime.getDate();
this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1]; this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1];
if (this.selectedIndexData.present) { if (this.selectedIndexData.customPresent) {
const rtpID = this.selectedIndexData.RTP_ID; const rtpID = this.selectedIndexData.RTP_ID;
this.getScheduleShiftDetails(rtpID); this.getScheduleShiftDetails(rtpID);
} }

@ -1,104 +1,100 @@
<ion-content>
<!-- <ion-slides [options]="slideOptsOne" (ionSlideDidChange)="slideChanged($event)"> <ion-slides [options]="slideOptsOne" (ionSlideDidChange)="slideChanged($event)" #slides>
<ion-slide *ngFor="let shift of SHIFTDETAILS.GetScheduleShiftsDetailsList; let i=index"> --> <ion-slide *ngFor="let shift of SHIFTDETAILS.GetScheduleShiftsDetailsList; let i=index">
<!-- <div> --> <ion-grid class="headerGrid">
<ion-grid class="headerGrid"> <ion-row style="padding: 5px 10px;">
<ion-row style="margin-left: -130px; margin-top: 27px;"> <ion-col size="8">
<ion-col size="10"> <div style="width: 100%;">
<div style="width: 100%;"> <div class="result-graph">
<div class="result-graph"> <div class="result-text-container">
<div class="result-text-container"> <h2 class="percentage">{{percentage}}</h2>
<h2 class="percentage">{{percentage}}</h2> <span>Completed <br><br><br><br></span>
<span>Completed <br><br><br><br></span> </div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div> </div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart> </div>
</div> </ion-col>
</div> <ion-col size="4">
</ion-col> <div class="div" >
<ion-col size="2"> <ion-row >
<div class="div" > <p class="p0">{{nameDay}}</p>
</ion-row>
<ion-row >
<p class="p1">{{day}}</p>
</ion-row>
<ion-row > <ion-row >
<p class="p0">{{nameDay}}</p> <p class="p2">{{nameMonth}}</p>
</ion-row> </ion-row>
<ion-row > <ion-row >
<p class="p1">{{day}}</p> <p class="p3">{{year}}</p>
</ion-row> </ion-row>
<ion-row > <ion-row>
<p class="p2">{{nameMonth}}</p> <p class="p5">{{ts.trPK('attendance','present')}}</p>
</ion-row> </ion-row>
<ion-row > </div>
<p class="p3">{{year}}</p> </ion-col>
</ion-row> </ion-row>
<ion-row>
<p class="p5">{{ts.trPK('attendance','present')}}</p>
</ion-row>
</div>
</ion-col>
</ion-row>
</ion-grid>
<div>
<ion-grid class="grid">
<ion-row class="gridrow"> <ion-row class="gridrow">
<ion-col class="liftcol"> <ion-col [size]="6" style="border-bottom: 1px solid #ccc; border-right: 1px solid #ccc;">
<ion-row class="amountlabel"> <p>{{shiftTime}}</p> </ion-row> <ion-row class="amountlabel"> <p>{{shiftTime}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','shift-time')}}</p> <p >{{ts.trPK('attendance-tracking','shift-time')}}</p>
</ion-row> </ion-row>
</ion-col> </ion-col>
<ion-col class="rightcol">
<ion-col [size]="6" style="border-bottom: 1px solid #ccc;">
<ion-row class="amountlabel"><p >{{scheduled}}</p> </ion-row> <ion-row class="amountlabel"><p >{{scheduled}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','regular')}}</p> <p >{{ts.trPK('attendance-tracking','regular')}}</p>
</ion-row> </ion-row>
</ion-col> </ion-col>
</ion-row>
<ion-row class="gridrow" >
<ion-col class="liftcol"> <ion-col [size]="6" style="border-bottom: 1px solid #ccc; border-right: 1px solid #ccc;">
<ion-row class="amountlabel"><p >{{startDate}}</p> </ion-row> <ion-row class="amountlabel"><p >{{startDate}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','check-in')}}</p> <p >{{ts.trPK('attendance-tracking','check-in')}}</p>
</ion-row> </ion-row>
</ion-col> </ion-col>
<ion-col class="rightcol">
<ion-col [size]="6" style="border-bottom: 1px solid #ccc;">
<ion-row class="amountlabel"> <p >{{endDate}}</p> </ion-row> <ion-row class="amountlabel"> <p >{{endDate}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','check-out')}} </p> <p >{{ts.trPK('attendance-tracking','check-out')}} </p>
</ion-row> </ion-row>
</ion-col> </ion-col>
</ion-row >
<ion-row class="gridrow"> <ion-col [size]="6" style="border-bottom: 1px solid #ccc; border-right: 1px solid #ccc;">
<ion-col class="liftcol">
<ion-row class="amountlabel"> <p >{{lateIn}}</p> </ion-row> <ion-row class="amountlabel"> <p >{{lateIn}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','late-in')}}</p> <p >{{ts.trPK('attendance-tracking','late-in')}}</p>
</ion-row> </ion-row>
</ion-col> </ion-col>
<ion-col class="rightcol">
<ion-col [size]="6" style="border-bottom: 1px solid #ccc;">
<ion-row class="amountlabel"> <p >{{excess}}</p> </ion-row> <ion-row class="amountlabel"> <p >{{excess}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','excess')}}</p> <p >{{ts.trPK('attendance-tracking','excess')}}</p>
</ion-row> </ion-row>
</ion-col> </ion-col>
</ion-row>
<ion-row class="gridrow"> <ion-col [size]="6" style="border-right: 1px solid #ccc;">
<ion-col class="liftcol">
<ion-row class="amountlabel"> <p >{{shortage}}</p> </ion-row> <ion-row class="amountlabel"> <p >{{shortage}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p>{{ts.trPK('attendance-tracking','shortage')}}</p> <p>{{ts.trPK('attendance-tracking','shortage')}}</p>
</ion-row> </ion-row>
</ion-col> </ion-col>
<ion-col class="rightcol">
<ion-col [size]="6">
<ion-row class="amountlabel"> <p >{{earlyOut}}</p> </ion-row> <ion-row class="amountlabel"> <p >{{earlyOut}}</p> </ion-row>
<ion-row class="rowlabel"> <ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','early-out')}}</p> <p >{{ts.trPK('attendance-tracking','early-out')}}</p>
</ion-row> </ion-row>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</div> </ion-slide>
<!-- </div> --> </ion-slides>
</ion-content>
<!-- </ion-slide>
</ion-slides> -->

@ -1,54 +1,23 @@
.result-text-container { .result-text-container {
// padding: 0;
// margin: 0;
// position: absolute;
// left: 50%;
// top: 50%;
// display: block;
// text-align: center;
// transform: translate(-50%, -50%);
//////////////////////////here
padding: 0; padding: 0;
margin: 0; margin: 0;
position: absolute; position: absolute;
left: 58%; left: 42%;
top: 67%; top: 60%;
display: block; display: block;
text-align: center; text-align: center;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
h2 { h2 {
font-size: 25px; font-size: 25px;
// font-family: WorkSans-Bold;
font-weight: bold; font-weight: bold;
margin: 0 auto; margin: 0 auto;
line-height: 36px; line-height: 36px;
} }
span { span {
width: 125px; width: 125px;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
font-size: 12px; font-size: 12px;
font-family: workSans-Regular; font-family: workSans-Regular;
color: rgb(163, 163, 163) !important; color: rgb(163, 163, 163) !important;
} }
@ -57,20 +26,26 @@
.today-graph{ .today-graph{
display: block; display: block;
height: 127px; height: 127px;
width: 288px; width: 270px;
margin-left: -60px;
} }
.amountlabel{ .amountlabel{
color: black !important; color: black !important;
font-weight: bold !important; font-weight: bold !important;
font-size: 13px !important; font-size: 13px !important;
// border-top: 1px solid rgb(163, 163, 163) !important; margin-bottom: -29px !important;
margin-left: 0px !important; width: 100%;
margin-bottom: -29px !important; display: block;
text-align: center;
} }
.rowlabel{ .rowlabel{
color: rgb(163, 163, 163) !important; color: #a3a3a3 !important;
font-size: 13px !important; font-size: 13px !important;
font-family: WorkSans-Bold; font-family: WorkSans-Bold;
display: block;
width: 100%;
text-align: center;
padding: 1px;
} }
.grid{ .grid{
padding-bottom: -20px !important; padding-bottom: -20px !important;
@ -95,24 +70,15 @@ height: 360px !important;
} }
.div{ .div{
// border: 1px solid #a3a3a3 !important;
// text-align: center;
// width: 274%;
// border-radius: 8%;
// height: 40%;
// margin-right: -11px;
border: 1px solid #a3a3a3 !important; border: 1px solid #a3a3a3 !important;
border-radius: 9px; border-radius: 10px;
width: 241%; margin-bottom:10px;
margin-right: -226px;
} }
.p0{ .p0{
margin-bottom: -13px !important; margin-bottom: -13px !important;
color: black !important; color: black !important;
font-weight: bold !important; font-weight: bold !important;
font-size: 15px !important; font-size: 14px !important;
margin-top: 8px; margin-top: 8px;
text-align: center; text-align: center;
display: block; display: block;
@ -128,22 +94,28 @@ height: 360px !important;
display: block; display: block;
width: 100%; width: 100%;
} }
.p2{ font-weight: bold !important; .p2{
font-weight: bold !important;
font-size: 17px !important; font-size: 17px !important;
margin-bottom: 43px !important; margin-bottom: 43px !important;
margin-top: 0px !important; margin-top: 0px !important;
color: black !important; color: black !important;
font-weight: bold !important; font-weight: bold !important;
margin-left: 33px; text-align: center;
} display: block;
.p3{ /* margin-bottom: -72px !important; */ width: 100%;
}
.p3{
color: black !important; color: black !important;
font-weight: bold !important; font-weight: bold !important;
font-size: 19px; font-size: 19px;
margin-top: -43px; margin-top: -43px;
margin-left: 27px; text-align: center;
display: block;
width: 100%;
} }
.p4{ margin-bottom: 56px !important; .p4{
margin-bottom: 56px !important;
margin-top: -26px !important; margin-top: -26px !important;
color: black !important; color: black !important;
} }
@ -158,23 +130,7 @@ height: 360px !important;
height: 21px; height: 21px;
width: 110px; width: 110px;
padding-top: 7px; padding-top: 7px;
/* font-family: WorkSans-Bold !important; */
padding-bottom: 21px; padding-bottom: 21px;
border-bottom-left-radius: 5px; border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px; border-bottom-right-radius: 5px;
} }
// .less{ background-color: #22C6B3;
// background-color: #22C6B3;
// border: none;
// color: white;
// text-align: center;
// text-decoration: none;
// display: inline-block;
// font-size: 12px;
// border-radius: 30px;
// height: 26px;
// padding: 6px 24px;
// margin-left: 123px;
// /* margin-top: -19px; */
// margin-bottom: 17px;
// }

@ -98,7 +98,7 @@ export class DateInfoModalComponent implements OnInit {
slideChanged(ev) { slideChanged(ev) {
this.slides.getActiveIndex().then(index => { this.slides.getActiveIndex().then(index => {
const shiftDetails = this.SHIFTDETAILS[index]; const shiftDetails = this.SHIFTDETAILS.GetScheduleShiftsDetailsList[index];
this.assignData(shiftDetails); this.assignData(shiftDetails);
}); });
} }

@ -1,6 +1,6 @@
<div class="team-member-container"> <div class="team-member-container">
<ion-row> <ion-row>
<ion-col [size]="3"> <ion-col [size]="3" (click)="getDetails()">
<div class="user-image-container"> <div class="user-image-container">
<div class="user-image"> <div class="user-image">
<img [src]="employeeImage" alt="Team Member Image"/> <img [src]="employeeImage" alt="Team Member Image"/>
@ -9,11 +9,11 @@
</ion-col> </ion-col>
<ion-col [size]="9" style="padding: 8px 5px 0px;margin-top: 14px;"> <ion-col [size]="9" style="padding: 8px 5px 0px;margin-top: 14px;">
<div> <div>
<span class="employee-name"> <span class="employee-name" (click)="getDetails()">
<h2 class="name">{{name}}</h2> <h2 class="name">{{name}}</h2>
<span class="title">{{title}}</span> <span class="title">{{title}}</span>
</span> </span>
<a class="image-container" href="tel:{{employeePhoneNumber}}"> <a [ngClass]="employeePhoneNumber == '' ? 'disable-phone image-container' : 'image-container'" href="tel:{{employeePhoneNumber}}">
<img src="../assets/imgs/green_call_icon.png" > <img src="../assets/imgs/green_call_icon.png" >
</a> </a>
</div> </div>

@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
@Component({ @Component({
selector: 'app-employee-information', selector: 'app-employee-information',
@ -12,10 +12,15 @@ export class EmployeeInformationComponent implements OnInit {
@Input() title: string; @Input() title: string;
@Input() employeeImage: string; @Input() employeeImage: string;
@Input() employeePhoneNumber: string; @Input() employeePhoneNumber: string;
// tslint:disable-next-line: no-output-on-prefix
@Output() onGetDetails = new EventEmitter();
constructor() { } constructor() { }
ngOnInit() {} ngOnInit() {}
getDetails() {
this.onGetDetails.emit();
}
} }

@ -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");

@ -320,9 +320,13 @@ export class HomePage implements OnInit {
this.userData, this.userData,
AuthenticatedUser.SHARED_DATA AuthenticatedUser.SHARED_DATA
); );
if(this.common.getUpdateImage().status){
this.userImage =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.common.getUpdateImage().img);
}else{
this.userImage = user.EMPLOYEE_IMAGE this.userImage = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.userImage; : this.userImage;
}
this.callDashboardServices(); this.callDashboardServices();
} else { } else {
console.log(user); console.log(user);
@ -542,7 +546,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);
} }
} }
); );
@ -613,7 +617,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);
}); });
} }
@ -693,7 +697,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"
@ -711,7 +715,7 @@ getSubordinatesAttStatus() {
totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
} }
} }
this.statsButtons[3].statsValue = totalTicketsLeft; this.statsButtons[3].statsValue = Math.floor(totalTicketsLeft);
} }
}); });
} }

@ -23,7 +23,7 @@
<ion-row class="ion-justify-content-center"> <ion-row class="ion-justify-content-center">
<ion-col [size]="4"> <ion-col [size]="4">
<div class="action-button col-button"> <div class="action-button col-button">
<a class="action-button-icon" href="tel:{{employee.EMPLOYEE_MOBILE_NUMBER}}"> <a [ngClass]="employee.EMPLOYEE_MOBILE_NUMBER == '' ? 'disable-phone action-button-icon' : 'action-button-icon'" href="tel:{{employee.EMPLOYEE_MOBILE_NUMBER}}">
<img src="../assets/imgs/call_icon.png"> <img src="../assets/imgs/call_icon.png">
</a> </a>
<span>Call</span> <span>Call</span>
@ -174,12 +174,8 @@
<div *ngIf="showData" class="calendar-container"> <div *ngIf="showData" class="calendar-container">
<span> {{ts.trPK('attendance','monthly-attendance-calendar')}}</span> <span> {{ts.trPK('attendance','monthly-attendance-calendar')}}</span>
<app-circle-calendar <app-circle-calendar
[eventsdateAttend]='arrDaysAttendance'
[eventsdateAbsent]='arrDaysAbsent'
[eventsdateDayOff]='arrDaysOff'
[currentDateParent]="currentDate" [currentDateParent]="currentDate"
[dayHoursTypeDetailsList]="dayHoursTypeDetailsList" [dayHoursTypeDetailsList]="dayHoursTypeDetailsList"
[normalDays]="normalDays"
(monthTitle)='changeMonthTitle($event)' (monthTitle)='changeMonthTitle($event)'
(currentYear)=changeYear($event)> (currentYear)=changeYear($event)>
</app-circle-calendar> </app-circle-calendar>
@ -223,7 +219,7 @@
[title]="subordinate.POSITION_NAME" [title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'" [employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER" [employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(click)="getDetails(i)"> (onGetDetails)="getDetails(i)">
</app-employee-information> </app-employee-information>
</ng-container> </ng-container>

@ -54,10 +54,6 @@ export class DetailsComponent implements OnInit {
public attendedDays: number; public attendedDays: number;
public futrueDays = 0; public futrueDays = 0;
public totalAttendancePrecentage = 0; public totalAttendancePrecentage = 0;
public arrDaysAttendance: any = [];
public arrDaysAbsent: any = [];
public arrDaysOff: any = [];
public normalDays: any = [];
public monthTitle: string = moment().format('MMMM'); public monthTitle: string = moment().format('MMMM');
public yearTitle: string; public yearTitle: string;
public activeMonth: any; public activeMonth: any;
@ -120,7 +116,6 @@ export class DetailsComponent implements OnInit {
public segmentChanged(event: any) { public segmentChanged(event: any) {
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
if (this.activeSegment === 'Attendance') { if (this.activeSegment === 'Attendance') {
this.normalDays = [];
this.initAttendance(); this.initAttendance();
} }
} }
@ -132,19 +127,11 @@ export class DetailsComponent implements OnInit {
this.currentDate = new Date(); this.currentDate = new Date();
this.showData = false; this.showData = false;
this.nextMonth = new Date().getMonth() + 2; this.nextMonth = new Date().getMonth() + 2;
this.preMonth = new Date().getMonth() - 2; this.preMonth = new Date().getMonth();
if (this.preMonth < 0) {
this.preMonth = this.preMonth * - 1;
} else {
this.preMonth = this.preMonth * - 1;
}
this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear()); this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear());
} }
calendarConfig(month?, year?) { calendarConfig(month?, year?) {
this.arrDaysOff = [];
this.arrDaysAttendance = [];
this.arrDaysAbsent = [];
this.month = month; this.month = month;
this.year = year; this.year = year;
this.getTimeCardSummaryDetails(month, year); this.getTimeCardSummaryDetails(month, year);
@ -174,14 +161,12 @@ export class DetailsComponent implements OnInit {
console.log(result.GetDayHoursTypeDetailsList); console.log(result.GetDayHoursTypeDetailsList);
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
this.countAllAttendDays(result.GetDayHoursTypeDetailsList); this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList;
} }
}); });
} }
nextSlide() { nextSlide() {
this.normalDays = [];
if (this.currentMonthName !== this.month) { if (this.currentMonthName !== this.month) {
this.showData = false; this.showData = false;
if (this.nextMonth > 12) { if (this.nextMonth > 12) {
@ -196,7 +181,6 @@ export class DetailsComponent implements OnInit {
} }
previousSlide() { previousSlide() {
this.normalDays = [];
this.showData = false; this.showData = false;
if (this.preMonth === 0) { if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1; this.currentYear = this.currentYear - 1;
@ -210,6 +194,7 @@ export class DetailsComponent implements OnInit {
} }
changeMonthTitle(title) { changeMonthTitle(title) {
this.monthTitle = title; this.monthTitle = title;
this.getTimeCardSummaryDetails(); this.getTimeCardSummaryDetails();
@ -223,48 +208,35 @@ export class DetailsComponent implements OnInit {
for (let i = 0; i < allDays.length; i++) { for (let i = 0; i < allDays.length; i++) {
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
if (allDays[i].ATTENDED_FLAG == 'Y') { if (allDays[i].ATTENDED_FLAG == 'Y') {
allDays[i].present = true; allDays[i].customPresent = true;
allDays[i].absent = false; allDays[i].customAbsent = false;
allDays[i].daysOff = false; allDays[i].customDaysOff = false;
allDays[i].schedule = false; allDays[i].customSchedule = false;
this.arrDaysAttendance.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') { } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
allDays[i].present = false; allDays[i].customPresent = false;
allDays[i].absent = true; allDays[i].customAbsent = true;
allDays[i].daysOff = false; allDays[i].customDaysOff = false;
allDays[i].schedule = false; allDays[i].customSchedule = false;
this.arrDaysAbsent.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE),
isoTime: '09:00:00',
allDay: false
});
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') { } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
allDays[i].present = false; allDays[i].customPresent = false;
allDays[i].absent = false; allDays[i].customAbsent = false;
allDays[i].daysOff = true; allDays[i].customDaysOff = true;
allDays[i].schedule = false; allDays[i].customSchedule = false;
this.arrDaysOff.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
} else { } else {
allDays[i].present = false; allDays[i].customPresent = false;
allDays[i].absent = false; allDays[i].customAbsent = false;
allDays[i].daysOff = false; allDays[i].customDaysOff = false;
allDays[i].schedule = true; allDays[i].customSchedule = true;
this.normalDays.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
} }
} }
this.showData = true; this.showData = true;
this.dayHoursTypeDetailsList = allDays;
} }
public getTimeCardSummaryDetails(month?, year?) { public getTimeCardSummaryDetails(month?, year?) {

@ -69,7 +69,7 @@
[title]="subordinate.POSITION_NAME" [title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'" [employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER" [employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(click)="getDetails(i)"> (onGetDetails)="getDetails(i)">
</app-employee-information> </app-employee-information>
</ng-container> </ng-container>

@ -14,11 +14,16 @@
<div class="request-heading"> <div class="request-heading">
<span>Open Request Analysis</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 *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> <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">
@ -61,32 +66,35 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<div [ngClass]="isEmptyObject() ? 'work-list-container' : ''" *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 class="date-span">{{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 [ngClass]="isEmptyObject() ? 'work-list-container' : ''" *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 class="date-span">{{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>No Data Available</span>
</div>
</div> </div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <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>

@ -333,6 +333,8 @@ ion-content {
margin-top: 15px; margin-top: 15px;
display: block; display: block;
padding: 0 20px; padding: 0 20px;
position: relative;
z-index: 99;
ion-col{ ion-col{
background: white; background: white;
border-radius: 12px; border-radius: 12px;
@ -382,9 +384,8 @@ ion-content {
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;

@ -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,54 +165,61 @@ export class HomeComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
// this.direction = TranslatorService.getCurrentDirection(); this.openNotificationsDashboard();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); }
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);
}
} }
} }
@ -230,13 +249,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;
@ -245,7 +264,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;
@ -268,7 +287,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') {
@ -277,7 +296,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);
@ -286,24 +304,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()
); );
} }
@ -330,9 +407,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 = [];
@ -340,22 +418,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();
@ -366,7 +440,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 = '';
@ -413,13 +488,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;

@ -257,6 +257,7 @@
<div class="hrTitle"> {{ts.trPK('payslip','payment-information')}} </div> <div class="hrTitle"> {{ts.trPK('payslip','payment-information')}} </div>
<div *ngIf="GetPaymentInformationList !=''"> <div *ngIf="GetPaymentInformationList !=''">
<div *ngFor="let paymentInfo of GetPaymentInformationList">
<ion-grid class="grids" > <ion-grid class="grids" >
<ion-row class="rowtables"> <ion-row class="rowtables">
<ion-col class="colPayslips"> <ion-col class="colPayslips">
@ -265,7 +266,7 @@
</ion-row> </ion-row>
<ion-row> <ion-row>
<label class="label" for="">{{GetPaymentInformationList.PAYMENT_METHOD_NAME}}</label> <label class="label" for="">{{paymentInfo.PAYMENT_METHOD_NAME}}</label>
</ion-row> </ion-row>
</ion-col> </ion-col>
@ -276,7 +277,7 @@
<label class="label" for="">{{ts.trPK('payslip','bank-name')}} </label> <label class="label" for="">{{ts.trPK('payslip','bank-name')}} </label>
</ion-row> </ion-row>
<ion-row > <ion-row >
<label class="label" for="">{{GetPaymentInformationList.BANK_NAME}}</label> <label class="label" for="">{{paymentInfo.BANK_NAME}}</label>
</ion-row> </ion-row>
</ion-col> </ion-col>
<ion-col class="colPayslips"> <ion-col class="colPayslips">
@ -285,7 +286,7 @@
</label> </label>
</ion-row> </ion-row>
<ion-row > <ion-row >
<label class="label" for="">{{GetPaymentInformationList.BRANCH_NAME}}</label> <label class="label" for="">{{paymentInfo.BRANCH_NAME}}</label>
</ion-row> </ion-row>
</ion-col> </ion-col>
</ion-row> </ion-row>
@ -297,7 +298,7 @@
</label> </label>
</ion-row> </ion-row>
<ion-row > <ion-row >
<label class="label" for="">{{GetPaymentInformationList.ACCOUNT_NUMBER}}</label> <label class="label" for="">{{paymentInfo.ACCOUNT_NUMBER}}</label>
</ion-row> </ion-row>
</ion-col> </ion-col>
<ion-col class="colPayslips"> <ion-col class="colPayslips">
@ -306,10 +307,11 @@
</label> </label>
</ion-row> </ion-row>
<ion-row > <ion-row >
<label class="label" for="">{{GetPaymentInformationList.AMOUNT}}</label> <label class="label" for="">{{paymentInfo.AMOUNT}}</label>
</ion-row> </ion-row>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</div> </div>
</div>
</ion-content> </ion-content>

@ -257,7 +257,7 @@ getPaymentInfo(ActionContextID){
handleGetPaymentInfoResult(result){ handleGetPaymentInfoResult(result){
if (result.GetPaymentInformationList != null) { if (result.GetPaymentInformationList != null) {
this.GetPaymentInformationList = result.GetPaymentInformationList[0]; this.GetPaymentInformationList = result.GetPaymentInformationList;
} }
} }

@ -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 {}

@ -7,6 +7,7 @@ import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/mo
import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response'; import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { DomSanitizer } from '@angular/platform-browser';
// import { DomSanitizer } from '@angular/platform-browser'; // import { DomSanitizer } from '@angular/platform-browser';
@ -35,17 +36,19 @@ export class EditProfileComponent implements OnInit {
public cs: CommonService, public cs: CommonService,
public authService: AuthenticationService, public authService: AuthenticationService,
public DS :DashboredService, public DS :DashboredService,
public sharedData: SharedDataService public sharedData: SharedDataService,
public events: Events,
private sanitizer: DomSanitizer,
// private events: Events, // private events: Events,
// private sanitizer: DomSanitizer, // private sanitizer: DomSanitizer,
) )
{ {
// this.events.subscribe("img-change", displayImg => { this.events.subscribe("img-change", displayImg => {
// console.log("app compont: "+displayImg); console.log("app compont: "+displayImg);
// this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg); this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg);
// }); });
} }
@ -63,9 +66,13 @@ export class EditProfileComponent implements OnInit {
this.personalInfo = user; this.personalInfo = user;
this.User_name_Emp=this.personalInfo.EMPLOYEE_NAME; this.User_name_Emp=this.personalInfo.EMPLOYEE_NAME;
this.User_Job_name=this.personalInfo.JOB_NAME; this.User_Job_name=this.personalInfo.JOB_NAME;
if(this.cs.getUpdateImage().status){
this.user_image =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img);
}else{
this.user_image = user.EMPLOYEE_IMAGE this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE ? "data:image/png;base64," + user.EMPLOYEE_IMAGE
: "../assets/imgs/profile.png"; : "../assets/imgs/profile.png";
}
console.log("name: "+ this.personalInfo.EMPLOYEE_NAME); console.log("name: "+ this.personalInfo.EMPLOYEE_NAME);
console.log("user name: "+ user.EMPLOYEE_NAME); console.log("user name: "+ user.EMPLOYEE_NAME);
console.log("name: "+ this.personalInfo.JOB_NAME); console.log("name: "+ this.personalInfo.JOB_NAME);

@ -51,8 +51,7 @@ export class HomeComponent implements OnInit {
if(this.cs.getUpdateImage().status){ if(this.cs.getUpdateImage().status){
// this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+this.cs.getUpdateImage().img); // this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+this.cs.getUpdateImage().img);
this.imageSrc = "data:image/png;base64,"+this.cs.getUpdateImage().img; this.imageSrc =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img);
// alert("this.imageSrc"+ this.imageSrc);
}else{ }else{
this.imageSrc = user.EMPLOYEE_IMAGE this.imageSrc = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE ? "data:image/png;base64," + user.EMPLOYEE_IMAGE

@ -84,12 +84,8 @@
<div *ngIf="showData" class="calendar-container"> <div *ngIf="showData" class="calendar-container">
<span> {{ts.trPK('attendance','monthly-attendance-calendar')}}</span> <span> {{ts.trPK('attendance','monthly-attendance-calendar')}}</span>
<app-circle-calendar <app-circle-calendar
[eventsdateAttend]='arrDaysAttendance'
[eventsdateAbsent]='arrDaysAbsent'
[eventsdateDayOff]='arrDaysOff'
[currentDateParent]="currentDate" [currentDateParent]="currentDate"
[dayHoursTypeDetailsList]="dayHoursTypeDetailsList" [dayHoursTypeDetailsList]="dayHoursTypeDetailsList"
[normalDays]="normalDays"
(monthTitle)='changeMonthTitle($event)' (monthTitle)='changeMonthTitle($event)'
(currentYear)=changeYear($event)> (currentYear)=changeYear($event)>
</app-circle-calendar> </app-circle-calendar>

@ -53,9 +53,6 @@ export class TimeCardDetailsComponent implements OnInit {
public attendedDays: number; public attendedDays: number;
public futrueDays = 0; public futrueDays = 0;
public totalAttendancePrecentage = 0; public totalAttendancePrecentage = 0;
public arrDaysAttendance: any = [];
public arrDaysAbsent: any = [];
public arrDaysOff: any = [];
public monthTitle: string = moment().format('MMMM'); public monthTitle: string = moment().format('MMMM');
public yearTitle: string; public yearTitle: string;
public isChange = false; public isChange = false;
@ -64,7 +61,6 @@ export class TimeCardDetailsComponent implements OnInit {
public showData = false; public showData = false;
public currentYear = new Date().getFullYear(); public currentYear = new Date().getFullYear();
public dayHoursTypeDetailsList = []; public dayHoursTypeDetailsList = [];
public normalDays: any = [];
public currentDate = new Date(); public currentDate = new Date();
public options = { public options = {
cutoutPercentage: 80, cutoutPercentage: 80,
@ -76,19 +72,11 @@ export class TimeCardDetailsComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.showData = false; this.showData = false;
this.nextMonth = new Date().getMonth() + 2; this.nextMonth = new Date().getMonth() + 2;
this.preMonth = new Date().getMonth() - 2; this.preMonth = new Date().getMonth();
if (this.preMonth < 0) {
this.preMonth = this.preMonth * - 1;
} else {
this.preMonth = this.preMonth * - 1;
}
this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear()); this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear());
} }
calendarConfig(month?, year?) { calendarConfig(month?, year?) {
this.arrDaysOff = [];
this.arrDaysAttendance = [];
this.arrDaysAbsent = [];
this.month = month; this.month = month;
this.year = year; this.year = year;
this.getTimeCardSummaryDetails(month, year); this.getTimeCardSummaryDetails(month, year);
@ -118,7 +106,6 @@ export class TimeCardDetailsComponent implements OnInit {
console.log(result.GetDayHoursTypeDetailsList); console.log(result.GetDayHoursTypeDetailsList);
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
this.countAllAttendDays(result.GetDayHoursTypeDetailsList); this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList;
} }
}); });
@ -129,48 +116,35 @@ export class TimeCardDetailsComponent implements OnInit {
for (let i = 0; i < allDays.length; i++) { for (let i = 0; i < allDays.length; i++) {
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
if (allDays[i].ATTENDED_FLAG == 'Y') { if (allDays[i].ATTENDED_FLAG == 'Y') {
allDays[i].present = true; allDays[i].customPresent = true;
allDays[i].absent = false; allDays[i].customAbsent = false;
allDays[i].daysOff = false; allDays[i].customDaysOff = false;
allDays[i].schedule = false; allDays[i].customSchedule = false;
this.arrDaysAttendance.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') { } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
allDays[i].present = false; allDays[i].customPresent = false;
allDays[i].absent = true; allDays[i].customAbsent = true;
allDays[i].daysOff = false; allDays[i].customDaysOff = false;
allDays[i].schedule = false; allDays[i].customSchedule = false;
this.arrDaysAbsent.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE),
isoTime: '09:00:00',
allDay: false
});
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') { } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
allDays[i].present = false; allDays[i].customPresent = false;
allDays[i].absent = false; allDays[i].customAbsent = false;
allDays[i].daysOff = true; allDays[i].customDaysOff = true;
allDays[i].schedule = false; allDays[i].customSchedule = false;
this.arrDaysOff.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
} else { } else {
allDays[i].present = false; allDays[i].customPresent = false;
allDays[i].absent = false; allDays[i].customAbsent = false;
allDays[i].daysOff = false; allDays[i].customDaysOff = false;
allDays[i].schedule = true; allDays[i].customSchedule = true;
this.normalDays.push({ allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
} }
} }
this.showData = true; this.showData = true;
this.dayHoursTypeDetailsList = allDays;
} }
public getTimeCardSummaryDetails(month?, year?) { public getTimeCardSummaryDetails(month?, year?) {
@ -218,9 +192,7 @@ export class TimeCardDetailsComponent implements OnInit {
}); });
} }
nextSlide() { nextSlide() {
this.normalDays = [];
if (this.currentMonthName !== this.month) { if (this.currentMonthName !== this.month) {
this.showData = false; this.showData = false;
if (this.nextMonth > 12) { if (this.nextMonth > 12) {
@ -235,7 +207,6 @@ export class TimeCardDetailsComponent implements OnInit {
} }
previousSlide() { previousSlide() {
this.normalDays = [];
this.showData = false; this.showData = false;
if (this.preMonth === 0) { if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1; this.currentYear = this.currentYear - 1;

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

@ -868,9 +868,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 {
@ -1191,7 +1191,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;
} }
@ -1277,19 +1277,16 @@ 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;
} }
.calendar-modal { .calendar-modal {
--height: 15cm !important; --height: 13.5cm !important;
--width: 88% !important; --width: 88% !important;
--border-radius: 0.4cm; --border-radius: 0.4cm;
// height: 544px !important;
// width: 332px !important;
} }
@ -1412,6 +1409,11 @@ table.monthview-datetable th small {
border-radius: 20px !important; border-radius: 20px !important;
} }
.disable-phone {
pointer-events: none;
opacity: .3;
}
// .replaceRoll-modal { // .replaceRoll-modal {
// padding: 30% 1% !important; // padding: 30% 1% !important;

Loading…
Cancel
Save