Merge branch 'master-newdesign' into fatma-issu

MOHEMM-Q3-DEV-LATEST
Mohamed Mekawy 6 years ago
commit 168436f754

@ -443,9 +443,9 @@ export class SubmitAbsenceComponent implements OnInit {
this.textInput = new TextInput( this.textInput = new TextInput(
feildsList[i].SEGMENT_PROMPT, feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME, feildsList[i].APPLICATION_COLUMN_NAME,
defaultValText, defaultVal,
containerId, containerId,
defaultVal, defaultValText,
feildsList[i].MOBILE_ENABLED, feildsList[i].MOBILE_ENABLED,
feildsList[i].DISPLAY_FLAG, feildsList[i].DISPLAY_FLAG,
feildsList[i].REQUIRED_FLAG feildsList[i].REQUIRED_FLAG

@ -23,7 +23,7 @@
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/username.png" item-start /> <img class="item-icon" src="assets/imgs/username.png" item-start />
<ion-label>{{ts.trPK('login','check-user-text1')}}</ion-label> <ion-label>{{ts.trPK('login','check-user-place-holder')}}</ion-label>
<ion-input class="login-input" required type="text" [(ngModel)]="P_USER_NAME"> <ion-input class="login-input" required type="text" [(ngModel)]="P_USER_NAME">
</ion-input> </ion-input>
</ion-item> </ion-item>

@ -32,8 +32,8 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<div *ngIf="onlySMSBox"><p>{{ts.trPK('login','verify-login-with')}}</p></div> <div *ngIf="onlySMSBox"><p>{{ts.trPK('login','verify-login-with')}}</p></div>
<div *ngIf="!onlySMSBox && FFloginType == 2"><p>{{ts.trPK('login','verify-fingerprint')}}</p></div> <div *ngIf="!onlySMSBox && FFloginType == 2"><p>{{ts.trPK('login','verify-fingerprint')}}</p></div>
<div *ngIf="!onlySMSBox && FFloginType == 3"><p>{{ts.trPK('login','verify-faceId')}}</p></div> <div *ngIf="!onlySMSBox && FFloginType == 3"><p>{{ts.trPK('login','verify-faceId')}}</p></div>
</ion-col> </ion-col>
</ion-row> </ion-row>

@ -318,6 +318,12 @@ export class ConfirmLoginComponent implements OnInit {
console.log(el.value); console.log(el.value);
localStorage.setItem("login-type",el.value); localStorage.setItem("login-type",el.value);
console.log("login-type: "+ localStorage.getItem("login-type")) console.log("login-type: "+ localStorage.getItem("login-type"))
if(this.FFloginType == 3 || this.FFloginType == 2 ){
this.cs.setActiveTypeLogin(el.value);
}else{
this.cs.setActiveTypeLogin(0);
}
this.loginWithSMS(el); this.loginWithSMS(el);
break; break;
@ -339,7 +345,7 @@ export class ConfirmLoginComponent implements OnInit {
console.log(el.value); console.log(el.value);
this.faceReconization(el); this.faceReconization(el);
break; break;
@ -349,8 +355,12 @@ export class ConfirmLoginComponent implements OnInit {
console.log(el.value); console.log(el.value);
localStorage.setItem("login-type",el.value); localStorage.setItem("login-type",el.value);
if(this.FFloginType == 3 || this.FFloginType == 2 ){
this.cs.setActiveTypeLogin(el.value);
}else{
this.cs.setActiveTypeLogin(0);
}
this.loginWithWhatsapp(el); this.loginWithWhatsapp(el);
break; break;
@ -463,17 +473,13 @@ export class ConfirmLoginComponent implements OnInit {
request.LogInTokenID =this.loginData.LogInTokenID; request.LogInTokenID =this.loginData.LogInTokenID;
request.P_LEGISLATION_CODE ="SA"; request.P_LEGISLATION_CODE =this.loginData.P_LEGISLATION_CODE;//"SA";
// request.VersionID ="2.0"; // request.VersionID ="2.0";
// request.LanguageID = imeiData && imeiData.PreferredLanguage || request.LanguageID;
// request.LanguageID = imeiData && imeiData.PreferredLanguage || request.LanguageID;
this.authService this.authService

@ -6,4 +6,5 @@ export class LoginModel {
EMPLOYEE_DISPLAY_NAME: string; EMPLOYEE_DISPLAY_NAME: string;
EMPLOYEE_NAME:string; EMPLOYEE_NAME:string;
EmployeeName:string; EmployeeName:string;
P_LEGISLATION_CODE:string;
} }

@ -21,9 +21,9 @@
<p class="leftDiv">{{'verificationcode,title' | translate}} <p class="leftDiv">{{'verificationcode,title' | translate}}
<span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span> <span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span>
{{'verificationcode,by' | translate}} {{'verificationcode,by' | translate}}
<span *ngIf="loginType == 1" class="boldTxtNav">{{'verificationcode , sms' | translate}}</span> <span *ngIf="loginType == 1 || activeType == 1" class="boldTxtNav">{{'verificationcode , sms' | translate}}</span>
<span *ngIf="loginType == 4" class="boldTxtNav">{{'verificationcode , whatsapp' | translate}}</span> <span *ngIf="loginType == 4 || activeType == 4" class="boldTxtNav">{{'verificationcode , whatsapp' | translate}}</span>
{{'verificationcode,instruct' | translate}} {{'verificationcode,instruct' | translate}}
<span class="boldTxtNav">{{'general,submit' | translate}}</span <span class="boldTxtNav">{{'general,submit' | translate}}</span
></p> ></p>

@ -1,510 +1,246 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { ElementRef } from '@angular/core';
import { ElementRef } from "@angular/core"; import { NavController, Platform } from '@ionic/angular';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { NavController, Platform } from "@ionic/angular"; 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 { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request';
import { LoginModel } from '../models/LoginModel';
import { CommonService } from "src/app/hmg-common/services/common/common.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 { SharedDataService } from "src/app/hmg-common/services/shared-data-service/shared-data.service"; import { Password } from '../models/password';
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'; import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request';
import * as moment from "moment"; import * as moment from 'moment';
@Component({ @Component({
selector: 'app-sms-page',
selector: "app-sms-page", templateUrl: './sms-page.page.html',
styleUrls: ['./sms-page.page.scss']
templateUrl: "./sms-page.page.html",
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 = 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 = false;
public isForgetPwd: boolean = false; public isExpiredPwd = false;
public count = 0;
public isExpiredPwd: boolean = false;
public count: number = 0;
private loginData = new LoginModel(); private loginData = new LoginModel();
public deviceToken: any;
public deviceToken:any; public loginTypeData: any;
public logo = 'assets/icon/login/password.png';
public loginTypeData:any; // tslint:disable-next-line: variable-name
public logo = "assets/icon/login/password.png";
public smc_code: any = []; public smc_code: any = [];
code: any; code: any;
// tslint:disable-next-line: variable-name
user_name: string; user_name: string;
public isPostNoLoad = true;
loginType: any; loginType: any;
activeType: 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, public platform: Platform,
) {} ) {}
ngOnInit() { ngOnInit() {
this.activeType=this.common.getActiveTypeLogin();
console.log("activeType :"+this.activeType);
this.count = 0; this.count = 0;
this.initTimer(); this.initTimer();
this.startTimer(); this.startTimer();
this.isForgetPwd = this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false;
this.isForgetPwd = this.isExpiredPwd = this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false;
this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false; this.deviceToken = this.common.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
// tslint:disable-next-line: triple-equals
this.isExpiredPwd = if (this.deviceToken == undefined) {
this.deviceToken = localStorage.getItem('deviceToken');
this.sharedData.getSharedData(Password.IS_EXPIRED_PSW) || false; }
console.log('deviceToken :' + this.deviceToken);
this.loginData= this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); this.loginTypeData = this.common.sharedService.getSharedData(SMSCheckRequest.SHARED_DATA, false);
if( this.loginTypeData){
console.log("loginData : "+ this.loginData); this.loginType=this.loginTypeData.loginType;
// this.loginType=this.loginTypeData.loginType;
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);
this.loginType=this.loginTypeData.loginType;
console.log("loginType :"+this.loginTypeData.loginType); console.log("loginType :"+this.loginTypeData.loginType);
}else{
this.loginType=1;
}
} }
initTimer() { initTimer() {
// 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.remainingTime);
this.displayTime = this.common.getSecondsAsDigitalClock(
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() {
// tslint:disable-next-line: triple-equals
checkOTPLength(){ if (this.activationCode.length == 4) {
console.log(this.activationCode.length);
if(this.activationCode.length==4){
this.checkVerificationCode(); this.checkVerificationCode();
} }
} }
checkVerificationCode() { checkVerificationCode() {
this.code=this.smc_code.join(''); this.code = this.smc_code.join('');
if (this.count < 3) { if (this.count < 3) {
// tslint:disable-next-line: triple-equals
if ( if (this.code == undefined || this.code == null || this.code == '') {
this.code == undefined ||
this.code == null ||
this.code == ""
) {
// 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 {
console.log("checkSMS");
this.checkSMS(); this.checkSMS();
} }
} }
} else { } else {
const 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() {
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
// alert("checkSMS in page") const request = new SMSCheckRequest();
console.log("code" + this.code); request.LogInTokenID = data.LogInTokenID;
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); request.activationCode = this.code; // code;this.activationCode;
request.P_USER_NAME = data.P_USER_NAME;
const request = new SMSCheckRequest(); request.MobileNumber = data.MobileNumber;
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
request.LogInTokenID = data.LogInTokenID;
request.activationCode = this.code; //code;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)) { 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(() => {
localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME);
//call insert Mobile Login this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME;
console.log("insert"); const currDateTime = moment().format('MMM DD , YYYY HH:mm');
localStorage.setItem("emp-name",result.MemberInformationList[0].EMPLOYEE_NAME); localStorage.setItem('login-at', currDateTime);
console.log("empnmae: "+ localStorage.getItem("emp-name")); if (this.platform.is('cordova')) {
// localStorage.setItem("login-at", new Date().toISOString());
this.user_name=result.MemberInformationList[0].EMPLOYEE_NAME;
//get date and time of last login
let currDateTime = moment().format('MMM DD , YYYY HH:mm')
localStorage.setItem("login-at",currDateTime);
if (this.platform.is("cordova")) {
// localStorage.setItem("full-name", result.P_USER_NAME);
this.insertMobileLogin(); this.insertMobileLogin();
} }
this.common.openHome(); this.common.openHome();
}); });
} }
}); });
} }
public insertMobileLogin() {
const request = new GetLoginInfoRequest();
public insertMobileLogin(){
console.log("loginData" + this.loginData);
let request = new GetLoginInfoRequest();
this.authService.setPublicFields(request); this.authService.setPublicFields(request);
request.MobileNumber = this.loginData.MobileNumber; request.MobileNumber = this.loginData.MobileNumber;
request.P_USER_NAME = this.loginData.P_USER_NAME;
request.P_USER_NAME=this.loginData.P_USER_NAME; request.UserName = this.loginData.P_USER_NAME;
request.LogInTokenID = this.loginData.LogInTokenID;
request.UserName=this.loginData.P_USER_NAME; request.CompanyID = 1; // CompanyID
request.DeviceType = this.common.getDeviceType();
request.LogInTokenID =this.loginData.LogInTokenID; request.DeviceToken = this.deviceToken; // "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken;
request.LoginType = this.loginTypeData.loginType;
request.CompanyID =1;//CompanyID request.EmployeeName = this.user_name;
this.authService.insertMobileLoginInfo(request, () => { }, this.translate.trPK('general', 'ok'), this.isPostNoLoad)
request.DeviceType= this.common.getDeviceType(); .subscribe((result: any) => {
console.log('successful insertMobileLogin' );
request.DeviceToken=this.deviceToken;//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken; });
request.LoginType=this.loginTypeData.loginType;
request.EmployeeName=this.user_name;
this.authService
.insertMobileLoginInfo(
request,
() => { },
this.translate.trPK("general", "ok")
)
.subscribe((result: any) => {
});
} }
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.code; // this.activationCode;
request.activationCode =this.code;// this.activationCode;
request.P_USER_NAME = data.P_USER_NAME; request.P_USER_NAME = data.P_USER_NAME;
this.authService.checkForgetSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
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)) { if (this.common.validResponse(result)) {
console.log(result);
if (this.isForgetPwd) { if (this.isForgetPwd) {
this.common.openForgotPassword(); this.common.openForgotPassword();
}
} if (this.isExpiredPwd) {
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
if(this.isExpiredPwd) {
this.sharedData.setSharedData(true,Password.IS_EXPIRED_PSW);
this.common.openChangePassword(); this.common.openChangePassword();
} }
} }
}); });
} }
onChange() { onChange() {
const filtered = this.smc_code.filter(function (el) { // tslint:disable-next-line: only-arrow-functions
const filtered = this.smc_code.filter(function(el) {
if (el) { if (el) {
return el; return el;
} }
}); });
if (filtered.length === 4) { if (filtered.length === 4) {
//this.validate();
console.log("validate");
this.checkVerificationCode(); this.checkVerificationCode();
} }
} }
goToNextInput(e) { goToNextInput(e) {
// let value = e.target.value;
// if (value.length === 1) {
const key = e.which; const key = e.which;
const t = e.target; const t = e.target;
let sib = t.nextElementSibling; const sib = t.nextElementSibling;
let sibPre =t.previousElementSibling; const sibPre = t.previousElementSibling;
if (key !== 9 && (key < 48 || key > 57)) { if (key !== 9 && (key < 48 || key > 57)) {
if (key === 8 || key === 46) { if (key === 8 || key === 46) {
return true; return true;
} else { } else {
e.preventDefault(); e.preventDefault();
@ -515,22 +251,13 @@ export class SmsPageComponent implements OnInit {
if (key === 9) { if (key === 9) {
return true; return true;
} }
if (sib) { if (sib) {
//sib = document.querySelector('input'); if (e.target.value === '') {
if (e.target.value ==="") { sibPre.setFocus();
sibPre.setFocus()} } else {
else{
sib.setFocus(); sib.setFocus();
}
} }
} }
// } else { }
// e.target.value = value.substring(0, value.length - 1); }
// }
}

@ -16,17 +16,18 @@
--> -->
<!-- <app-generic-header <app-generic-header
showBack="!getPassdirfromNotifiPage" showBack="!getPassdirfromNotifiPage"
[updateDirection]="getPassdirfromNotifiPage" [updateDirection]="getPassdirfromNotifiPage"
[headerText]="headerTitle" [headerText]="headerTitle"
(trigger)="closemodal()"> (trigger)="closeModal()"
</app-generic-header> --> >
</app-generic-header>
<app-generic-header <!-- <app-generic-header
showBack="true" showBack="true"
[headerText]="headerTitle"> [headerText]="headerTitle">
</app-generic-header> </app-generic-header> -->
<ion-content padding> <ion-content padding>
<div #containerDiv id="containerDiv"> <div #containerDiv id="containerDiv">

@ -417,7 +417,8 @@ export class AddEitComponent implements OnInit {
} }
} }
closemodal() { closeModal() {
console.log("closeModal");
this.updatedValues = []; this.updatedValues = [];
this.modalController.dismiss(); this.modalController.dismiss();
} }
@ -664,6 +665,8 @@ export class AddEitComponent implements OnInit {
let obj = this.handleDefaultValueResult(result); let obj = this.handleDefaultValueResult(result);
let val = obj.value; let val = obj.value;
let text = obj.text; let text = obj.text;
if (val==null){val="";}
if (text==null){text="";}
if (isStandardDate) { if (isStandardDate) {
console.log("isStandardDate"); console.log("isStandardDate");
elem.value = this.cs.reverseFormatDate(val); elem.value = this.cs.reverseFormatDate(val);
@ -681,6 +684,7 @@ export class AddEitComponent implements OnInit {
if (val) { if (val) {
elem.dataset.dtvalue = val; elem.dataset.dtvalue = val;
elem.innerHTML = val; elem.innerHTML = val;
elem.value=val;
} else { } else {
elem.dataset.dtvalue = ""; elem.dataset.dtvalue = "";
elem.innerHTML = ""; elem.innerHTML = "";
@ -1216,7 +1220,11 @@ export class AddEitComponent implements OnInit {
this.eitResponse[i].DISPLAY_FLAG != "N" this.eitResponse[i].DISPLAY_FLAG != "N"
) { ) {
//time //time
if(elemVal.length>5){
elemVal = elemVal.substring(11, 16); elemVal = elemVal.substring(11, 16);
}else{
elemVal = elemVal;
}
} }
if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) {
elem.classList.add("requiredClassElm"); elem.classList.add("requiredClassElm");
@ -1225,11 +1233,11 @@ export class AddEitComponent implements OnInit {
} else { } else {
elem.classList.remove("requiredClassElm"); elem.classList.remove("requiredClassElm");
} }
if (elemVal != 'null'){ // if (elemVal != 'null'){
varcharValue = elemVal; varcharValue = elemVal;
} else{ //} else{
elemVal = null; // elemVal = null;
} // }
valuseArr.push({ valuseArr.push({
TRANSACTION_NUMBER: transNo, TRANSACTION_NUMBER: transNo,
NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME, NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME,

@ -46,12 +46,17 @@ export class EitUpdateListComponent implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then((data: any) => { .then((data: any) => {
console.log("data" + data); // console.log("data" + data);
console.log("data" + data.data.updated); // console.log("data" + data.data.updated);
console.log("data" + data.data.eitRequest.EITTransactionTBL); // console.log("data" + data.data.eitRequest.EITTransactionTBL);
if (data) {
if(data.data == undefined)
{
return;
}
else if (data.data) {
this.updatedData = this.updatedData ? this.updatedData.concat(data.data.updated) : data.data.updated; this.updatedData = this.updatedData ? this.updatedData.concat(data.data.updated) : data.data.updated;
this.notificationBodyRes[index].Collection_Notification = data.data.updated; this.notificationBodyRes[index].Collection_Notification = data.data.updated;
this.updateTransactionList(data.data.eitRequest.EITTransactionTBL); this.updateTransactionList(data.data.eitRequest.EITTransactionTBL);

@ -555,10 +555,14 @@ export class AuthenticationService {
public insertMobileLoginInfo(request: GetLoginInfoRequest,onError: any, errorLabel: string): Observable<GetLoginInfoResponse> { // tslint:disable-next-line: max-line-length
public insertMobileLoginInfo(request: GetLoginInfoRequest, onError: any, errorLabel: string, isPostNoLoad = false): Observable<GetLoginInfoResponse> {
this.authenticateRequest(request); this.authenticateRequest(request);
if (isPostNoLoad) {
return this.con.post(AuthenticationService.insertMobileLoginInfo,request,onError,errorLabel); return this.con.postNoLoad(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
} else {
return this.con.post(AuthenticationService.insertMobileLoginInfo, request, onError, errorLabel);
}
} }

@ -81,6 +81,7 @@ export class CommonService {
public updateImage:boolean=false; public updateImage:boolean=false;
public setUpdateImg:any; public setUpdateImg:any;
DT: any; DT: any;
activeType: any;
constructor( constructor(
public nav: NavController, public nav: NavController,
public router: Router, public router: Router,
@ -1430,5 +1431,12 @@ public getMonthNameAr(value: number): string {
return this.DT; return this.DT;
} }
setActiveTypeLogin(activeType){
this.activeType=activeType;
}
getActiveTypeLogin(){
return this.activeType;
}
} }

@ -64,6 +64,31 @@ public static host = 'https://uat.hmgwebservices.com/';
); );
} }
public postItg(
service: string,
data: any,
onError: any,
errorLabel?: string
): Observable<any> {
this.cs.startLoading();
return this.httpClient
.post<any>(
ConnectorService.host + service,
data,
ConnectorService.httpOptions
)
.pipe(
timeout(ConnectorService.timeOut),
retry(ConnectorService.retryTimes),
tap(
res => this.handleResponseItg(res, onError, errorLabel),
error => this.handleError(error, onError, errorLabel)
)
);
}
// public postNoLoad(service: string, data: any, onError: any): Observable<any> { // public postNoLoad(service: string, data: any, onError: any): Observable<any> {
// return this.httpClient // return this.httpClient
// .post<any>( // .post<any>(
@ -170,7 +195,10 @@ public static host = 'https://uat.hmgwebservices.com/';
this.cs.stopLoading(); this.cs.stopLoading();
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
this.cs.sharedService.clearAll(); this.cs.sharedService.clearAll();
// this.cs.setIsTimeSessionOut(result.IsAuthenticated);
this.cs.openLogin(); this.cs.openLogin();
}); });
return false; return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) { } else if (result.ErrorType === 2 || result.ErrorType === 4) {
@ -183,10 +211,48 @@ public static host = 'https://uat.hmgwebservices.com/';
errorLabel, errorLabel,
result.ErrorEndUserMessage result.ErrorEndUserMessage
); );
//add flag if user not auth
} }
} }
} }
public handleResponseItg(result: Response, onError: any, errorLabel: string, isPostNoLoad = false) {
console.log("handleResponseItg");
if (!isPostNoLoad) {
this.cs.stopLoading();
}
if (!this.cs.validResponse(result)) {
if (result.IsAuthenticated === false) {
this.cs.stopLoading();
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
console.log("presentAcceptDialog");
this.cs.sharedService.clearAll();
// this.cs.setIsTimeSessionOut(result.IsAuthenticated);
this.cs.openLogin();
});
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {
console.log("ErrorType if");
// console.log("error expired");
this.cs.stopLoading();
} else {
console.log("ErrorType else");
this.cs.stopLoading();
// this.cs.showErrorMessageDialog(
// onError,
// errorLabel,
// result.Message
// );
//add flag if user not auth
}
}
}
public getURLText( public getURLText(
url: string, url: string,
onError: any, onError: any,

@ -13,5 +13,6 @@ export class Response {
*/ */
public MessageStatus: number; public MessageStatus: number;
public SuccessMsg; public SuccessMsg;
public Message;
} }

@ -301,7 +301,7 @@ export class WorklistMainService {
itgrequest.EmployeeNumber = itgrequest.P_USER_NAME; itgrequest.EmployeeNumber = itgrequest.P_USER_NAME;
console.log(itgrequest); console.log(itgrequest);
console.log(actionURL); console.log(actionURL);
return this.api.post( return this.api.postItg(
actionURL, actionURL,
itgrequest, itgrequest,
onError, onError,

@ -208,6 +208,7 @@ export class WorkListMainItgComponent implements OnInit {
actionService(action, comments?, grantRequests?) { actionService(action, comments?, grantRequests?) {
let url: string; let url: string;
let request = new itgRequest(); let request = new itgRequest();
request.RequestType = this.request_name; request.RequestType = this.request_name;
@ -223,17 +224,35 @@ export class WorkListMainItgComponent implements OnInit {
url = WorkListMainItgComponent.APPROVAL; url = WorkListMainItgComponent.APPROVAL;
this.workListService.getITGActionRequest(request, url) this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => { .subscribe((result: any) => {
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
console.log("hello action 1");
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(1) this.confirmMsg(1)
// this.common.openNotificationPage(); // this.common.openNotificationPage();
this.skip(); this.skip();
}
}); });
} else if (action == 2) {//reject } else if (action == 2) {//reject
url = WorkListMainItgComponent.REJECT; url = WorkListMainItgComponent.REJECT;
this.workListService.getITGActionRequest(request, url) this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => { .subscribe((result: any) => {
console.log("hello action 2");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(2) this.confirmMsg(2)
// this.common.openNotificationPage(); // this.common.openNotificationPage();
this.skip(); this.skip();
}
}); });
} else if (action == 3) {//request more info } else if (action == 3) {//request more info
request.NewUserEMPId = this.replcamentID; request.NewUserEMPId = this.replcamentID;
@ -244,9 +263,20 @@ export class WorkListMainItgComponent implements OnInit {
request.Comments = comments; request.Comments = comments;
this.workListService.getITGActionRequest(request, url) this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => { .subscribe((result: any) => {
this.confirmMsg(3) console.log("hello action 3");
if (result.MessageStatus != 1) {
//this.common.presentAlert(result.Message);
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
}
if (result.MessageStatus == 1) {
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(3)
// this.common.openNotificationPage(); // this.common.openNotificationPage();
this.skip(); this.skip();
}
}); });
} }
} else if (action == 4) {//delegate } else if (action == 4) {//delegate
@ -254,9 +284,18 @@ export class WorkListMainItgComponent implements OnInit {
url = WorkListMainItgComponent.DELEGATE; url = WorkListMainItgComponent.DELEGATE;
this.workListService.getITGActionRequest(request, url) this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => { .subscribe((result: any) => {
console.log("hello action 4");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(4) this.confirmMsg(4)
// this.common.openNotificationPage(); // this.common.openNotificationPage();
this.skip(); this.skip();
}
}); });
} else if (action == 5) { //answer } else if (action == 5) { //answer
url = WorkListMainItgComponent.ANSWER; url = WorkListMainItgComponent.ANSWER;
@ -265,9 +304,18 @@ export class WorkListMainItgComponent implements OnInit {
} else { } else {
this.workListService.getITGActionRequest(request, url) this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => { .subscribe((result: any) => {
console.log("hello action 5");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(5) this.confirmMsg(5)
// this.common.openNotificationPage(); // this.common.openNotificationPage();
this.skip(); this.skip();
}
}); });
} }
} else if (action == 6) { //grant } else if (action == 6) { //grant
@ -280,9 +328,17 @@ export class WorkListMainItgComponent implements OnInit {
request.AdditionalFields = this.grantRequest; request.AdditionalFields = this.grantRequest;
this.workListService.getITGActionRequest(request, url) this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => { .subscribe((result: any) => {
console.log("hello action 6");
if (result.MessageStatus != 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(6) this.confirmMsg(6)
// this.common.openNotificationPage(); // this.common.openNotificationPage();
this.skip(); this.skip();
}
}); });
} else { } else {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment')); this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
@ -291,7 +347,10 @@ export class WorkListMainItgComponent implements OnInit {
} }
}, this.ts.trPK('general', 'ok'), }, this.ts.trPK('general', 'ok'),
() => { this.actionSelected = '' }, this.ts.trPK('general', 'cancel'), () => {
this.actionSelected = ''
},
this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'), this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg(action)); this.confirmMsg(action));
@ -299,6 +358,7 @@ export class WorkListMainItgComponent implements OnInit {
} }
confirmMsg(action) { confirmMsg(action) {
console.log("confirmMsg");
if (action === 1) { if (action === 1) {
return this.ts.trPK('worklist', 'approveMsg'); return this.ts.trPK('worklist', 'approveMsg');
} }

@ -56,12 +56,11 @@
</ion-list> </ion-list>
<div class="noteInput" *ngIf="isAnswer==true"> <div class="noteInput" *ngIf="isAnswer==true">
<ion-label class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} : <ion-label class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} :
{{pQuestion}} ?</ion-label> {{pQuestion}} ?</ion-label>
<ion-label class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}} <ion-label class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}}
</ion-label> </ion-label>
<ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label>
<ion-item> <ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea> <ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item> </ion-item>
@ -147,13 +146,10 @@
<ion-footer *ngIf="!messageSuccess"> <ion-footer *ngIf="!messageSuccess">
<div class="noteInput" *ngIf="isAnswer!=true"> <div class="noteInput" *ngIf="isAnswer== false">
<ion-label class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} :
{{pQuestion}} ?</ion-label> <ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
<ion-label class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}} </ion-label>
</ion-label>
<ion-label class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label>
<ion-item> <ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea> <ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item> </ion-item>

@ -10,9 +10,9 @@
<ion-content > <ion-content >
<div *ngIf="!messageSuccess"> <div *ngIf="!messageSuccess">
<div class="tipsPadding boldTxtNav"> <!-- <div [hidden]="!RFCEmployeeListListRes > 0" class="boldTxtNav">
{{'replacementRoll , msgRFC' | translate}} {{'replacementRoll , msgRFC' | translate}}
</div> </div> -->
<!-- <ion-list (ionChange)="radioChecked($event)" radio-group> <!-- <ion-list (ionChange)="radioChecked($event)" radio-group>
<ion-item *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;"> <ion-item *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;">
<ion-label>{{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}}</ion-label> <ion-label>{{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}}</ion-label>
@ -23,7 +23,9 @@
<div class="noDataDiv" *ngIf="!RFCEmployeeListListRes">
<p>{{ 'worklistMain, no-employee-available' | translate}}</p>
</div>
<ion-item lines="none"> <ion-item lines="none">
<div class="square-container"> <div class="square-container">

@ -36,8 +36,9 @@
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<ng-container *ngIf="activeSegment === 'info'"> <ng-container *ngIf="activeSegment === 'info'">
<div *ngIf="pInformation && pInformation != '' " class="tipsPadding">{{pInformation}}</div>
<div *ngIf="notificationBodyRes?.length > 0 "> <div *ngIf="notificationBodyRes?.length > 0 ">
<ion-card *ngFor="let item of notificationBodyRes;let i=index; "> <ion-card *ngFor="let item of notificationBodyRes;let i=index; ">

@ -1,11 +1,4 @@
.tipsPadding{
padding: 10px 10px;
border-radius: 10px;
margin: 10px;
border: 2px solid #e4e5e7;
color: var(--customnavy);
}
.actionBtn{ .actionBtn{

@ -45,7 +45,7 @@ export class TimeInput extends UiElement {
const template = const template =
"<ion-item class='dynamicField' style='" + this.hidden + "'>" + "<ion-item class='dynamicField' style='" + this.hidden + "'>" +
" <ion-label position='floating' style='font-size: medium !important;' class='dynamiclable-float " + requiredClass + "' id='title' >" + this.label + "</ion-label>" + " <ion-label position='floating' style='font-size: medium !important;' class='dynamiclable-float " + requiredClass + "' id='title' >" + this.label + "</ion-label>" +
"<ion-datetime display-format='h:mm' picker-format='h:mm' class='onic-date' value='" + this.value + "' done-text='" + doneText + "' cancel-text='" + cancelText + "' id='" + this.elementId + "' data-dtvalue='" + this.value + "' " + this.disabled + " ></ion-datetime>" + "<ion-datetime display-format='HH:mm' picker-format='HH:mm' class='onic-date' value='" + this.value + "' done-text='" + doneText + "' cancel-text='" + cancelText + "' id='" + this.elementId + "' data-dtvalue='" + this.value + "' " + this.disabled + " ></ion-datetime>" +
"</ion-item>" "</ion-item>"
return template; return template;
} }

@ -161,10 +161,14 @@
"en": "Verify its you", "en": "Verify its you",
"ar": "Verify its you" "ar": "Verify its you"
}, },
"check-user-text1":{ "check-user-place-holder":{
"en":"Employee ID", "en":"Employee ID",
"ar":"رقم الموظف " "ar":"رقم الموظف "
}, },
"check-user-text1": {
"en": "Please Enter your Employee ID, A ",
"ar": "يرجى ادخال رقم الموظف "
},
"check-user-text2": { "check-user-text2": {
"en": "login Code ", "en": "login Code ",
"ar": "رمز تسجيل الدخول" "ar": "رمز تسجيل الدخول"
@ -221,6 +225,11 @@
"en": " The connection timeout expired due to an error in the network or servers may be busy!", "en": " The connection timeout expired due to an error in the network or servers may be busy!",
"ar": " انتهت مهلة الاتصال بسبب خطأ في الشبكة أو الخوادم قد تكون مشغولة!" "ar": " انتهت مهلة الاتصال بسبب خطأ في الشبكة أو الخوادم قد تكون مشغولة!"
}, },
"error-itg": {
"en": "Dear, this service is not available now, please try again later",
"ar": " هذه الخدمة غير متاحة الآن ، يرجى المحاولة مرة أخرى في وقت لاحق"
},
"details": { "details": {
"en": "Details", "en": "Details",
"ar": "التفاصيل" "ar": "التفاصيل"
@ -1946,6 +1955,10 @@
} }
}, },
"worklistMain": { "worklistMain": {
"no-employee-available": {
"en": "No employees available to return for correction",
"ar": "لا يوجد موظفون متاحون للعودة للتصحيح"
},
"more": { "more": {
"en": "More", "en": "More",
"ar": "المزيد" "ar": "المزيد"

@ -494,6 +494,17 @@ left: 66px;
.less { .less {
max-height: 54px; max-height: 54px;
} }
.tipsPadding{
padding: 10px 10px;
border-radius: 10px;
margin: 10px;
border: 2px solid #e4e5e7;
color: var(--darkblue);
background: white;
font-weight: bold;
text-align: justify;
}
.noDataDiv{ .noDataDiv{
background: #ffffff; background: #ffffff;

Loading…
Cancel
Save