Merge branch 'master-newdesign' into work-list

arabic-version
umasoodch 6 years ago
commit d6dc300cf6

@ -15,11 +15,15 @@
<preference name="ScrollEnabled" value="false" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<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">
<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" />

@ -13,7 +13,7 @@
</ion-header>
<ion-content >
<ion-content class="colorBG">
<!-- colorBG -->
<div class="contentEit" style="background: #f3f1f1;">
<div class="header-div">
@ -148,7 +148,7 @@
<div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" >
<ion-row>
<img class="empty-data" src="../assets/imgs/noData.png"/>
<img class="empty-data" src="../assets/imgs/box.png"/>
</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 { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service";
import { DomSanitizer } from '@angular/platform-browser';
// import { SplashScreen } from '@ionic-native/splash-screen';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
@Component({
selector: "app-root",
@ -29,10 +32,12 @@ export class AppComponent implements OnInit, AfterViewInit {
companyDesc: string = "Powered By Cloud Solutions";
public direction = "ltr";
User_Job_name: string;
public logoutFlage: any =false;
requestGetLoginInfo: {
DeviceType: string; DeviceToken: string; //this.deviceToken
};
user: boolean;
deviceToken: string;
TeamFlag :string = "false";
constructor(
public ts: TranslatorService,
@ -44,7 +49,9 @@ export class AppComponent implements OnInit, AfterViewInit {
private menu: MenuController,
private authService: AuthenticationService,
private sanitizer: DomSanitizer,
public pushService: PushService
public pushService: PushService,
private splashScreen: SplashScreen
) {
this.events.subscribe("img-change", displayImg => {
console.log("app compont: "+displayImg);
@ -80,6 +87,11 @@ export class AppComponent implements OnInit, AfterViewInit {
private startReceivingPushService() {
console.log("platform.ready")
this.pushService.startReceiving();
setTimeout(() => {
console.log(" in setTimeout startReceiving");
this.getLastLoginInfo();
},4000);
}
subscribeEvents() {
this.events.subscribe("setMenu", () => {
@ -139,8 +151,14 @@ export class AppComponent implements OnInit, AfterViewInit {
}
logout() {
this.cs.sharedService.clearAll();
this.menu.toggle();
this.cs.openLogin();
//this.menu.toggle();
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();
}
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();
// }
}
});
}
}

@ -2,7 +2,7 @@ import { Component, OnInit, NgZone, OnDestroy } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
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 { 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";
@ -49,6 +49,8 @@ export class LoginComponent implements OnInit, OnDestroy {
user: boolean =false;
DeviceType: string;
requestGetLoginInfo:any;
logoutFlage: boolean ;
getuser:any="";
constructor(
public cs: CommonService,
@ -58,40 +60,89 @@ export class LoginComponent implements OnInit, OnDestroy {
public ts: TranslatorService,
public smsService: SmsReaderService,
private faio: FingerprintAIO,
public events:Events,
public ngZone: NgZone,
public device: Device,
public splash: SplashScreen,
public sharedData: SharedDataService,
public plt: Platform,
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() {
// this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
// 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');
console.log("let deviceToken" + this.deviceToken);
console.log("let deviceToken" + this.deviceToken);
if (this.deviceToken) {
console.log('login enabled first time: ' + 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);
// alert('login enabled second time: ' + this.deviceToken);
}, 1000);
}
setTimeout(() => {
// setTimeout(() => {
// alert("this.logoutFlage in setTime" +localStorage.getItem('logoutFlage'));
// alert("this.this.user in setTime" + this.user);
// if(localStorage.getItem('logoutFlage')== "true"){
// this.getLastLoginInfo();
this.getLastLoginInfo();
},5000);
// }
// },1000);
@ -355,12 +406,14 @@ export class LoginComponent implements OnInit, OnDestroy {
getLastLoginInfo(){
this.requestGetLoginInfo= {
DeviceType:this.cs.getDeviceType(),
DeviceType:this.cs.getDeviceType(),//"Android",//this.cs.getDeviceType(),
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],

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

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

@ -222,7 +222,12 @@ export class PushService {
this.firebasex.getToken().then(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);
}).catch(error => console.error('Error getting token', error));

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

@ -546,7 +546,7 @@ export class HomePage implements OnInit {
(result: OpenMissingSwipesResponse) => {
if (this.common.validResponse(result)) {
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);
}
}
);
@ -617,7 +617,7 @@ openPeriodDateDashbored() {
ITGCountAllNotification() {
this.workListService.getITGDetails().subscribe((result: any) => {
this.statsButtons[0].statsValue =
this.countAllNotification + result.TotalCount;
Math.floor(this.countAllNotification + result.TotalCount);
});
}
@ -697,7 +697,7 @@ getSubordinatesAttStatus() {
"HMG Annual Vacation Accrual Plan"
) {
this.statsButtons[2].statsValue =
accrualBalance.ACCRUAL_NET_ENTITLEMENT;
Math.floor(accrualBalance.ACCRUAL_NET_ENTITLEMENT);
this.common.sharedService.setSharedData(
accrualBalance,
"leaveAccrualBalance"
@ -715,7 +715,7 @@ getSubordinatesAttStatus() {
totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
}
}
this.statsButtons[3].statsValue = totalTicketsLeft;
this.statsButtons[3].statsValue = Math.floor(totalTicketsLeft);
}
});
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -868,9 +868,9 @@ div.no-dataDiv{
border-color:var(--cusgray);
}
h4 {
font-size: 2.2rem;
font-size: 140%;
text-align: center;
color: var(--dark);
color: #888888;
}
.empty-data {

Loading…
Cancel
Save