Merge branch 'enad-Q1' of https://gitlab.com/haroon6138/mohemmionic5 into enad-Q1

enad-Q1
enadhilal 4 years ago
commit 622dccee66

@ -18,7 +18,7 @@
<ion-row>
<ion-col>
<p><b style="font-size: 20px !important;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</b></p>
<p style="font-size: 15px !important;">{{userInfo.JOB_NAME}}</p>
<p style="font-size: 15px !important;">{{userJobName}}</p>
</ion-col>
</ion-row>
<ion-row>
@ -50,7 +50,7 @@
</ion-row>
<ion-row style="padding: 0%;">
<ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;">
<p style="font-size: 15px; padding: 0%;">{{userInfo.JOB_NAME}}</p>
<p style="font-size: 15px; padding: 0%;">{{userJobName}}</p>
</ion-col>
</ion-row>
<ion-row>

@ -9,6 +9,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class DigitalIdComponent implements OnInit {
@Input() userInfo: any;
public userJobName: any;
constructor(
public modalCtrl: ModalController,
@ -20,6 +21,12 @@ export class DigitalIdComponent implements OnInit {
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
}
console.log(this.userInfo);
if (this.userInfo) {
let jobTitle = this.userInfo.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.userJobName = jobTitle[0] + " " + jobTitle[1];
}
}
}

@ -58,7 +58,7 @@
</ion-col>
</ion-row>
<!-- <div><p style="color: red; font-weight: bold; font-size: 10px; text-align: center;">{{'general,noOfTriesLogin' | translate}}</p></div> -->
<div *ngIf="showErrorMessage"><p style="color: red; font-weight: bold; font-size: 14px; text-align: center;">{{messageValue}}</p></div>
</div>

@ -50,6 +50,8 @@ export class SmsPageComponent implements OnInit {
loginType: any;
activeType: any;
public isNFCAvailable = false;
public showErrorMessage = false;
public messageValue: string;
constructor(
public navCtrl: NavController,
@ -183,6 +185,7 @@ export class SmsPageComponent implements OnInit {
}
public checkSMS() {
this.showErrorMessage = false;
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const request = new SMSCheckRequest();
request.LogInTokenID = data.LogInTokenID;
@ -190,9 +193,8 @@ export class SmsPageComponent implements OnInit {
request.P_USER_NAME = data.P_USER_NAME;
request.MobileNumber = data.MobileNumber;
request.IsDeviceNFC = this.isNFCAvailable;
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
// Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
@ -210,6 +212,16 @@ export class SmsPageComponent implements OnInit {
this.activeType =this.common.setActiveTypeLogin(0);
this.common.openHome();
});
} else {
let errorResult: any;
errorResult = result;
this.showErrorMessage = true;
this.messageValue = errorResult.ErrorEndUserMessage;
this.smc_code = [];
(document.activeElement as HTMLElement).blur();
setTimeout(() => {
this.showErrorMessage = false;
}, 5000);
}
});
}

@ -485,10 +485,10 @@ export class AuthenticationService {
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string, fromSMS = false )
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel);
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel, fromSMS);
}
public checkForgetSMS(request: SMSCheckRequest, onError: any, errorLabel: string)

@ -27,8 +27,8 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 120 * 1000;
// 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/';
constructor(public httpClient: HttpClient,
public cs: CommonService,
@ -39,7 +39,8 @@ export class ConnectorService {
service: string,
data: any,
onError: any,
errorLabel?: string
errorLabel?: string,
fromSMS = false
): Observable<any> {
this.cs.startLoading();
return this.httpClient
@ -52,7 +53,7 @@ export class ConnectorService {
timeout(ConnectorService.timeOut),
retry(ConnectorService.retryTimes),
tap(
res => this.handleResponse(res, onError, errorLabel),
res => this.handleResponse(res, onError, errorLabel, false, fromSMS),
error => this.handleError(error, onError, errorLabel)
)
);
@ -218,7 +219,8 @@ export class ConnectorService {
});
}
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false) {
public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false, fromSMS = false) {
console.log('fromSMSValue ' + fromSMS)
if (!isPostNoLoad) {
this.cs.stopLoading();
}
@ -236,11 +238,16 @@ export class ConnectorService {
this.cs.stopLoading();
} else {
this.cs.stopLoading();
this.cs.showErrorMessageDialog(
onError,
errorLabel,
result.ErrorEndUserMessage
);
if (!fromSMS) {
this.cs.showErrorMessageDialog(
onError,
errorLabel,
result.ErrorEndUserMessage
);
} else {
console.log('its an error from sms')
}
//add flag if user not auth
}

@ -22,7 +22,13 @@ public direction: string;
this.direction = TranslatorService.getCurrentLanguageName();
}
ngOnInit() {}
ngOnInit() {
console.log(this.title);
let jobTitle = this.title.split('.');
if (jobTitle && jobTitle.length > 1) {
this.title = jobTitle[0] + " " + jobTitle[1];
}
}
getDetails() {
this.onGetDetails.emit();

@ -19,13 +19,12 @@
<span class="Nametext">{{EmpName}}</span>
<p class="p1">{{EmpEmail}}</p>
<!-- <span>{{EmpJob}}</span> -->
</div>
<div >
<ion-row>
<ion-col style="border-right: 1px solid rgb(221 221 221);">
<p class="p">{{ts.trPK('userProfile','role')}}</p>
<span class="Boldtext">{{EmpJob}}</span>
<span class="Boldtext">{{EmpPosition}}</span>
</ion-col>
<ion-col>
@ -65,7 +64,7 @@
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','job')}}</h2>
<p>{{EmpJob}}</p>
<p>{{EmpPosition}}</p>
</ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12">

@ -85,10 +85,19 @@ export class HRRequestComponent implements OnInit {
this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER;
this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME;
this.EmpMobile = result.MemberInformationList[0].EMPLOYEE_MOBILE_NUMBER;
this.EmpJob = result.MemberInformationList[0].JOB_NAME;
// this.EmpJob = result.MemberInformationList[0].JOB_NAME;
this.EmpOrgName = result.MemberInformationList[0].ORGANIZATION_NAME;
this.EmpPayrol = result.MemberInformationList[0].PAYROLL_NAME;
this.EmpPosition = result.MemberInformationList[0].POSITION_NAME;
// this.EmpPosition = result.MemberInformationList[0].POSITION_NAME;
let jobTitle = result.MemberInformationList[0].POSITION_NAME
jobTitle = jobTitle.split('.');
if (jobTitle && jobTitle.length > 1) {
this.EmpPosition = jobTitle[0] + " " + jobTitle[1];
} else {
this.EmpPosition = '';
}
this.EmpEmail = result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS;
this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING;
this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME;

@ -32,13 +32,12 @@
<div style="margin-top: 25px;">
<h1 class="name">{{employee.EMPLOYEE_NAME}}</h1>
<span class="email">{{employee.EMPLOYEE_EMAIL_ADDRESS}}</span>
<!-- <span>{{employee.JOB_NAME}}</span> -->
</div>
<div >
<ion-row style="margin-top: 11px;">
<ion-col [size]="6">
<p class="subTitle">{{ts.trPK('userProfile','role')}}</p>
<span class="Boldtext">{{employee.JOB_NAME}}</span>
<span class="Boldtext">{{jobName}}</span>
</ion-col>
<ion-col [size]="6" style="border-left: 1px solid rgb(221 221 221);">
<p class="subTitle" style="line-height: 12px !important;">{{ts.trPK('userProfile','empNo')}}</p>
@ -505,7 +504,7 @@
</ion-col>
<ion-col [size]="12">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','job')}}</h2>
<p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{employee.JOB_NAME}}</p>
<p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{jobName}}</p>
</ion-col>
<ion-col [size]="12">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','payrol')}}</h2>
@ -517,7 +516,7 @@
</ion-col> -->
<ion-col [size]="12">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','position')}}</h2>
<p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{employee.POSITION_NAME}}</p>
<p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{jobName}}</p>
</ion-col>
<ion-col [size]="12" style="border-bottom: none;">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','grade')}}</h2>

@ -215,6 +215,8 @@ export class DetailsComponent implements OnInit {
spaceBetween: 1
};
public jobName: any;
constructor(
public timeCardService: TimeCardService,
public menuService: MenuService,
@ -235,15 +237,18 @@ export class DetailsComponent implements OnInit {
this.showAttendanceTracking();
// tslint:disable-next-line: max-line-length
this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex);
// this.getSuborinatesAttStatus();
// this.getFavorit();
}
showAttendanceTracking() {
this.common.startLoading();
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
console.log(this.employee);
let jobTitle = this.employee.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.jobName = jobTitle[0] + " " + jobTitle[1];
}
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
};

@ -38,7 +38,7 @@
<label for="">{{'userProfile, position' | translate}}</label>
</ion-col>
<ion-col col-7>
<label for="">{{submitterInfo.POSITION_NAME}}</label>
<label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col>
</ion-row>
<ion-row>
@ -54,7 +54,7 @@
<label for="">{{'userProfile, job' | translate}}</label>
</ion-col>
<ion-col col-7>
<label for="">{{submitterInfo.JOB_NAME}}</label>
<label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col>
</ion-row>
<ion-row>

@ -44,6 +44,19 @@ export class WorkListDetailsComponent implements OnInit {
this.handleNotificationBody();
}
public formatJobName(title: any) {
let jobName: any;
if (title) {
let jobTitle = title.split('.');
if (jobTitle && jobTitle.length > 1) {
jobName = jobTitle[0] + " " + jobTitle[1];
}
} else {
jobName = '';
}
return jobName;
}
getsubmitterInfo(notificationSubmitterInfoObj) {
this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj).
subscribe((result: WorklistsubmitterInfoResponse) => {

@ -223,7 +223,7 @@
<label class="colItemReq" for="">{{'worklistMain, job-name' |
translate}}</label>
<br />
<label for="">{{submitterInfo.POSITION_NAME}}</label>
<label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">
@ -239,7 +239,7 @@
<label class="colItemReq" for="">{{'worklistMain, job_cate' |
translate}}</label>
<br />
<label for="">{{submitterInfo.JOB_NAME}}</label>
<label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col>
</ion-row>
<ion-row class="rowBorder submitterInfo">

@ -868,6 +868,19 @@ export class WorklistMainComponent implements OnInit {
}
}
public formatJobName(title: any) {
let jobName: any;
if (title) {
let jobTitle = title.split('.');
if (jobTitle && jobTitle.length > 1) {
jobName = jobTitle[0] + " " + jobTitle[1];
}
} else {
jobName = '';
}
return jobName;
}
public checkLines(note) {
if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false;

@ -26,7 +26,7 @@
<ion-row style="margin-top: 11px;">
<ion-col [size]="6">
<p class="subTitle">{{ts.trPK('userProfile','role')}}</p>
<span class="boldText">{{personalInfo.JOB_NAME}}</span>
<span class="boldText">{{jobName}}</span>
</ion-col>
<ion-col [size]="6" style="border-left: 1px solid rgb(221 221 221);">
<p class="subTitle" style="line-height: 8px !important;">{{ts.trPK('userProfile','empNo')}}</p>

@ -50,6 +50,8 @@ export class HomeComponent implements OnInit {
public postalCode: any;
public country: any;
public employeeAdress: any = [];
public jobName: any;
constructor(
public ts: TranslatorService,
public cs: CommonService,
@ -143,6 +145,12 @@ export class HomeComponent implements OnInit {
if (user) {
console.log(user);
this.personalInfo = user;
let jobTitle = user.POSITION_NAME.split('.');
if (jobTitle && jobTitle.length > 1) {
this.jobName = jobTitle[0] + " " + jobTitle[1];
}
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {

Loading…
Cancel
Save