enhance
commit
5c4377034f
@ -0,0 +1,167 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo start installing required native and 3rd party plugins
|
||||||
|
|
||||||
|
echo to update angular -> npm install -g @angular/cli
|
||||||
|
echo to update ionic -> npm install -g ionic
|
||||||
|
|
||||||
|
echo add browser, android , ios platforms commit non required
|
||||||
|
echo to add browser -> call ionic cordova platform add browser
|
||||||
|
echo to add ios -> call ionic cordova platform add ios
|
||||||
|
|
||||||
|
ionic cordova platform add android
|
||||||
|
|
||||||
|
echo copying android FCM google servcie file
|
||||||
|
cp ./google-services.json ./platforms/android/
|
||||||
|
|
||||||
|
npm i @angular/animations
|
||||||
|
npm i @swimlane/ngx-charts --save
|
||||||
|
|
||||||
|
echo primeng framework [angular]
|
||||||
|
|
||||||
|
npm install primeng --save
|
||||||
|
npm install primeicons --save
|
||||||
|
|
||||||
|
echo add css links for primeng in global.scss
|
||||||
|
echo @import "../node_modules/primeng/resources/themes/nova-light/theme.css";
|
||||||
|
echo @import "../node_modules/primeng/resources/primeng.min.css";
|
||||||
|
echo @import "../node_modules/primeicons/primeicons.css";
|
||||||
|
|
||||||
|
echo install chartjs as dependency for primeng chartjs
|
||||||
|
npm install chart.js --save
|
||||||
|
# echo add reference in [angular.json] in [scripts] array add (node_modules/chart.js/dist/Chart.js)
|
||||||
|
|
||||||
|
|
||||||
|
echo calendar https://mattlewis92.github.io/angular-calendar/#/kitchen-sink
|
||||||
|
npm install --save @ng-bootstrap/ng-bootstrap
|
||||||
|
npm install --save angular-calendar date-fns
|
||||||
|
|
||||||
|
echo install android support gradle release because of barcode scanner to install missing android attributes
|
||||||
|
ionic cordova plugin add cordova-android-support-gradle-release --fetch
|
||||||
|
|
||||||
|
|
||||||
|
echo push notifications
|
||||||
|
ionic cordova plugin add phonegap-plugin-push --variable GOOGLE_PLAY_SERVICES_VERSION="16.0.0" --variable FCM_VERSION="15.0.0"
|
||||||
|
npm install @ionic-native/push
|
||||||
|
|
||||||
|
|
||||||
|
echo sqlite storage
|
||||||
|
ionic cordova plugin add cordova-sqlite-storage
|
||||||
|
npm install @ionic-native/sqlite
|
||||||
|
|
||||||
|
|
||||||
|
echo native storage
|
||||||
|
ionic cordova plugin add cordova-plugin-nativestorage
|
||||||
|
npm install @ionic-native/native-storage
|
||||||
|
|
||||||
|
|
||||||
|
echo bluetooth ble centeral //check interface assets/js/bletooth.js
|
||||||
|
ionic cordova plugin add cordova-plugin-ble-central
|
||||||
|
npm install @ionic-native/ble
|
||||||
|
|
||||||
|
|
||||||
|
echo launch navigator
|
||||||
|
echo warning : for now we stick with launch navigator 3 since 5 has issue
|
||||||
|
# call ionic cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable GOOGLE_API_KEY_FOR_ANDROID="AIzaSyC-XbzwGMyAVCnspof0cqiO4iLfKmeEYVA"
|
||||||
|
ionic cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator@3
|
||||||
|
npm install @ionic-native/launch-navigator
|
||||||
|
|
||||||
|
echo themeablebrowser
|
||||||
|
|
||||||
|
ionic cordova plugin add cordova-plugin-themeablebrowser
|
||||||
|
npm install @ionic-native/themeable-browser
|
||||||
|
|
||||||
|
echo in app browser
|
||||||
|
ionic cordova plugin add cordova-plugin-inappbrowser
|
||||||
|
npm install @ionic-native/in-app-browser
|
||||||
|
|
||||||
|
|
||||||
|
echo globalization
|
||||||
|
|
||||||
|
ionic cordova plugin add cordova-plugin-globalization
|
||||||
|
npm install @ionic-native/globalization
|
||||||
|
|
||||||
|
|
||||||
|
echo android permissions plugin
|
||||||
|
ionic cordova plugin add cordova-plugin-android-permissions
|
||||||
|
npm install @ionic-native/android-permissions
|
||||||
|
|
||||||
|
echo sms reader https://www.npmjs.com/package/cordova-plugin-sms-receive
|
||||||
|
npm i cordova-plugin-sms-receive
|
||||||
|
cordova plugin add cordova-plugin-sms-receive
|
||||||
|
|
||||||
|
echo device information§
|
||||||
|
ionic cordova plugin add cordova-plugin-device
|
||||||
|
npm install @ionic-native/device
|
||||||
|
|
||||||
|
echo local notifications
|
||||||
|
ionic cordova plugin add cordova-plugin-local-notification
|
||||||
|
npm install @ionic-native/local-notifications
|
||||||
|
|
||||||
|
echo call phone number
|
||||||
|
ionic cordova plugin add call-number
|
||||||
|
npm install @ionic-native/call-number
|
||||||
|
|
||||||
|
echo badge
|
||||||
|
ionic cordova plugin add cordova-plugin-badge
|
||||||
|
npm install @ionic-native/badge
|
||||||
|
|
||||||
|
|
||||||
|
echo biometric features
|
||||||
|
ionic cordova plugin add cordova-plugin-fingerprint-aio --variable FACEID_USAGE_DESCRIPTION="User Authentication"
|
||||||
|
npm install @ionic-native/fingerprint-aio
|
||||||
|
|
||||||
|
echo install diagnostic
|
||||||
|
ionic cordova plugin add cordova.plugins.diagnostic
|
||||||
|
npm install @ionic-native/diagnostic
|
||||||
|
|
||||||
|
echo install background-geolocation
|
||||||
|
ionic cordova plugin add cordova-plugin-mauron85-background-geolocation@alpha --variable GOOGLE_PLAY_SERVICES_VERSION="16.0.0"
|
||||||
|
npm install @ionic-native/background-geolocation
|
||||||
|
|
||||||
|
echo install barcode plugin
|
||||||
|
ionic cordova plugin add phonegap-plugin-barcodescanner
|
||||||
|
npm install @ionic-native/barcode-scanner
|
||||||
|
|
||||||
|
echo install camera plugin
|
||||||
|
ionic cordova plugin add cordova-plugin-camera
|
||||||
|
npm install @ionic-native/camera
|
||||||
|
|
||||||
|
echo install keyboard plugin
|
||||||
|
ionic cordova plugin add cordova-plugin-ionic-keyboard
|
||||||
|
npm install @ionic-native/keyboard
|
||||||
|
|
||||||
|
echo install opentok required permissions
|
||||||
|
ionic cordova plugin add cordova-opentok-android-permissions
|
||||||
|
|
||||||
|
echo install health plugin
|
||||||
|
ionic cordova plugin add cordova-plugin-health --variable HEALTH_READ_PERMISSION="App needs read access to read heart rate" --variable HEALTH_WRITE_PERMISSION="App needs write access for heart rate" --variable GMS_VERSION="16.0.1"
|
||||||
|
npm install @ionic-native/health
|
||||||
|
|
||||||
|
echo install App Availability Plugin
|
||||||
|
ionic cordova plugin add cordova-plugin-appavailability
|
||||||
|
npm install @ionic-native/app-availability
|
||||||
|
|
||||||
|
echo install rate plugin
|
||||||
|
ionic cordova plugin add cordova-plugin-apprate
|
||||||
|
npm install @ionic-native/app-rate
|
||||||
|
|
||||||
|
|
||||||
|
echo reinitializing git repository
|
||||||
|
echo git init
|
||||||
|
echo git remote add origin https://enas_yaghi@hmg.git.cloudforge.com/patientappionic.git
|
||||||
|
echo git push -f origin master
|
||||||
|
|
||||||
|
|
||||||
|
echo update project from package.js change if necessary
|
||||||
|
echo to install all dependencies in package.json
|
||||||
|
|
||||||
|
echo npm cache clean --force
|
||||||
|
echo exact version -> npm install --save --save-exact react
|
||||||
|
echo latest versions based on package.json rules -> npm install
|
||||||
|
|
||||||
|
echo to build or serve for (( production ))
|
||||||
|
echo export NODE_OPTIONS=--max-old-space-size=4096
|
||||||
|
echo ionic serve --prod -> for serving in production
|
||||||
|
echo ionic cordova build android --release --aot --minifyjs --optimizejs --minifycss
|
||||||
|
echo ionic cordova build ios --release --aot --minifyjs --optimizejs --minifycss
|
||||||
@ -1 +1 @@
|
|||||||
to update ionic - install -g ionic
|
latest versions based on package.json rules - install
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import {Response} from './response'
|
import { Response } from 'src/app/hmg-common/services/models/response';
|
||||||
export class AbsenceResponse extends Response{
|
export class AbsenceResponse extends Response{
|
||||||
public static SHARED_DATA = 'absence_tr_id';
|
public static SHARED_DATA = 'absence_tr_id';
|
||||||
public P_TRANSACTION_ID:number;
|
public P_TRANSACTION_ID:number;
|
||||||
|
|||||||
@ -0,0 +1,50 @@
|
|||||||
|
<ion-header>
|
||||||
|
<ion-toolbar class="header-toolbar">
|
||||||
|
<ion-buttons slot="start">
|
||||||
|
<ion-back-button color="light" class="btnBack" ></ion-back-button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title color="light" > {{'login,verify-login' | translate}}</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<ion-grid>
|
||||||
|
|
||||||
|
<ion-row class="ion-justify-content-center">
|
||||||
|
<ion-col [size]="4">
|
||||||
|
<img [src]="logo" class="logo" />
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<ion-row class="description">
|
||||||
|
<ion-col size="12">
|
||||||
|
<!-- <type-writer *ngIf="onlySMSBox" [text]="'login,verify-login-with' | translate" class="description"
|
||||||
|
color="primary" fontSize="0.55cm" lineHeight="1cm" fontSize="0.55cm"></type-writer>
|
||||||
|
-->
|
||||||
|
<div *ngIf="onlySMSBox"><p>{{ts.trPK('login','verify-login-with')}}</p></div>
|
||||||
|
<!-- <type-writer *ngIf="!onlySMSBox" [text]="'login, verify-fingerprint' | translate" class="description"
|
||||||
|
color="primary" fontSize="0.55cm" lineHeight="1cm" fontSize="0.55cm"></type-writer>
|
||||||
|
-->
|
||||||
|
<div *ngIf="!onlySMSBox"><p>{{ts.trPK('login','verify-fingerprint')}}</p></div>
|
||||||
|
|
||||||
|
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
|
<page-trailer [small]="true"></page-trailer>
|
||||||
|
|
||||||
|
<ion-row [dir]="direction" class="zoomIn">
|
||||||
|
<ng-container *ngFor="let buttonsGroup of buttons">
|
||||||
|
<ion-col *ngFor="let button of buttonsGroup" [size]="6">
|
||||||
|
<app-button (click)="confirm(button)" [title]="button.title | translate " [icon]="button.icon"
|
||||||
|
[settings]="button.settings" [strong]="button.txt" [class]="button.class" [disabled]="button.disabled"
|
||||||
|
*ngIf="button.visible">
|
||||||
|
</app-button>
|
||||||
|
|
||||||
|
</ion-col>
|
||||||
|
</ng-container>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@ -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<ConfirmLoginComponent>;
|
||||||
|
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -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
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,184 +1,462 @@
|
|||||||
|
|
||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { ElementRef } from "@angular/core";
|
import { ElementRef } from "@angular/core";
|
||||||
import { NavController } from "@ionic/angular";
|
|
||||||
|
import { NavController, Platform } 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 { CommonService } from "src/app/hmg-common/services/common/common.service";
|
import { CommonService } from "src/app/hmg-common/services/common/common.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 { SMSCheckRequest } from "src/app/hmg-common/services/authentication/models/smscheck.request";
|
import { SMSCheckRequest } from "src/app/hmg-common/services/authentication/models/smscheck.request";
|
||||||
|
|
||||||
import { LoginModel } from "../models/LoginModel";
|
import { LoginModel } from "../models/LoginModel";
|
||||||
|
|
||||||
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
|
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
|
||||||
|
|
||||||
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
|
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
|
||||||
|
|
||||||
import { Password } from "../models/password";
|
import { Password } from "../models/password";
|
||||||
|
|
||||||
|
import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
||||||
selector: "app-sms-page",
|
selector: "app-sms-page",
|
||||||
|
|
||||||
templateUrl: "./sms-page.page.html",
|
templateUrl: "./sms-page.page.html",
|
||||||
|
|
||||||
styleUrls: ["./sms-page.page.scss"]
|
styleUrls: ["./sms-page.page.scss"]
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export class SmsPageComponent implements OnInit {
|
export class SmsPageComponent implements OnInit {
|
||||||
|
|
||||||
public static LOGIN_DATA = "LOGIN_DATA";
|
public static LOGIN_DATA = "LOGIN_DATA";
|
||||||
|
|
||||||
Channel: number = 0;
|
Channel: number = 0;
|
||||||
|
|
||||||
activationCode: string;
|
activationCode: string;
|
||||||
|
|
||||||
P_SESSION_ID: number;
|
P_SESSION_ID: number;
|
||||||
|
|
||||||
P_USER_NAME: string;
|
P_USER_NAME: string;
|
||||||
|
|
||||||
timeInSeconds: any;
|
timeInSeconds: any;
|
||||||
|
|
||||||
time: any;
|
time: any;
|
||||||
|
|
||||||
runTimer: any;
|
runTimer: any;
|
||||||
|
|
||||||
hasStarted: any;
|
hasStarted: any;
|
||||||
|
|
||||||
hasFinished: any;
|
hasFinished: any;
|
||||||
|
|
||||||
remainingTime: any;
|
remainingTime: any;
|
||||||
|
|
||||||
displayTime: any;
|
displayTime: any;
|
||||||
|
|
||||||
loginTokenID: string;
|
loginTokenID: string;
|
||||||
|
|
||||||
public isForgetPwd: boolean = false;
|
public isForgetPwd: boolean = false;
|
||||||
|
|
||||||
public isExpiredPwd: boolean = false;
|
public isExpiredPwd: boolean = false;
|
||||||
|
|
||||||
public count: number = 0;
|
public count: number = 0;
|
||||||
|
|
||||||
private loginData = new LoginModel();
|
private loginData = new LoginModel();
|
||||||
|
|
||||||
|
public deviceToken:any;
|
||||||
|
|
||||||
|
public loginTypeData:any;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|
||||||
public navCtrl: NavController,
|
public navCtrl: NavController,
|
||||||
|
|
||||||
public translate: TranslatorService,
|
public translate: TranslatorService,
|
||||||
|
|
||||||
public common: CommonService,
|
public common: CommonService,
|
||||||
|
|
||||||
private elementRef: ElementRef,
|
private elementRef: ElementRef,
|
||||||
|
|
||||||
public authService: AuthenticationService,
|
public authService: AuthenticationService,
|
||||||
public sharedData: SharedDataService
|
|
||||||
|
public sharedData: SharedDataService,
|
||||||
|
|
||||||
|
public platform: Platform,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
|
|
||||||
this.initTimer();
|
this.initTimer();
|
||||||
|
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
|
|
||||||
this.isForgetPwd =
|
this.isForgetPwd =
|
||||||
|
|
||||||
this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false;
|
this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false;
|
||||||
|
|
||||||
this.isExpiredPwd =
|
this.isExpiredPwd =
|
||||||
|
|
||||||
this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false;
|
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);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
initTimer() {
|
initTimer() {
|
||||||
|
|
||||||
// Pomodoro is usually for 25 minutes
|
// Pomodoro is usually for 25 minutes
|
||||||
|
|
||||||
if (!this.timeInSeconds) {
|
if (!this.timeInSeconds) {
|
||||||
|
|
||||||
this.timeInSeconds = 600;
|
this.timeInSeconds = 600;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.time = this.timeInSeconds;
|
this.time = this.timeInSeconds;
|
||||||
|
|
||||||
this.runTimer = false;
|
this.runTimer = false;
|
||||||
|
|
||||||
this.hasStarted = false;
|
this.hasStarted = false;
|
||||||
|
|
||||||
this.hasFinished = false;
|
this.hasFinished = false;
|
||||||
|
|
||||||
this.remainingTime = this.timeInSeconds;
|
this.remainingTime = this.timeInSeconds;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime);
|
this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
startTimer() {
|
startTimer() {
|
||||||
|
|
||||||
this.runTimer = true;
|
this.runTimer = true;
|
||||||
|
|
||||||
this.hasStarted = true;
|
this.hasStarted = true;
|
||||||
|
|
||||||
this.timerTick();
|
this.timerTick();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pauseTimer() {
|
pauseTimer() {
|
||||||
|
|
||||||
this.runTimer = false;
|
this.runTimer = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resumeTimer() {
|
resumeTimer() {
|
||||||
|
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
timerTick() {
|
timerTick() {
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
if (!this.runTimer) {
|
if (!this.runTimer) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.remainingTime--;
|
this.remainingTime--;
|
||||||
|
|
||||||
this.displayTime = this.common.getSecondsAsDigitalClock(
|
this.displayTime = this.common.getSecondsAsDigitalClock(
|
||||||
|
|
||||||
this.remainingTime
|
this.remainingTime
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (this.remainingTime > 0) {
|
if (this.remainingTime > 0) {
|
||||||
|
|
||||||
this.timerTick();
|
this.timerTick();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.hasFinished = true;
|
this.hasFinished = true;
|
||||||
|
|
||||||
this.pauseTimer();
|
this.pauseTimer();
|
||||||
|
|
||||||
this.navCtrl.pop();
|
this.navCtrl.pop();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ionViewWillLeave() {
|
ionViewWillLeave() {
|
||||||
|
|
||||||
this.pauseTimer();
|
this.pauseTimer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
checkOTPLength(){
|
checkOTPLength(){
|
||||||
|
|
||||||
console.log(this.activationCode.length);
|
console.log(this.activationCode.length);
|
||||||
|
|
||||||
if(this.activationCode.length==4){
|
if(this.activationCode.length==4){
|
||||||
|
|
||||||
this.checkVerificationCode();
|
this.checkVerificationCode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkVerificationCode() {
|
checkVerificationCode() {
|
||||||
|
|
||||||
if (this.count < 3) {
|
if (this.count < 3) {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
||||||
this.activationCode == undefined ||
|
this.activationCode == undefined ||
|
||||||
|
|
||||||
this.activationCode == null ||
|
this.activationCode == null ||
|
||||||
|
|
||||||
this.activationCode == ""
|
this.activationCode == ""
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// this.common.showAlert(this.translate.translate('verificationcode.emptyCode'));
|
// this.common.showAlert(this.translate.translate('verificationcode.emptyCode'));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.count = this.count + 1;
|
this.count = this.count + 1;
|
||||||
|
|
||||||
if (this.isForgetPwd || this.isExpiredPwd) {
|
if (this.isForgetPwd || this.isExpiredPwd) {
|
||||||
|
|
||||||
this.checkForgetPwdSMS();
|
this.checkForgetPwdSMS();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.checkSMS();
|
this.checkSMS();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
let msg: string = this.translate.trPK("general", "noOfTriesLogin");
|
let msg: string = this.translate.trPK("general", "noOfTriesLogin");
|
||||||
|
|
||||||
this.common.JustAlertDialog(this.translate.trPK("general", "ok"), msg);
|
this.common.JustAlertDialog(this.translate.trPK("general", "ok"), msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public checkSMS() {
|
public checkSMS() {
|
||||||
|
|
||||||
|
// alert("checkSMS in page")
|
||||||
|
|
||||||
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
||||||
|
|
||||||
const request = new SMSCheckRequest();
|
const request = new SMSCheckRequest();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
request.LogInTokenID = data.LogInTokenID;
|
request.LogInTokenID = data.LogInTokenID;
|
||||||
|
|
||||||
request.activationCode = this.activationCode;
|
request.activationCode = this.activationCode;
|
||||||
|
|
||||||
request.P_USER_NAME = data.P_USER_NAME;
|
request.P_USER_NAME = data.P_USER_NAME;
|
||||||
|
|
||||||
request.MobileNumber = data.MobileNumber;
|
request.MobileNumber = data.MobileNumber;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.authService
|
this.authService
|
||||||
|
|
||||||
.checkSMS(request, () => {}, this.translate.trPK("general", "ok"))
|
.checkSMS(request, () => {}, this.translate.trPK("general", "ok"))
|
||||||
|
|
||||||
.subscribe((result: SMSCheckResponse) => {
|
.subscribe((result: SMSCheckResponse) => {
|
||||||
|
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
|
||||||
if (this.common.validResponse(result)) {
|
if (this.common.validResponse(result)) {
|
||||||
|
|
||||||
AuthenticationService.servicePrivilage=result.Privilege_List;
|
AuthenticationService.servicePrivilage=result.Privilege_List;
|
||||||
|
|
||||||
this.authService.setAuthenticatedUser(result).subscribe(() => {
|
this.authService.setAuthenticatedUser(result).subscribe(() => {
|
||||||
|
|
||||||
|
//call insert Mobile Login
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (this.platform.is("mobile")) {
|
||||||
|
|
||||||
|
this.insertMobileLogin();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this.common.openHome();
|
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() {
|
public checkForgetPwdSMS() {
|
||||||
|
|
||||||
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
||||||
|
|
||||||
const request = new SMSCheckRequest();
|
const request = new SMSCheckRequest();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
request.LogInTokenID = data.LogInTokenID;
|
request.LogInTokenID = data.LogInTokenID;
|
||||||
|
|
||||||
request.activationCode = this.activationCode;
|
request.activationCode = this.activationCode;
|
||||||
|
|
||||||
request.P_USER_NAME = data.P_USER_NAME;
|
request.P_USER_NAME = data.P_USER_NAME;
|
||||||
|
|
||||||
console.log(data.LogInTokenID);
|
console.log(data.LogInTokenID);
|
||||||
|
|
||||||
console.log(data.P_USER_NAME);
|
console.log(data.P_USER_NAME);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.authService
|
this.authService
|
||||||
|
|
||||||
.checkForgetSMS(request, () => {}, this.translate.trPK("general", "ok"))
|
.checkForgetSMS(request, () => {}, this.translate.trPK("general", "ok"))
|
||||||
|
|
||||||
.subscribe((result: SMSCheckResponse) => {
|
.subscribe((result: SMSCheckResponse) => {
|
||||||
|
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
|
||||||
if (this.common.validResponse(result)) {
|
if (this.common.validResponse(result)) {
|
||||||
|
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
|
||||||
if (this.isForgetPwd) {
|
if (this.isForgetPwd) {
|
||||||
|
|
||||||
this.common.openForgotPassword();
|
this.common.openForgotPassword();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.isExpiredPwd) {
|
if(this.isExpiredPwd) {
|
||||||
|
|
||||||
this.sharedData.setSharedData(true,Password.IS_EXPIRED_PSW);
|
this.sharedData.setSharedData(true,Password.IS_EXPIRED_PSW);
|
||||||
|
|
||||||
this.common.openChangePassword();
|
this.common.openChangePassword();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,30 +1,35 @@
|
|||||||
import { Request } from '../../models/request';
|
// import { Request } from '../../models/request';
|
||||||
|
import { Request } from 'src/app/hmg-common/services/models/request';
|
||||||
import { AuthenticatedUser } from './authenticated-user';
|
import { AuthenticatedUser } from './authenticated-user';
|
||||||
import { CountryCode } from 'src/app/hmg-common/ui/mobile-number/international-mobile/models/country-code.model';
|
import { CountryCode } from 'src/app/hmg-common/ui/mobile-number/international-mobile/models/country-code.model';
|
||||||
|
|
||||||
export class GetLoginInfoRequest extends Request {
|
export class GetLoginInfoRequest extends Request {
|
||||||
NationalID: string;
|
UserName: string;
|
||||||
MobileNo: string;
|
MobileNumber: string;
|
||||||
|
LogInTokenID: string;
|
||||||
DeviceToken: string;
|
DeviceToken: string;
|
||||||
PatientID: number;
|
LanguageID: number;
|
||||||
ProjectOutSA: boolean;
|
P_USER_NAME: string;
|
||||||
LoginType: number; // 2 by patient id , 1 by identification number
|
Channel:number;
|
||||||
ZipCode: string;
|
CompanyID:number;
|
||||||
PatientMobileNumber: string; // same as mobileNO,
|
DeviceType:string;
|
||||||
SearchType: number; // 2
|
LoginType:number;
|
||||||
PatientIdentificationID: string // ""
|
// constructor(user: AuthenticatedUser) {
|
||||||
isRegister: boolean; // false
|
// super();
|
||||||
constructor(user: AuthenticatedUser) {
|
|
||||||
super();
|
|
||||||
// this.NationalID = user.IdentificationNo;
|
// this.NationalID = user.IdentificationNo;
|
||||||
// this.MobileNo = this.PatientMobileNumber = user.MobileNo;
|
// this.MobileNo = this.PatientMobileNumber = user.MobileNo;
|
||||||
// this.DeviceToken = user.deviceToken;
|
// this.DeviceToken = user.deviceToken;
|
||||||
// this.PatientID = user.PatientID;
|
// this.PatientID = user.PatientID;
|
||||||
// this.ProjectOutSA = user.PatientOutSA ;
|
// this.ProjectOutSA = user.PatientOutSA ;
|
||||||
this.LoginType = 2;
|
// this.LoginType = 2;
|
||||||
this.ZipCode = CountryCode.localCode( user.ZipCode);
|
// this.ZipCode = CountryCode.localCode( user.ZipCode);
|
||||||
this.SearchType = 2;
|
// this.SearchType = 2;
|
||||||
this.PatientIdentificationID = '';
|
// this.PatientIdentificationID = '';
|
||||||
this.isRegister = false;
|
// this.isRegister = false;
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,8 +1,11 @@
|
|||||||
import { Response } from '../../models/response';
|
//import { Response } from '../../models/response';
|
||||||
|
import { Response } from 'src/app/hmg-common/services/models/response';
|
||||||
|
|
||||||
export class GetLoginInfoResponse extends Response {
|
export class GetLoginInfoResponse extends Response {
|
||||||
SMSLoginRequired: boolean;
|
SMSLoginRequired: boolean;
|
||||||
isSMSSent: boolean;
|
isSMSSent: boolean;
|
||||||
LogInTokenID: string;
|
LogInTokenID: string;
|
||||||
PatientOutSA: boolean;
|
Mohemm_GetPatientID_List:any
|
||||||
|
isActiveCode: boolean;
|
||||||
|
// PatientOutSA: boolean;
|
||||||
}
|
}
|
||||||
@ -1,6 +1,9 @@
|
|||||||
import { Request } from '../../models/request';
|
// import { Request } from '../../models/request';
|
||||||
|
import { Request } from 'src/app/hmg-common/services/models/request';
|
||||||
|
|
||||||
export class SMSCheckRequest extends Request {
|
export class SMSCheckRequest extends Request {
|
||||||
LogInTokenID: string ;
|
LogInTokenID: string ;
|
||||||
activationCode?: string;
|
activationCode?: string;
|
||||||
|
public static SHARED_DATA = 'check_activation_shared_data';
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
//import { Response } from './response';
|
||||||
|
import { Response } from 'src/app/hmg-common/services/models/response';
|
||||||
|
|
||||||
|
export class GetItgCount extends Response {
|
||||||
|
public BUTTON_SEQ = -1;
|
||||||
|
public BUTTON_LABEL = '';
|
||||||
|
public BUTTON_ACTION = '';
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 5.2 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue