From 2a759205655bcfca7b6032f46a2dc5a8f1cb95e5 Mon Sep 17 00:00:00 2001 From: ashwaq Date: Mon, 18 Nov 2019 10:16:03 +0300 Subject: [PATCH 1/3] Confirm Login by SMS,Whatsapp,fingerprint and faceID --- Mohem/src/app/app.component.ts | 9 +- Mohem/src/app/app.module.ts | 2 + .../authentication/authentication.module.ts | 9 +- .../confirm-login.component.html | 50 +++ .../confirm-login.component.scss | 0 .../confirm-login.component.spec.ts | 27 ++ .../confirm-login/confirm-login.component.ts | 379 ++++++++++++++++++ .../authentication/login/login.component.ts | 7 +- .../models/sendActivationByType.ts | 34 ++ .../authentication/sms-page/sms-page.page.ts | 41 +- .../authentication/authentication.service.ts | 40 +- .../models/get-login-info.request.ts | 40 +- .../models/get-login-info.response.ts | 4 +- .../authentication/models/smscheck.request.ts | 2 + .../services/common/common.service.ts | 7 +- .../services/connector/connector.service.ts | 4 +- .../app/hmg-common/services/models/request.ts | 4 + .../hmg-common/services/push/push.service.ts | 63 ++- .../ui/button/button.component.html | 3 +- .../ui/button/button.component.scss | 10 +- .../hmg-common/ui/button/button.component.ts | 27 +- .../worklist-main/worklist-main.component.ts | 9 +- .../app/payslip/service/payslip.service.ts | 2 +- Mohem/src/assets/icon/login/101.png | Bin 0 -> 3484 bytes Mohem/src/assets/icon/login/102.png | Bin 0 -> 3991 bytes Mohem/src/assets/icon/login/103.png | Bin 0 -> 2377 bytes Mohem/src/assets/icon/login/104.png | Bin 0 -> 4981 bytes Mohem/src/assets/localization/i18n.json | 40 ++ 28 files changed, 756 insertions(+), 57 deletions(-) create mode 100644 Mohem/src/app/authentication/confirm-login/confirm-login.component.html create mode 100644 Mohem/src/app/authentication/confirm-login/confirm-login.component.scss create mode 100644 Mohem/src/app/authentication/confirm-login/confirm-login.component.spec.ts create mode 100644 Mohem/src/app/authentication/confirm-login/confirm-login.component.ts create mode 100644 Mohem/src/app/authentication/models/sendActivationByType.ts create mode 100644 Mohem/src/assets/icon/login/101.png create mode 100644 Mohem/src/assets/icon/login/102.png create mode 100644 Mohem/src/assets/icon/login/103.png create mode 100644 Mohem/src/assets/icon/login/104.png diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index b1132673..58867d67 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -7,7 +7,7 @@ import { AuthenticatedUser } from "./hmg-common/services/authentication/models/a import { TabsBarComponent } from "./hmg-common/ui/tabs-bar/tabs-bar.component"; import { KeyboardService } from "./hmg-common/services/keyboard/keyboard.service"; import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response"; - +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'; @@ -38,6 +38,7 @@ export class AppComponent implements OnInit, AfterViewInit { private menu: MenuController, private authService: AuthenticationService, private sanitizer: DomSanitizer, + public pushService: PushService, ) { this.events.subscribe("img-change", displayImg => { @@ -50,6 +51,7 @@ export class AppComponent implements OnInit, AfterViewInit { } ngOnInit() { this.initializeApp(); + this.startReceivingPushService(); } ngAfterViewInit() {} initializeApp() { @@ -66,6 +68,11 @@ export class AppComponent implements OnInit, AfterViewInit { }); }); } + + private startReceivingPushService() { + this.pushService.startReceiving(); + +} subscribeEvents() { this.events.subscribe("setMenu", () => { const user = this.authService diff --git a/Mohem/src/app/app.module.ts b/Mohem/src/app/app.module.ts index 6b711832..499bf89d 100644 --- a/Mohem/src/app/app.module.ts +++ b/Mohem/src/app/app.module.ts @@ -5,6 +5,7 @@ import { HmgCommonModule } from './hmg-common/hmg-common.module'; import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { StatusBar } from '@ionic-native/status-bar/ngx'; +import { OneSignal } from '@ionic-native/onesignal/ngx'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; @@ -36,6 +37,7 @@ import { Base64 } from "@ionic-native/base64/ngx"; File, FilePath, Base64, + OneSignal, { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } ], bootstrap: [AppComponent] diff --git a/Mohem/src/app/authentication/authentication.module.ts b/Mohem/src/app/authentication/authentication.module.ts index 143e3a67..520c6c77 100644 --- a/Mohem/src/app/authentication/authentication.module.ts +++ b/Mohem/src/app/authentication/authentication.module.ts @@ -20,7 +20,7 @@ import { SmsPageModule } from 'src/app/hmg-common/ui/sms/sms.module'; import { SmsPageComponent } from './sms-page/sms-page.page'; import { CheckUserComponent } from './check-user/check-user.component'; import { ChangePasswordComponent } from './change-password/change-password.component'; - +import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component' const routes: Routes = [ @@ -47,6 +47,10 @@ const routes: Routes = [ { path: 'changepassowrd', component: ChangePasswordComponent + }, + { + path: 'confirmLogin', + component: ConfirmLoginComponent } ] } @@ -72,7 +76,8 @@ const routes: Routes = [ ForgotComponent, SmsPageComponent, CheckUserComponent, - ChangePasswordComponent + ChangePasswordComponent, + ConfirmLoginComponent ], providers:[ FingerprintAIO, diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html new file mode 100644 index 00000000..794c4955 --- /dev/null +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html @@ -0,0 +1,50 @@ + + + + + + {{'login,verify-login' | translate}} + + + + + + + + + + + + + + + + +

{{ts.trPK('login','verify-login-with')}}

+ +

{{ts.trPK('login','verify-fingerprint')}}

+ + +
+
+ + + + + + + + + + + + +
+ +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.scss b/Mohem/src/app/authentication/confirm-login/confirm-login.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.spec.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.spec.ts new file mode 100644 index 00000000..a332e7d1 --- /dev/null +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConfirmLoginComponent } from './confirm-login.component'; + +describe('ConfirmLoginComponent', () => { + let component: ConfirmLoginComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ConfirmLoginComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfirmLoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts new file mode 100644 index 00000000..aebf22af --- /dev/null +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -0,0 +1,379 @@ +import { Component, OnInit } from '@angular/core'; +import {ButtonSettings} from "src/app/hmg-common/ui/button/models/button-settingsl"; +import {TranslatorService} from "src/app/hmg-common/services/translator/translator.service"; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; +import { SendActivationByType } from '../models/sendActivationByType'; +import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx'; +import { GetLoginInfoRequest } from "../../hmg-common/services/authentication/models/get-login-info.request"; +import { GetLoginInfoResponse } from "../../hmg-common/services/authentication/models/get-login-info.response"; +import { SMSCheckRequest } from "src/app/hmg-common/services/authentication/models/smscheck.request"; +import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response"; +import { PushService } from 'src/app/hmg-common/services/push/push.service'; + + +@Component({ + selector: 'app-confirm-login', + templateUrl: './confirm-login.component.html', + styleUrls: ['./confirm-login.component.scss'], +}) +export class ConfirmLoginComponent implements OnInit { + public logo = "assets/imgs/CS.png"; + public buttons:any=[]; + isFaceorFinger: any; + onlySMSBox: any = true; + loginData:any; + selectedOption: any; + lastLogin: any; + loginTokenID:any + deviceToken:any; + + constructor( + public ts: TranslatorService, + public cs: CommonService, + public authService: AuthenticationService, + public sharedData: SharedDataService, + private faio: FingerprintAIO, + public pushService: PushService, + + + ) { + this.loginData= this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + console.log(this.loginData); + this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); + console.log("deviceToken :"+this.deviceToken); + //if device token undefind + // if(this.deviceToken == undefined){ + // alert("undefined"); + // this.pushService.startReceiving(); + // } + this.lastLogin = this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); + + } + + ngOnInit() { + //**checkIfAvailable FAIO **// + this.checkIfAvailable(); + //**getSharedData of IMEI_USER_DATA and REGISTER_DATA_FOR_LOGIIN to set defult value **// + + // this.setDefault(); + + + this.button(); + } + + checkIfAvailable() { + this.faio.isAvailable().then( + options => { + this.isFaceorFinger = options; + if (this.isFaceorFinger === 'finger' && this.lastLogin === 1) { + this.selectedOption = 2; + this.cs.presentConfirmDialog( + this.ts.trPK("login", "biometric-support"), + () => { + this.presentBiometricDialog(); + this.cs.sharedService.setSharedData( + this.selectedOption, + AuthenticationService.LAST_LOGIN + ); + }, + () => { } + ); + } + this.button(); + }, + () => { + this.isFaceorFinger = null; + this.button(); + } + ); + } + + button() { + console.log("button"); + + this.buttons = [ + [{ + title: "login,verify-with-fingerprint", + url: null, + icon: "assets/icon/login/102.png", + settings: new ButtonSettings(true, true, true, true), + value: 2, + disabled: this.isFaceorFinger === "finger" ? false : true, + visible: this.onlySMSBox + }, + { + title: "login,verify-with-faceid", + url: null, + icon: "assets/icon/login/101.png", + settings: new ButtonSettings(true, true, true, true), + value: 3, + disabled: this.isFaceorFinger === "face" ? false : true, + visible: this.onlySMSBox + }, + { + title: "login,verify-with-whatsapp", + url: null, + icon: "assets/icon/login/104.png", + settings: new ButtonSettings(true, true, true, true), + value: 4, + visible: true + }, + { + title: "login,verify-with-sms", + url: null, + icon: "assets/icon/login/103.png", + settings: new ButtonSettings(true, true, true, true), + value: 1, + visible: true + } + ] + ]; + } + + confirm(el: any) { + console.log("confirm:"+ el ); + this.selectedOption = this.selectedOption && !this.onlySMSBox ? this.selectedOption : el.value; + switch (el.value) { + case 1: + console.log(el.value); + this.loginWithSMS(el); + break; + case 2: + console.log(el.value); + + this.loginWithFingurePrint(el); + break; + case 3: + console.log(el.value); + + this.faceReconization(el); + break; + case 4: + console.log(el.value); + + this.loginWithWhatsapp(el); + break; + default: + break; + } + this.cs.sharedService.setSharedData( + this.selectedOption, + AuthenticationService.LAST_LOGIN + ); + } + + loginWithSMS(el) { + console.log("loginWithSMS: "+ el); + + if (!el.disabled) { + + // if (this.user && !this.registerd_data) { + //calling because i dont have token id which required to the send activation code + /// this.checkUserAuthentication(1); + // this.checkUserAuthentication(); *** + + // } else { + if (this.loginData.LogInTokenID) { + this.sendActivationCode(1); + } else { + // this.checkUserAuthentication(1); + // this.checkUserAuthentication();** + + } + // } + } + } + + loginWithWhatsapp(el) { + if (!el.disabled) { + // if (this.user && !this.registerd_data) { + //calling because i dont have token id which required to the send activation code + // this.checkUserAuthentication(2); + // } else { + if (this.loginData.LogInTokenID) { + this.sendActivationCode(2); + } else { + // this.checkUserAuthentication(2); + } + // } + } + } + + public sendActivationCode(type: number) { + let request = new SendActivationByType(); + this.authService.setPublicFields(request); + request.OTP_SendType = type; + request.MobileNumber = this.loginData.MobileNumber; + request.IsMobileFingerPrint =0; + request.P_USER_NAME=this.loginData.P_USER_NAME; + request.LogInTokenID =this.loginData.LogInTokenID; + request.P_LEGISLATION_CODE ="SA"; + // request.VersionID ="2.0"; + + + + // request.LanguageID = imeiData && imeiData.PreferredLanguage || request.LanguageID; + this.authService + .sendActivationCodeByType( + request, + () => { }, + this.ts.trPK("general", "ok") + ) + .subscribe((result: any) => { + if (result.isSMSSent) { + this.cs.sharedService.setSharedData({ + MobileNumber: this.loginData.mobileNumber, + loginType: this.selectedOption + }, + SMSCheckRequest.SHARED_DATA + ); + + this.cs.openSMSPage(); + } + }); + } + + loginWithFingurePrint(el: any) { + if (!el.disabled) { + this.startBiometricLoginIfAvailable(); + } + } + faceReconization(el: any) { + if (!el.disabled) { + this.startBiometricLoginIfAvailable(); + } + } + + private startBiometricLoginIfAvailable() { + // this.setting.isBiometricsEnabled().then(result => { + // console.log(result); + this.faio.isAvailable().then( + options => { + // if biometric supported + //if (result) { + // ask if login with face or finger + this.presentBiometricDialog(); + // } else { + // //ask to enable biometric + // this.getPermissionToActivateBiometric(); + // } + }, + () => { + alert("not avaliable ") + // if biometric not supported do nothing unless + // user session time out from last login + // if (AuthenticationService.isRequireRelogin()) { + // this.initializeInputsFromSessionTimeOut(user); + // } + // this.hideSplashScreen(true); + } + ); + //}); + } + + private presentBiometricDialog() { + this.faio + .show({ + clientId: "Fingerprint Authetnciation", + clientSecret: "Ate343_9347lajF", // Only necessary for Android + disableBackup: true, // Only for Android(optional) + localizedFallbackTitle: this.ts.trPK("general", "use-pin"), // Only for iOS + localizedReason: this.ts.trPK("general", "auth-please") // Only for iOS + }) + .then((result: any) => { + console.log("1"); + // this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); + let request = new GetLoginInfoRequest(); + this.authService.setPublicFields(request); + request.MobileNumber = this.loginData.MobileNumber; + request.P_USER_NAME=this.loginData.P_USER_NAME; + request.UserName=this.loginData.P_USER_NAME; + request.LogInTokenID =this.loginData.LogInTokenID; + request.CompanyID =1;//cs=1 , HMG=2 + request.DeviceType= this.cs.getDeviceType(); + request.DeviceToken=this.deviceToken; + + this.getMobileInfo(request); + }) + .catch((error: any) => { + console.log(error); + }); + } + + private getMobileInfo(request: GetLoginInfoRequest) { + console.log("2"); + + this.authService.getLoginInfo(request,() => { },this.ts.trPK("general", "ok")).subscribe((result: GetLoginInfoResponse) => { + console.log("authService.getLoginInfo"); + if(result.Mohemm_GetPatientID_List.length > 0){ + if ( result.Mohemm_GetPatientID_List[0].LoginType == 2 || result.Mohemm_GetPatientID_List[0].LoginType == 3) { + this.loginTokenID = result.LogInTokenID; + this.checkSMS(); + } else { + + this.onlySMSBox = false; + this.button(); + } + }else { + this.onlySMSBox = false; + this.button(); + + } + }); + } + + public checkSMS() { + const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + const request = new SMSCheckRequest(); + + request.LogInTokenID = data.LogInTokenID; + request.activationCode = ""; + request.P_USER_NAME = data.P_USER_NAME; + request.MobileNumber = data.MobileNumber; + + this.authService + .checkSMS(request, () => {}, this.ts.trPK("general", "ok")) + .subscribe((result: SMSCheckResponse) => { + console.log(result); + if (this.cs.validResponse(result)) { + AuthenticationService.servicePrivilage=result.Privilege_List; + this.authService.setAuthenticatedUser(result).subscribe(() => { + this.insertMobileLogin(); + this.cs.openHome(); + }); + } + }); + } + + + public insertMobileLogin(){ + let request = new GetLoginInfoRequest(); + this.authService.setPublicFields(request); + request.MobileNumber = this.loginData.MobileNumber; + request.P_USER_NAME=this.loginData.P_USER_NAME; + request.UserName=this.loginData.P_USER_NAME; + request.LogInTokenID =this.loginData.LogInTokenID; + request.CompanyID =1;//CompanyID + request.DeviceType= this.cs.getDeviceType(); + request.DeviceToken=this.deviceToken; + //request.TokenID= + request.LoginType=this.selectedOption; + + this.authService + .insertMobileLoginInfo( + request, + () => { }, + this.ts.trPK("general", "ok") + ) + .subscribe((result: any) => { + console.log(result); + +console.log("succssful insertMobileLoginInfo" ); + }); + +} + +} \ No newline at end of file diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 7284b5d9..7e05e0b5 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -121,7 +121,7 @@ export class LoginComponent implements OnInit, OnDestroy { this.handleAppUpdate(result) }); } else if (result.MessageStatus == 1) { - this.checkUserAuthentication(); + this.checkUserAuthentication(); } }); } @@ -164,7 +164,10 @@ export class LoginComponent implements OnInit, OnDestroy { this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.remeberMyInfo(); - this.cs.openSMSPage(); + //this.cs.openSMSPage(); phase#1 one type of OTP + this.cs.openConfirmLoginPage();//phase#2 add 4 types for OTP + + } else { console.log("result.IsPasswordExpired"); console.log(result.IsPasswordExpired); diff --git a/Mohem/src/app/authentication/models/sendActivationByType.ts b/Mohem/src/app/authentication/models/sendActivationByType.ts new file mode 100644 index 00000000..76d2f29e --- /dev/null +++ b/Mohem/src/app/authentication/models/sendActivationByType.ts @@ -0,0 +1,34 @@ +import { Request } from 'src/app/hmg-common/services/models/request'; + +export class SendActivationByType extends Request { + P_USER_NAME: string; // id + UserName:string; + MobileNumber: string; // phone number + ZipCode: string; + LogInTokenID: string; + OTP_SendType:number; + IsMobileFingerPrint:number; + P_LEGISLATION_CODE:string; + // VersionID:string; + + + +// Test +//{ +// "Channel":31, +// "LanguageID":2, +// "LogInTokenID":"Wfm9uDlWhEi3vFsQMqUz3w==", +// "MobileNumber":"0508079569", +// "P_USER_NAME":"191817", +// "UserName":"191817", +// "VersionID":2.0, +// "P_LEGISLATION_CODE":"SA", +// "IsMobileFingerPrint":0, +// "OTP_SendType":1 +// } + + + + + +} \ No newline at end of file diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index ec0d79eb..2e557a03 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -9,6 +9,7 @@ import { LoginModel } from "../models/LoginModel"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response"; import { Password } from "../models/password"; +import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request'; @Component({ selector: "app-sms-page", @@ -33,7 +34,8 @@ export class SmsPageComponent implements OnInit { public isExpiredPwd: boolean = false; public count: number = 0; private loginData = new LoginModel(); - + public deviceToken:any; + public loginTypeData:any; constructor( public navCtrl: NavController, public translate: TranslatorService, @@ -51,6 +53,15 @@ export class SmsPageComponent implements OnInit { this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false; this.isExpiredPwd = this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false; + this.loginData= this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + console.log("loginData : "+ this.loginData); + this.deviceToken= this.common.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); + + console.log("deviceToken :"+this.deviceToken); + this.loginTypeData= this.common.sharedService.getSharedData(SMSCheckRequest.SHARED_DATA, false); + console.log("loginType :"+this.loginTypeData.loginType); + + } initTimer() { @@ -134,6 +145,7 @@ export class SmsPageComponent implements OnInit { } public checkSMS() { + // alert("checkSMS in page") const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); const request = new SMSCheckRequest(); @@ -149,12 +161,39 @@ export class SmsPageComponent implements OnInit { if (this.common.validResponse(result)) { AuthenticationService.servicePrivilage=result.Privilege_List; this.authService.setAuthenticatedUser(result).subscribe(() => { + //call insert Mobile Login + this.insertMobileLogin(); this.common.openHome(); + }); } }); } + public insertMobileLogin(){ + // alert("insertMobileLogin"); + let request = new GetLoginInfoRequest(); + this.authService.setPublicFields(request); + request.MobileNumber = this.loginData.MobileNumber; + request.P_USER_NAME=this.loginData.P_USER_NAME; + request.UserName=this.loginData.P_USER_NAME; + request.LogInTokenID =this.loginData.LogInTokenID; + request.CompanyID =1;//CompanyID + request.DeviceType= this.common.getDeviceType(); + request.DeviceToken=this.deviceToken; + request.LoginType=this.loginTypeData.loginType; + this.authService + .insertMobileLoginInfo( + request, + () => { }, + this.translate.trPK("general", "ok") + ) + .subscribe((result: any) => { + +console.log("successful insertMobileLogin" ); + }); + } + public checkForgetPwdSMS() { const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); const request = new SMSCheckRequest(); diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index f5008881..8bd54015 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -29,6 +29,7 @@ import { SMSCheckResponse } from "./models/smscheck.response"; import { ForgetPassword } from 'src/app/authentication/models/forget.password'; import { CheckAppVersionResponse } from './models/check-app-version.response'; import { PrivilageModel } from './models/privilage-model'; +import { SendActivationByType } from 'src/app/authentication/models/sendActivationByType'; @Injectable({ providedIn: "root" @@ -51,6 +52,10 @@ export class AuthenticationService { public static smsCheckForget='Services/ERP.svc/REST/CheckPublicActivationCode'; public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode'; + public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType'; + public static getMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo'; + public static insertMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo'; + /* register methods */ public static checkPatientForRegisterationURL = 'Services/Authentication.svc/REST/CheckPatientForRegisteration'; @@ -73,7 +78,9 @@ export class AuthenticationService { public static FAMILY_LOGIN_EVENT = 'family-login-event'; public static AUTHENTICATED_USER_KEY = 'save-authenticated-user'; public static LOGIN_DATA="logindata"; - + public static DEVICE_TOKEN = "device_token"; + public static LAST_LOGIN = 'last-login'; + // private static user: AuthenticatedUser; constructor( @@ -115,7 +122,7 @@ export class AuthenticationService { } public setPublicFields(request: Request): Request { - request.VersionID = 1.4; + request.VersionID = 2.0;//2.0,1.4 request.Channel = 31; request.LanguageID = TranslatorService.getCurrentLanguageCode(); //request.IPAdress = '10.10.10.10'; @@ -300,7 +307,7 @@ export class AuthenticationService { ): Observable { this.setPublicFields(request); return this.con.post( - AuthenticationService.getLoginInfoURL, + AuthenticationService.getMobileLoginInfo, request, onError, errorLabel @@ -543,6 +550,14 @@ export class AuthenticationService { return this.con.post(AuthenticationService.forgotFileIDURL, request, onError, errorLabel); } + + + public insertMobileLoginInfo(request: GetLoginInfoRequest,onError: any, errorLabel: string): Observable { + this.authenticateRequest(request); + + return this.con.post(AuthenticationService.insertMobileLoginInfo,request,onError,errorLabel); + } + public isSAUDIIDValid(id: string): boolean { if (!id) { @@ -670,4 +685,21 @@ export class AuthenticationService { ); } } -} + //**************************// + + public sendActivationCodeByType( + request: SendActivationByType, + onError: any, + errorLabel: string + ): Observable { + this.setPublicFields(request); + //below afifi code + //return this.con.post(AuthenticationService.checkUserAuthURL, request, onError, errorLabel); //afifi code, edit it to display the error msg into pop up ofverfication code + + return this.con.post( + AuthenticationService.sendActivationCodeByType, + request, + onError, + errorLabel + ); + }} diff --git a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts index 1668bf9e..fb4f5b2d 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts @@ -3,28 +3,32 @@ import { AuthenticatedUser } from './authenticated-user'; import { CountryCode } from 'src/app/hmg-common/ui/mobile-number/international-mobile/models/country-code.model'; export class GetLoginInfoRequest extends Request { - NationalID: string; - MobileNo: string; + UserName: string; + MobileNumber: string; + LogInTokenID: string; DeviceToken: string; - PatientID: number; - ProjectOutSA: boolean; - LoginType: number; // 2 by patient id , 1 by identification number - ZipCode: string; - PatientMobileNumber: string; // same as mobileNO, - SearchType: number; // 2 - PatientIdentificationID: string // "" - isRegister: boolean; // false - constructor(user: AuthenticatedUser) { - super(); + LanguageID: number; + P_USER_NAME: string; + Channel:number; + CompanyID:number; + DeviceType:string; + LoginType:number; + // constructor(user: AuthenticatedUser) { + // super(); // this.NationalID = user.IdentificationNo; // this.MobileNo = this.PatientMobileNumber = user.MobileNo; // this.DeviceToken = user.deviceToken; // this.PatientID = user.PatientID; // this.ProjectOutSA = user.PatientOutSA ; - this.LoginType = 2; - this.ZipCode = CountryCode.localCode( user.ZipCode); - this.SearchType = 2; - this.PatientIdentificationID = ''; - this.isRegister = false; - } + // this.LoginType = 2; + // this.ZipCode = CountryCode.localCode( user.ZipCode); + // this.SearchType = 2; + // this.PatientIdentificationID = ''; + // this.isRegister = false; + //} + + + + + } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts index 8377746f..8a92cbf4 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts @@ -4,5 +4,7 @@ export class GetLoginInfoResponse extends Response { SMSLoginRequired: boolean; isSMSSent: boolean; LogInTokenID: string; - PatientOutSA: boolean; + Mohemm_GetPatientID_List:any + isActiveCode: boolean; + // PatientOutSA: boolean; } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.request.ts b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.request.ts index 4f9f153b..41910021 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.request.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.request.ts @@ -3,4 +3,6 @@ import { Request } from '../../models/request'; export class SMSCheckRequest extends Request { LogInTokenID: string ; activationCode?: string; + public static SHARED_DATA = 'check_activation_shared_data'; + } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index 68af6074..8f2dbb56 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -436,7 +436,9 @@ export class CommonService { public getDeviceType(): string { if (this.platform.is("mobile")) { - return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android"); + // return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android"); + return (this.platform.is("ios") ? "Iphone" : "android"); + } else { return "Desktop"; } @@ -1016,6 +1018,9 @@ export class CommonService { public openDeductionsPage() { this.nav.navigateForward(["/payslip/Deductions"]); } + public openConfirmLoginPage() { + this.nav.navigateForward(["/authentication/confirmLogin"]); + } public reload(url: string, from: string) { console.log("force reload called from:" + from); diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index 78b4f46e..3754c522 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -23,8 +23,8 @@ export class ConnectorService { public static timeOut = 30 * 1000; // public static host = 'http://10.50.100.113:6060/'; // development service - //public static host = "https://uat.hmgwebservices.com/"; - public static host = 'https://hmgwebservices.com/'; + public static host = "https://uat.hmgwebservices.com/"; + // public static host = 'https://hmgwebservices.com/'; // public static host = 'http://10.50.100.198:6060/'; // public static host = 'http://10.50.100.113:6060/'; // development service /* public static host = 'http://10.50.100.198:6060/'; diff --git a/Mohem/src/app/hmg-common/services/models/request.ts b/Mohem/src/app/hmg-common/services/models/request.ts index 2ff1aed9..1a9e8fd2 100644 --- a/Mohem/src/app/hmg-common/services/models/request.ts +++ b/Mohem/src/app/hmg-common/services/models/request.ts @@ -18,4 +18,8 @@ export class Request { public P_MOBILE_NUMBER: string; public P_EMAIL_ADDRESS: string; public P_NOTIFICATION_ID: number; + + // public P_LEGISLATION_CODE: string; + // public OTP_SendType: number; + // public IsMobileFingerPrint: boolean; } diff --git a/Mohem/src/app/hmg-common/services/push/push.service.ts b/Mohem/src/app/hmg-common/services/push/push.service.ts index 48be6ccb..386d6746 100644 --- a/Mohem/src/app/hmg-common/services/push/push.service.ts +++ b/Mohem/src/app/hmg-common/services/push/push.service.ts @@ -15,16 +15,16 @@ import { SessionModel } from './models/session.model'; import { AuthenticatedUser } from '../authentication/models/authenticated-user'; // import { NotificationsCenterService } from 'src/app/eservices/notifications-center/service/notifications-center.service'; // import { NotificationsComponent } from 'src/app/eservices/notifications-center/notifications/notifications.component'; - - +import {OneSignal} from '@ionic-native/onesignal/ngx' @Injectable({ providedIn: 'root' }) export class PushService { private static notLoggedInUserURL = 'Services/MobileNotifications.svc/REST/PushNotification_InsertPatientDeviceInformation'; private static loggedInUserURL = 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; + public static SENDER_ID = '679409052782';//'815750722565'; - public static CHANNEL_ID = '815750722565'; + public static CHANNEL_ID = '679409052782';//'815750722565'; constructor( // public push: Push, public cs: CommonService, @@ -35,14 +35,16 @@ export class PushService { private authService: AuthenticationService, public ngZone: NgZone, // public notifyService: NotificationsCenterService, - public events: Events + public events: Events, + private oneSignal: OneSignal, + ) { } public startReceiving() { this.processStartReceiving(); } - private processStartReceiving() { + private processStartReceiving1() { // if (this.cs.isCordova()) { // this.stopNotifications(() => { // this.push.hasPermission() @@ -157,6 +159,7 @@ export class PushService { } private registerInBackend(data: any) { + console.log("registerInBackend"); if (this.authService.isAuthenticated()) { this.registerAuthenticatedUser(data.registrationId); } else { @@ -206,4 +209,54 @@ export class PushService { } + + private processStartReceiving() { + console.log('processStartReceiving'); + + console.log("processStartReceiving openConference"); + this.oneSignal.startInit('8d9b8313-0365-4934-a2a9-fdee5aeac66e', PushService.SENDER_ID); + this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification); + this.oneSignal.handleNotificationReceived().subscribe(data => this.onPushReceived(data.payload)); + this.oneSignal.handleNotificationOpened().subscribe(data => this.onPushOpened(data.notification.payload)); + console.log("this.oneSignal: "+ this.oneSignal.getIds()); + this.oneSignal.endInit(); + this.oneSignal.getIds().then(result => { + console.log("result.userId: " +result.userId); + //there is no part for notLoggedInUserURL () as patient app + if(result.userId){ + this.cs.sharedService.setSharedData(result.userId, AuthenticationService.DEVICE_TOKEN); + } + + this.registerInBackend(result.userId); + }, err => { + console.log("getIds() error: "+err); + + }); + + // if (this.cs.isCordova()) { + // console.log('Notification Channel Called'); + + // if (this.platform.is('android')) { + // this.stopNotifications(() => { + + // }); + // } else { + // //initialize code + // } + // } + } + public onPushReceived(payload: any) { + console.log(JSON.parse(JSON.stringify(payload))); + console.log('Push-Received whole payload: ' + payload); + } + + public onPushOpened(payload: any) { + console.log(JSON.parse(JSON.stringify(payload))); + console.log('Push-opened whole payload: ' + payload); + console.log("onPushOpened openConference"); + this.processNotification(payload); + } + + + } diff --git a/Mohem/src/app/hmg-common/ui/button/button.component.html b/Mohem/src/app/hmg-common/ui/button/button.component.html index 08f3b9c6..31b8632f 100644 --- a/Mohem/src/app/hmg-common/ui/button/button.component.html +++ b/Mohem/src/app/hmg-common/ui/button/button.component.html @@ -7,7 +7,7 @@ --> - \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/button/button.component.scss b/Mohem/src/app/hmg-common/ui/button/button.component.scss index 7ef033f0..f62e14ac 100644 --- a/Mohem/src/app/hmg-common/ui/button/button.component.scss +++ b/Mohem/src/app/hmg-common/ui/button/button.component.scss @@ -11,11 +11,11 @@ border-width: 0.02cm; } -.custom-button:hover { - -webkit-box-shadow: 0px 0px 8px 2px #d1212747;; - -moz-box-shadow: 0px 0px 8px 2px #d1212747;; - box-shadow: 0px 0px 8px 2px #d1212747;; -} +// .custom-button:hover { +// -webkit-box-shadow: 0px 0px 8px 2px #d1212747;; +// -moz-box-shadow: 0px 0px 8px 2px #d1212747;; +// box-shadow: 0px 0px 8px 2px #d1212747;; +// } diff --git a/Mohem/src/app/hmg-common/ui/button/button.component.ts b/Mohem/src/app/hmg-common/ui/button/button.component.ts index 746c4ae7..a88d0184 100644 --- a/Mohem/src/app/hmg-common/ui/button/button.component.ts +++ b/Mohem/src/app/hmg-common/ui/button/button.component.ts @@ -8,13 +8,9 @@ import { TranslatorService } from '../../services/translator/translator.service' styleUrls: ['./button.component.scss'], }) export class ButtonComponent implements OnInit { - constructor() { - } - ngOnInit() { - - } - /* + @Input() strong: boolean; + @Input() class: any = ''; @Input() icon: string; @Input() title: string; @Output() trigger = new EventEmitter(); @@ -29,7 +25,7 @@ export class ButtonComponent implements OnInit { } ngOnInit() { - this.direction = TranslatorService.getCurrentDirection(); + this.direction = TranslatorService.getCurrentLanguageName(); if (this.settings) { this.style = { @@ -40,13 +36,19 @@ export class ButtonComponent implements OnInit { }; } - + /* + const element = document.getElementById('modal'); + element.addEventListener('click', e => { + e.stopImmediatePropagation(); + }); + */ } private isEnabled(enabled: boolean): string { - return enabled ? '30px' : '0px'; + return enabled ? '6px' : '0px'; } public onClicked() { + console.log(this.disabled); if (!this.disabled) { this.trigger.emit(); } @@ -62,17 +64,20 @@ export class Modal implements OnInit { ngOnInit() { console.log(' on initialization'); + //this.elRef.nativeElement.addEventListener('mouseenter', this.onMouseEnter); } ngOnDestroy() { + // this.elRef.nativeElement.removeEventListener('mouseenter', this.onMouseEnter); } onMouseEnter() { + // alert("Don't touch my bacon!") } @HostListener('click', ['$event']) onClick(event: any) { - alert('click'); + // alert('click'); + // event.preventPropagation(); } - */ } diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index fd491b15..dc33107e 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -116,7 +116,7 @@ export class WorklistMainComponent implements OnInit { this.worklistMainService .getPRNotificationBody(notificationBodyObj) .subscribe((result: PRNotificatonBodyResponse) => { - //this.handleWorkListBodyResult(result, "MO"); + this.handleWorkListBodyResult(result, "PR"); }); } @@ -168,10 +168,17 @@ export class WorklistMainComponent implements OnInit { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; } + }else if (Type == "PR") { + if (result.GetAbsenceCollectionNotificationBodyList) { + this.notificationBodyRes = + result.GetAbsenceCollectionNotificationBodyList; + } } } } //End handleWorkListBodyResult + + getNotificationButtons(notificationButtonsObj) { this.worklistMainService .getNotificationButtons(notificationButtonsObj) diff --git a/Mohem/src/app/payslip/service/payslip.service.ts b/Mohem/src/app/payslip/service/payslip.service.ts index ffa2c87c..0ef5274f 100644 --- a/Mohem/src/app/payslip/service/payslip.service.ts +++ b/Mohem/src/app/payslip/service/payslip.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { ConnectorService } from '../../hmg-common/services/connector/connector.service'; import { AuthenticationService } from '../../hmg-common/services/authentication/authentication.service'; -import { Observable } from 'node_modules_/@angular/cli/node_modules/rxjs'; +import { Observable } from 'node_modules/@angular/cli/node_modules/rxjs'; @Injectable({ providedIn: 'root' diff --git a/Mohem/src/assets/icon/login/101.png b/Mohem/src/assets/icon/login/101.png new file mode 100644 index 0000000000000000000000000000000000000000..90c1c575a19e47ad913fbe1e2be3f9182be3f826 GIT binary patch literal 3484 zcmaJ^c|4SR`yND=7K&n0#&9&Y*=$)GW`-doWEn|g3?^nVGxjBsu`_w?9eatglr2)^ zt&@q6QlxWoI1^Ju;b17<(K(&>_s6gI`8?0_T|U=!-PiZN@8^#v)ydIjw=_^1008W^ z#bKOCl4+kd@n#Lf344{U(M1(#PWMm9Q7{ZN_`Z^#a9AN~58^I8Ix^RRE+|WeN81(lA z7Di+E`I|UntpAQBT$zIdSuDB<3>F?94h`3X(ij0Sgt4(P432~$k-9>JE;EwKB1Gs? znQGq^FeE0CL8i0FG%9FYk>E=UWtoG8PX9Urh5nB$mHBs?gb9O15a=)j6uy0=??4BK z{|%*3{y{TY&ZPhP{eOj-u90*S%$dZbg))f3!uhLhhoYOH86*OW#&D(4g1=|cDUimZ zF#~CI5E{LmwPPTNJDKW73ukJ6<2X2&*ixA+0+mRz#h8PIDo`@n&&1dYX@D@s9>XH7 zjv)|OV@m_Hv85r}8f$b6u8-D3eCJ|l#83)}%KFar`!Cn{hurOUp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Y|7-Y5;OLV1&wwNPA`2q%Yq&{Ao^4$vM2;W2LH0OzQck{F4#lG1n_8r*7XF zm`@vUS3M)?R@{b)DB6;T1xM*_Ytr1`Z^5!?$J=FvY;=pWw4FI~dF&yr$wD!#B=i7m zelh*n>7Rq~AOUJpbVZTQaL+;2{NeL4B9ngBv$OBzO<9fcvI+gq=O5hSk!r%cdJmi# zgC7B)ZE>p}No?jGy7`dr;l>WQ@h!nMkJ3-11pEe2$hDa2==ms;a%Z#8;zMQ1_^han z{=rCD$+yD@TU25lMA`ZM=xyxJ>xv4+>T&B9#s;DoaOe6xr&BE#VF{I10{ArN=BI&{ zPX>tc*2rwKnX{JPqHmWv@o;2Yp!(XW^bz3I?HdT(^kU4Uc)3D|`OLF~bFXsm?WwCu zn#=&rEaXZ2sQ$>jmH38lvuT&T)s|W~3v|K^#;U++bGl6am1%By0g7yBeg_j;EmNTT zI9VA~Xx2>;9xOzs&eg^qIeTULg{_v!WSUr($H{wP5Qh?M_;dLs&1*F=qHoq@ms}%C zmQH91Qk*T^yr2j})lCisb@N`eZbKS9Lcb^{{tOZU51=bxuQ5&_~ zm@dpD44DI`=By?PTvrr$Jd``49mE|AZ@rNvGv4U-(*_x14c+p^(j_J3VeWwaS|i3J zZfcJDyA?3dk(AgGU8t0DFc#VoYLqzhBx<;EJ6q|7L8=#py7J{Z!`AY8T8pCA>MFkF zOX64L&@|fIe)?3QY ZIgsNVRcpaEn4PP#nej=?ebiaz{{cCP0nY#c literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/icon/login/103.png b/Mohem/src/assets/icon/login/103.png new file mode 100644 index 0000000000000000000000000000000000000000..3326814bc80e6682a73f4a36f62f4cbd5b15f36d GIT binary patch literal 2377 zcmaJ@cT`hZ9)1bvMh9FeHrhNAR9qlU2qYMRkkBNE5Rj2(Ade72ib;?FYQV7(P{9$g zuF4=55QgT`22>Df!wf3oAO{uO*Fr4%_8{fU!T52S?aRlY}z1+)gOP zEHcm`X|#kVmhnVFP|L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RuuO0TYexZ>P0ul6YpA8A-ySE)mMf&b~% zv@vM3@?K`39mUM*W?N`&@R>UHM^ZNR*jUBGNlwPg{?zeboDT%&s)Li$;`Y50_yvxy z>E==!gQ&SCk0c|eRWt5UryZRp&Z_*g@vZC}lxwFB$Y;#F^>4v-N?vj?q^$4JDR-Z( zOOVvAF1<5~P&=vy7^K5Dj0$rSTp#;rd=62m6SS_Ff=LOt>%^eZLB-mh6|f8Wz8w+R zUc%{{Je~4*ouN);%EiKV%^@KNTHkG_;IXY&Z`DWfd;CczyXsPGc zyVD%+N}8Xgptkwvkq?%pLFGI9d-f00J*_Kd>w`Z~eGgbp8Q5INFHw$dD&%4+%bL^X z0y)!3Co{&FH~t(=)pbm<)Wag-JM!~Q2_P9y6i7Xw3VFkY99pw DG{ouR literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/icon/login/104.png b/Mohem/src/assets/icon/login/104.png new file mode 100644 index 0000000000000000000000000000000000000000..ad55ff74ccab0ca8b0e74beefb641f0d55274f09 GIT binary patch literal 4981 zcmaJ_XH-*L)23JHNRtu*QWOXw5E7bn=^#aVClnzGB%yZ+CDH|?N|h!}L{N%=bi}KG zigX19>Agww#e1*!eSduSJ7=BU);!P5o|(PZnnN%$xJgIDMMFeHM5nE#ZhXR6K)(#-R!$lEjE~780@2!S#_s|N$ zAWVV`Or3)~o#8IP8%h9$0J#eSBm(CM2tazFuyO&4z(0BAF2=u>K|sKtA~;V);9o{r z=o?jMgl7C43?Gx$igMSP)WFyv=~525-banlm&qy;*wxFNvIqI4*2^4UTDL( zxXKx;YyPe4Vx|am$Kkx?Kp=mAe+hqx1RCQ80>j~OkfanyN=p1fLL3{2!Z`+rqp$+M z8PpM2XN-q8&I64C{9<%;Li^$rffttkwFRX2KeQ<9-)_2a7%0He8w8e+{I#Xug8KUZ zzbF#U#M}erg7(LX{)y4om(xaJagHcwgtodO@Pb9c!^1^R6D|!^)0C0X zkWz(#!5VNCRj9P4suV;OtO`TOj|+_czw%-))ipS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kXJ~xjEzXr?|Xl^v&t{9GIZ_Kx(_DCX3YS+ zrpFrh?TPj|kJ9peM;^x!m zoR*0gh`ReE;g;;1f9FNgPjw zaO%n82llP_>>EyDH(vq1F9odC_m3qtamSEqMXdV^SiNrz7%5I47#OJZau~DL|B%8e zJ_!{PVoGyJeaw5ugxLiwn35(*1ZUuhW_3TGdCK9LvExO29sW#i-ODkP5&uB>5gmYt1N zFd}>#9?W9Ox!cUd8JCgReV)URV*QiJB=<582YECs3%tUX$y(YdJNyX9LsM3$L*~?% zJDGDH`o`3N)cqErv4K<8YkX^XFip4)OV)?!>JU&MNcvupePwljwINf(-uPfty!Ew% zxcGjvYgt?IyoC;C=lgQuXnmgvY$SvxIdvfT_7P5t)Fyr-SvIe)eNs(iqvhU}GvA(+ zLp1hWU(1%!o#gU^oltE8l)+<&y-Qp$(zn=uP%Gp+s|;a@rKO~Cy4Uf6^JD)T(G$g;sQ!-2+S;oBx+!fmJoww)i z{BJ3!08rSD_+1~qe@PYhTn<1B(oA;YeXKx98z);7AK1)b2~`TOz1x0o@O=n@ylq-> zl$BvhrkzCfGhv~UE3fQxL*T?`%~q=9!zb^)-h{*&e^aiy+7t{=Na8ENH%=p7yd|k| zEllh6Fw<=1!#AZ%K1@bM9Nrpvb)PuN5s7XHaARt2EeMywGw7CehV$7!!ZJC*DZZK| zyp6rO`*JX}qQLHq^Ym0hFUfsFB+{{de}L%>w(T>0!Y6#bEfQJ3V36YhYstSIoVOhn zw)yo5GJL$;dYK(>--?X@pE68iYudxQioD$~tCti6X@KSsQ5mguEPg;Q6ex7i=a~sW zdU|Qb4$?w57GxnoXnC}EmIUzvk7)&1`l*Z*BdxBVLaXgnWtvG{#!(={5KQWy)!+Y= ggC1nd;Ut%c4vU;dXpup4zkY;iYZ$24syf{L4`*Tdl>h($ literal 0 HcmV?d00001 diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 37798853..eb25bdf2 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -96,6 +96,46 @@ "password-expired": { "en": "Your password has been expired. Kindly change your password to login again.", "ar": "كلمة المرور الخاصة بك قد انتهت صلاحيتها. يرجى تغيير كلمة المرور لتسجيل الدخول مرة أخرى." + }, + "verify-login": { + "en": "Verify Login", + "ar": "تحقق من تسجيل الدخول" + }, + "verify-login-with": { + "en": "Please verify login with one of the following options", + "ar": "الرجاء التحقق من تسجيل الدخول باستخدام أحد هذه الخيارات" + }, + "verify-with-fingerprint": { + "en": "Verify with fingerprint", + "ar": "تحقق باستخدام بصمة" + }, + "verify-with-faceid": { + "en": "Verify with face ID", + "ar": "تحقق باستخدام معرف الوجه" + }, + "verify-with-sms": { + "en": "Verify with SMS", + "ar": "تحقق مع الرسائل القصيرة" + }, + "verify-with-whatsapp": { + "en": "Verify with Whatsapp", + "ar": "تحقق مع Whatsapp" + }, + "last-login": { + "en": "Last login at:", + "ar": ":آخر تسجيل دخول" + }, + "last-login-with": { + "en": "Last login using:", + "ar": "آخر تسجيل دخول مع" + }, + "biometric-support": { + "en": "It seems that your phone is supporting biometric feature, do you want login with with biometric?", + "ar": "يبدو أن هاتفك يدعم ميزة البيومترية ، هل تريد تسجيل الدخول باستخدام البيومترية؟" + }, + "verify-fingerprint": { + "en": "To activate fingerprint login service, please verify by using one of the following options. ", + "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى التحقق من خلال احدى الخيارات التالية" } }, "verificationcode": { From 4ae7e7566c8622d53b456a8937b97084f4daac2f Mon Sep 17 00:00:00 2001 From: ashwaq Date: Mon, 18 Nov 2019 10:46:21 +0300 Subject: [PATCH 2/3] add oneSignal plugin in install-plugins.bat --- Mohem/install-plugins.bat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mohem/install-plugins.bat b/Mohem/install-plugins.bat index 20088fa5..1c6245c8 100644 --- a/Mohem/install-plugins.bat +++ b/Mohem/install-plugins.bat @@ -149,6 +149,10 @@ call npm install @ionic-native/file-path call ionic cordova plugin add com-badrit-base64 call npm install @ionic-native/base64 +@echo install OneSignal plugin +call ionic cordova plugin add onesignal-cordova-plugin +call npm install @ionic-native/onesignal + @echo reinitializing git repository @echo git init @echo git remote add origin https://enas_yaghi@hmg.git.cloudforge.com/patientappionic.git From 8cc0a3fff7f41be8025c5177aadb79bffb77a17e Mon Sep 17 00:00:00 2001 From: ashwaq Date: Tue, 19 Nov 2019 09:53:50 +0300 Subject: [PATCH 3/3] fix device token issue --- Mohem/src/app/app.component.ts | 3 ++- .../confirm-login/confirm-login.component.ts | 8 ++++---- Mohem/src/app/authentication/sms-page/sms-page.page.ts | 5 ++++- Mohem/src/app/hmg-common/services/push/push.service.ts | 3 +++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 58867d67..364b64a6 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -51,7 +51,7 @@ export class AppComponent implements OnInit, AfterViewInit { } ngOnInit() { this.initializeApp(); - this.startReceivingPushService(); + } ngAfterViewInit() {} initializeApp() { @@ -65,6 +65,7 @@ export class AppComponent implements OnInit, AfterViewInit { this.watchLanguageChangeEvents(); this.subscribeEvents(); this.keyboardService.watchKeyboard(); + this.startReceivingPushService(); }); }); } diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts index aebf22af..3eb241b9 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -45,10 +45,10 @@ export class ConfirmLoginComponent implements OnInit { this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); console.log("deviceToken :"+this.deviceToken); //if device token undefind - // if(this.deviceToken == undefined){ - // alert("undefined"); - // this.pushService.startReceiving(); - // } + if(this.deviceToken == undefined){ + this.deviceToken = localStorage.getItem("deviceToken"); + + } this.lastLogin = this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); } diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index 2e557a03..f2dd4a85 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -56,7 +56,10 @@ export class SmsPageComponent implements OnInit { this.loginData= this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); console.log("loginData : "+ this.loginData); this.deviceToken= this.common.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); - + if(this.deviceToken == undefined){ + this.deviceToken = localStorage.getItem("deviceToken"); + + } console.log("deviceToken :"+this.deviceToken); this.loginTypeData= this.common.sharedService.getSharedData(SMSCheckRequest.SHARED_DATA, false); console.log("loginType :"+this.loginTypeData.loginType); diff --git a/Mohem/src/app/hmg-common/services/push/push.service.ts b/Mohem/src/app/hmg-common/services/push/push.service.ts index 386d6746..035112df 100644 --- a/Mohem/src/app/hmg-common/services/push/push.service.ts +++ b/Mohem/src/app/hmg-common/services/push/push.service.ts @@ -222,9 +222,12 @@ export class PushService { this.oneSignal.endInit(); this.oneSignal.getIds().then(result => { console.log("result.userId: " +result.userId); + //there is no part for notLoggedInUserURL () as patient app if(result.userId){ this.cs.sharedService.setSharedData(result.userId, AuthenticationService.DEVICE_TOKEN); + localStorage.setItem("deviceToken", result.userId); + } this.registerInBackend(result.userId);