Merge branch 'master' of https://hmg.git.cloudforge.com/mohemmionic5
@ -1 +1 @@
|
||||
to add ios - ionic cordova platform add ios
|
||||
to add ios - ionic cordova platform add ios
|
||||
|
||||
@ -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{
|
||||
public static SHARED_DATA = 'absence_tr_id';
|
||||
public P_TRANSACTION_ID:number;
|
||||
|
||||
@ -1,226 +1,462 @@
|
||||
|
||||
import { Component, OnInit } 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 { 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 { SMSCheckRequest } from "src/app/hmg-common/services/authentication/models/smscheck.request";
|
||||
|
||||
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",
|
||||
|
||||
templateUrl: "./sms-page.page.html",
|
||||
|
||||
styleUrls: ["./sms-page.page.scss"]
|
||||
|
||||
})
|
||||
|
||||
export class SmsPageComponent implements OnInit {
|
||||
|
||||
public static LOGIN_DATA = "LOGIN_DATA";
|
||||
|
||||
Channel: number = 0;
|
||||
|
||||
activationCode: string;
|
||||
|
||||
P_SESSION_ID: number;
|
||||
|
||||
P_USER_NAME: string;
|
||||
|
||||
timeInSeconds: any;
|
||||
|
||||
time: any;
|
||||
|
||||
runTimer: any;
|
||||
|
||||
hasStarted: any;
|
||||
|
||||
hasFinished: any;
|
||||
|
||||
remainingTime: any;
|
||||
|
||||
displayTime: any;
|
||||
|
||||
loginTokenID: string;
|
||||
|
||||
public isForgetPwd: boolean = false;
|
||||
|
||||
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,
|
||||
|
||||
public common: CommonService,
|
||||
|
||||
private elementRef: ElementRef,
|
||||
|
||||
public authService: AuthenticationService,
|
||||
public sharedData: SharedDataService
|
||||
|
||||
public sharedData: SharedDataService,
|
||||
|
||||
public platform: Platform,
|
||||
|
||||
|
||||
|
||||
) {}
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.count = 0;
|
||||
|
||||
this.initTimer();
|
||||
|
||||
this.startTimer();
|
||||
|
||||
this.isForgetPwd =
|
||||
|
||||
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);
|
||||
|
||||
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() {
|
||||
|
||||
// Pomodoro is usually for 25 minutes
|
||||
|
||||
if (!this.timeInSeconds) {
|
||||
|
||||
this.timeInSeconds = 600;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.time = this.timeInSeconds;
|
||||
|
||||
this.runTimer = false;
|
||||
|
||||
this.hasStarted = false;
|
||||
|
||||
this.hasFinished = false;
|
||||
|
||||
this.remainingTime = this.timeInSeconds;
|
||||
|
||||
|
||||
|
||||
this.displayTime = this.common.getSecondsAsDigitalClock(this.remainingTime);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
startTimer() {
|
||||
|
||||
this.runTimer = true;
|
||||
|
||||
this.hasStarted = true;
|
||||
|
||||
this.timerTick();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
pauseTimer() {
|
||||
|
||||
this.runTimer = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
resumeTimer() {
|
||||
|
||||
this.startTimer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
timerTick() {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
if (!this.runTimer) {
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
this.remainingTime--;
|
||||
|
||||
this.displayTime = this.common.getSecondsAsDigitalClock(
|
||||
|
||||
this.remainingTime
|
||||
|
||||
);
|
||||
|
||||
if (this.remainingTime > 0) {
|
||||
|
||||
this.timerTick();
|
||||
|
||||
} else {
|
||||
|
||||
this.hasFinished = true;
|
||||
|
||||
this.pauseTimer();
|
||||
|
||||
this.navCtrl.pop();
|
||||
|
||||
}
|
||||
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ionViewWillLeave() {
|
||||
|
||||
this.pauseTimer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
checkOTPLength(){
|
||||
|
||||
console.log(this.activationCode.length);
|
||||
|
||||
if(this.activationCode.length==4){
|
||||
|
||||
this.checkVerificationCode();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
checkVerificationCode() {
|
||||
|
||||
if (this.count < 3) {
|
||||
|
||||
if (
|
||||
|
||||
this.activationCode == undefined ||
|
||||
|
||||
this.activationCode == null ||
|
||||
|
||||
this.activationCode == ""
|
||||
|
||||
) {
|
||||
|
||||
// this.common.showAlert(this.translate.translate('verificationcode.emptyCode'));
|
||||
|
||||
} else {
|
||||
|
||||
this.count = this.count + 1;
|
||||
|
||||
if (this.isForgetPwd || this.isExpiredPwd) {
|
||||
|
||||
this.checkForgetPwdSMS();
|
||||
|
||||
} else {
|
||||
|
||||
this.checkSMS();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
let msg: string = this.translate.trPK("general", "noOfTriesLogin");
|
||||
|
||||
this.common.JustAlertDialog(this.translate.trPK("general", "ok"), msg);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public checkSMS() {
|
||||
|
||||
// alert("checkSMS in page")
|
||||
|
||||
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
|
||||
|
||||
const request = new SMSCheckRequest();
|
||||
|
||||
|
||||
|
||||
request.LogInTokenID = data.LogInTokenID;
|
||||
|
||||
request.activationCode = this.activationCode;
|
||||
|
||||
request.P_USER_NAME = data.P_USER_NAME;
|
||||
|
||||
request.MobileNumber = data.MobileNumber;
|
||||
|
||||
|
||||
|
||||
this.authService
|
||||
|
||||
.checkSMS(request, () => {}, this.translate.trPK("general", "ok"))
|
||||
|
||||
.subscribe((result: SMSCheckResponse) => {
|
||||
|
||||
console.log(result);
|
||||
|
||||
if (this.common.validResponse(result)) {
|
||||
|
||||
AuthenticationService.servicePrivilage=result.Privilege_List;
|
||||
|
||||
this.authService.setAuthenticatedUser(result).subscribe(() => {
|
||||
|
||||
//call insert Mobile Login
|
||||
this.insertMobileLogin();
|
||||
|
||||
|
||||
|
||||
if (this.platform.is("mobile")) {
|
||||
|
||||
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();
|
||||
|
||||
|
||||
|
||||
request.LogInTokenID = data.LogInTokenID;
|
||||
|
||||
request.activationCode = this.activationCode;
|
||||
|
||||
request.P_USER_NAME = data.P_USER_NAME;
|
||||
|
||||
console.log(data.LogInTokenID);
|
||||
|
||||
console.log(data.P_USER_NAME);
|
||||
|
||||
|
||||
|
||||
this.authService
|
||||
|
||||
.checkForgetSMS(request, () => {}, this.translate.trPK("general", "ok"))
|
||||
|
||||
.subscribe((result: SMSCheckResponse) => {
|
||||
|
||||
console.log(result);
|
||||
|
||||
if (this.common.validResponse(result)) {
|
||||
|
||||
console.log(result);
|
||||
|
||||
if (this.isForgetPwd) {
|
||||
|
||||
this.common.openForgotPassword();
|
||||
|
||||
}
|
||||
|
||||
if(this.isExpiredPwd) {
|
||||
|
||||
this.sharedData.setSharedData(true,Password.IS_EXPIRED_PSW);
|
||||
|
||||
this.common.openChangePassword();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -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 = '';
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.7 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |