fixing bugs

MOE_DEV_NEW_TEMPORARY_DESIGN
enadhilal 4 years ago
parent ff0492718e
commit 4aa50bbfda

@ -76,7 +76,7 @@
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item (click)="openBusinessCard()"> <ion-item *ngIf='userInfo?.show_business' (click)="openBusinessCard()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/ID_ico_menu.png" item-left> <img style= "height: 25px !important;" src="../assets/imgs/ID_ico_menu.png" item-left>
</ion-thumbnail> </ion-thumbnail>
@ -175,7 +175,7 @@
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item (click)="openBusinessCard()"> <ion-item *ngIf='userInfo?.show_business' (click)="openBusinessCard()">
<ion-thumbnail slot="start" class="menu-thumb"> <ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 25px !important;" src="../assets/imgs/ID_ico_menu.png" item-left> <img style= "height: 25px !important;" src="../assets/imgs/ID_ico_menu.png" item-left>
</ion-thumbnail> </ion-thumbnail>

@ -36,6 +36,7 @@ export class AppComponent implements OnInit {
deviceToken: string; deviceToken: string;
TeamFlag: string = 'false'; TeamFlag: string = 'false';
isIOS = false; isIOS = false;
userInfo;
public requestGetLoginInfo: { public requestGetLoginInfo: {
DeviceType: string; DeviceType: string;
DeviceToken: string; // this.deviceToken DeviceToken: string; // this.deviceToken
@ -286,11 +287,12 @@ export class AppComponent implements OnInit {
return await modal.present(); return await modal.present();
} }
async openBusinessCard() { async openBusinessCard() {
this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: BusinessCardComponent, component: BusinessCardComponent,
cssClass: 'digital-id-modal-css', cssClass: 'digital-id-modal-css',
componentProps: { componentProps: {
'userInfo': this.digitalIDUser//JSON.parse(this.digitalIDUser) 'userInfo': this.userInfo
} }
}); });
return await modal.present(); return await modal.present();

@ -20,10 +20,11 @@ import { NFC, Ndef} from "@ionic-native/nfc/ngx"
import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx"; import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
import { DigitalIdComponent } from './authentication/digital-id/digital-id.component'; import { DigitalIdComponent } from './authentication/digital-id/digital-id.component';
import { BusinessCardComponent } from './authentication/business-card/business-card.component'; import { BusinessCardComponent } from './authentication/business-card/business-card.component';
import { AppUpdateComponent } from './authentication/app-update/app-update.component';
@NgModule({ @NgModule({
declarations: [AppComponent, DigitalIdComponent, BusinessCardComponent], declarations: [AppComponent, DigitalIdComponent, BusinessCardComponent, AppUpdateComponent],
entryComponents: [DigitalIdComponent, BusinessCardComponent], entryComponents: [DigitalIdComponent, BusinessCardComponent, AppUpdateComponent],
imports: [ imports: [
BrowserModule, BrowserModule,
BrowserAnimationsModule, BrowserAnimationsModule,

@ -0,0 +1,26 @@
<ion-content style="--background: white;">
<div>
<img src="assets/icon/update_rocket_image.png" style="width: 100%;" />
</div>
<div style="text-align: center;">
<img src="assets/imgs/CSLogo.png" />
</div>
<h1 style="text-align: center"> {{ 'general,app-update' | translate }}</h1>
<h2 style="text-align: center;font-size: 22px;font-weight: bold;">{{'home, app-update' | translate}}</h2>
<p style="text-align: center;padding: 10px;font-size: 14px;">{{msg}}</p>
<!-- <p *ngIf="direction == 'rtl'" style="text-align: center;padding: 10px;font-size: 14px;">{{messageAR}}</p> -->
<ion-footer style="z-index: 100;">
<ion-grid>
<ion-row class="ion-justify-content-center">
<ion-col [size]="11" [sizeLg]="8" [sizeXl]="6" no-padding>
<ion-button style="font-size: 16px !important; width:100%; --background: #259CB8" expand="block"
(click)='dismiss()'>
{{ 'general,update-now' | translate }}
</ion-button>
</ion-col>
</ion-row>
</ion-grid>
</ion-footer>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AppUpdateComponent } from './app-update.component';
describe('AppUpdateComponent', () => {
let component: AppUpdateComponent;
let fixture: ComponentFixture<AppUpdateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AppUpdateComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AppUpdateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,24 @@
import { Component, Input, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
@Component({
selector: 'app-app-update',
templateUrl: './app-update.component.html',
styleUrls: ['./app-update.component.scss'],
})
export class AppUpdateComponent implements OnInit {
@Input() msg: string;
constructor(public modalController: ModalController) { }
ngOnInit() {}
dismiss() {
// using the injected ModalController this page
// can "dismiss" itself and optionally pass back data
this.modalController.dismiss({
'dismissed': true
});
}
}

@ -1,74 +1,113 @@
<ion-content *ngIf="userInfo.CompanyMainCompany == 'CS'" dir="ltr"> <ion-content dir="ltr" *ngIf="userInfo.company_type == 'CS'">
<img *ngIf="userInfo.PAYROLL_CODE === 'CS' " style="width: 100%; max-width: 100%; height: 30%;" src="../../../assets/imgs/IDTOP.png"> <ion-grid style="transform: rotate(90deg); padding: 20px;">
<img *ngIf="userInfo.PAYROLL_CODE !== 'CS' " style="width: 100%; max-width: 100%;" src="../../../assets/imgs/IDTOP_HMG.png.png">
<ion-grid>
<ion-row> <ion-row>
<ion-col size="6" *ngIf="userInfo.EMPLOYEE_IMAGE != null"> <ion-col size='6'>
<img class="digital-id-image-size" <img style="width: 120px;" [src]='userInfo.company_logo' alt="https://hmgwebservices.com/images/Moheem/CS.jpg"/>
[src]="'data:image/png;base64,'+userInfo.EMPLOYEE_IMAGE">
</ion-col> </ion-col>
<ion-col size="6" *ngIf="userInfo.EMPLOYEE_IMAGE == null"> <ion-col size='6'>
<img style="width: 70%;height: 180%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px;" <img style="width: 130px;margin-top: 0px;position: relative;left: 410px;" [src]="userInfo.qr"/>
src="../../../assets/imgs/profilePic.png">
</ion-col> </ion-col>
<ion-col size="6"> </ion-row>
<p><b style="font-size: 25px !important; font-family: sans-serif;">{{userInfo.ASSIGNMENT_NUMBER}}</b></p> <ion-row>
<ion-col size='6'>
<ion-label>
<h1 class='font-text-style' style="font-size: 25px !important; width: 400px;">{{userInfo.name_en}}</h1>
</ion-label>
</ion-col>
<ion-col size='6'>
<ion-label>
<h1 class='font-text-style'
style="font-size: 25px !important; position: relative; left: 314px; text-align: end; padding: 10px; width: 225px;">{{userInfo.name_ar}}</h1>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<p><b style="font-size: 20px !important;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</b></p> <ion-label>
<p style="font-size: 15px !important;">{{userJobName}}</p> <h5 class='font-text-style'>{{userInfo.job_en}}</h5>
</ion-label>
</ion-col>
<ion-col>
<ion-label>
<h5 class='font-text-style' style="position: relative; left: 398px; text-align: end;">{{userInfo.ar}}</h5>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<img style="width: 50%; max-width: 100%; margin-left: 25%;" [src]="userInfo.EmployeeQR"> <ion-label>
<h5 class='font-text-style'>{{userInfo.mobile}}</h5>
</ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-label>
<h5 class='font-text-style'>{{userInfo.email}}</h5>
</ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-label>
<h5 class='font-text-style'>{{userInfo.company_url}}</h5>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</ion-content> </ion-content>
<ion-content *ngIf="userInfo.CompanyMainCompany != 'CS'" dir="ltr"> <!-- <ion-footer>
<ion-grid> <div class="centerDiv" style="margin-top: 20px !important;">
<ion-button class="button-login" (click)="dismiss()"><b>{{ts.trPK('general','close')}}</b></ion-button>
</div>
</ion-footer> -->
<ion-content dir="ltr" *ngIf="userInfo.company_type != 'CS'">
<ion-grid style="transform: rotate(90deg); padding: 25px;">
<ion-row> <ion-row>
<ion-col size="3"></ion-col> <ion-col style="padding-left: 315px;">
<ion-col size="9" *ngIf="userInfo.EMPLOYEE_IMAGE != null" padding> <img style="width: 380px; position: fixed; left: 340; height: 81px;" [src]='userInfo.company_logo' alt="../assets/imgs/HMG_LOGO.png"/>
<img *ngIf="userInfo.EMPLOYEE_IMAGE != null" [src]="'data:image/png;base64,'+userInfo.EMPLOYEE_IMAGE" style="width: 60%; height: 100%; border: 3px solid black;">
<img *ngIf="userInfo.EMPLOYEE_IMAGE == null" src="../../../assets/imgs/profilePic.png" style="width: 60%; height: 100%; border: 3px solid black;">
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row style="padding: 0%;"> <ion-row>
<ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;"> <ion-col>
<p style="font-size: 20px; padding: 0%;">{{userInfo.EMPLOYEE_NUMBER}}</p> <img style="width: 130px;margin-top: 0px;position: relative;left: 560px; top: 160px;" [src]="userInfo.qr"/>
</ion-col>
<ion-col>
<ion-label>
<h1 class='font-text-style' style="font-size: 25px !important; width: 400px;">{{userInfo.name_en}}</h1>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;"> <ion-col>
<p style="font-size: 20px; padding: 0%;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</p> <ion-label>
<h5 class='font-text-style'>{{userInfo.job_en}}</h5>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row style="padding: 0%;"> <ion-row>
<ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;"> <ion-col>
<p style="font-size: 15px; padding: 0%;">{{userJobName}}</p> <ion-label>
<h5 class='font-text-style'>{{userInfo.mobile}}</h5>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<img *ngIf="userInfo.CompanyImageURL" style="width: 90%; max-width: 100%; margin-left: 6%;" [src]="userInfo.CompanyBadge"> <ion-label>
<img *ngIf="!userInfo.CompanyImageURL" style="width: 50%; max-width: 100%; margin-left: 16%;" src="../../../assets/imgs/HMG_LOGO.png"> <h5 class='font-text-style'>{{userInfo.email}}</h5>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<img style="width: 50%; max-width: 100%; margin-left: 25%;" [src]="userInfo.EmployeeQR"> <ion-label>
<h5 class='font-text-style'>{{userInfo.company_url}}</h5>
</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</ion-content> </ion-content>
<ion-footer>
<div class="centerDiv" style="margin-top: 20px !important;">
<ion-button class="button-login" (click)="dismiss()"><b>{{ts.trPK('general','close')}}</b></ion-button>
</div>
</ion-footer>

@ -27,5 +27,11 @@
width: 70%;height: 180%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px; width: 70%;height: 180%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px;
} }
.font-text-style{
font-family: 'WorkSans-Bold';
color: black;
font-size: 15px;
font-weight: bold;
}

@ -1,5 +1,6 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({ @Component({
@ -11,24 +12,13 @@ export class BusinessCardComponent implements OnInit {
@Input() userInfo: any; @Input() userInfo: any;
public userJobName: any; public userJobName: any;
constructor( constructor(
public modalCtrl: ModalController, public modalCtrl: ModalController,
public ts: TranslatorService, public ts: TranslatorService,
public common: CommonService
) { } ) { }
ngOnInit() { ngOnInit() {}
if(JSON.parse(localStorage.getItem('digitalIDUser'))){
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];
}
}
}
dismiss() { dismiss() {

@ -20,6 +20,7 @@ import { KeyboardService } from 'src/app/hmg-common/services/keyboard/keyboard.s
import { KeyboardStatusModel } from 'src/app/hmg-common/services/keyboard/keyboard-status.model'; import { KeyboardStatusModel } from 'src/app/hmg-common/services/keyboard/keyboard-status.model';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { DigitalIdComponent } from '../digital-id/digital-id.component'; import { DigitalIdComponent } from '../digital-id/digital-id.component';
import { AppUpdateComponent } from '../app-update/app-update.component';
@Component({ @Component({
selector: 'login', selector: 'login',
@ -196,9 +197,10 @@ export class LoginComponent implements OnInit, OnDestroy {
this.authService.checkApplicationVersion(() => { }).subscribe((result: CheckAppVersionResponse) => { this.authService.checkApplicationVersion(() => { }).subscribe((result: CheckAppVersionResponse) => {
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
if (result.MessageStatus == 2 && result.ErrorType == 4) { if (result.MessageStatus == 2 && result.ErrorType == 4) {
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { this.appUpdate(result.ErrorEndUserMessage, result);
this.handleAppUpdate(result); // this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
}); // this.handleAppUpdate(result);
// });
// tslint:disable-next-line: triple-equals // tslint:disable-next-line: triple-equals
} else if (result.MessageStatus == 1) { } else if (result.MessageStatus == 1) {
this.checkUserAuthentication(); this.checkUserAuthentication();
@ -401,4 +403,16 @@ export class LoginComponent implements OnInit, OnDestroy {
this.inputType = 'text'; this.inputType = 'text';
} }
async appUpdate(msg, result) {
const modal = await this.modalController.create({
component: AppUpdateComponent,
cssClass: 'my-custom-class',
componentProps: {'msg':msg}
});
modal.onDidDismiss().then((data) => {
this.handleAppUpdate(result);
});
return await modal.present();
}
} }

@ -52,6 +52,7 @@ export class SmsPageComponent implements OnInit {
public isNFCAvailable = false; public isNFCAvailable = false;
public showErrorMessage = false; public showErrorMessage = false;
public messageValue: string; public messageValue: string;
public businessInfo: object;
constructor( constructor(
public navCtrl: NavController, public navCtrl: NavController,
@ -195,9 +196,29 @@ export class SmsPageComponent implements OnInit {
request.IsDeviceNFC = this.isNFCAvailable; request.IsDeviceNFC = this.isNFCAvailable;
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => { this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
//save business card info
this.businessInfo = {
show_business: result.BusinessCardPrivilege,
name_en: result.MemberInformationList[0].EMPLOYEE_NAME_En,
job_en: result.MemberInformationList[0].JOB_NAME_En,
name_ar: result.MemberInformationList[0].EMPLOYEE_NAME_Ar,
job_ar: result.MemberInformationList[0].JOB_NAME_Ar,
mobile: result.MemberInformationList[0].MobileNumberWithZipCode,
qr: result.MemberInformationList[0].BusinessCardQR,
company_logo: result.BC_Logo ? result.BC_Logo: result.CompanyImageURL,
company_url: result.BC_Domain,
company_type: result.CompanyMainCompany,
email: result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS
}
// Wifi Credientials // Wifi Credientials
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID; CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password; CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
// console.log('enad test');
// console.log(this.businessInfo.toString());
// localStorage.setItem('bussines-card-info', this.businessInfo.toString());
this.common.sharedService.setSharedData(this.businessInfo,'bussiness-card-info');
AuthenticationService.servicePrivilage = result.Privilege_List; AuthenticationService.servicePrivilage = result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => { this.authService.setAuthenticatedUser(result).subscribe(() => {

@ -142,7 +142,7 @@ export class AuthenticationService {
} else { } else {
mobileType = 'android'; mobileType = 'android';
} }
request.VersionID = 3.0; request.VersionID = 3;
request.Channel = 31; request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType; request.MobileType = mobileType;

@ -2,86 +2,92 @@ import { PatientUserModel } from './PatientUserModel';
import { TestBed } from '@angular/core/testing'; import { TestBed } from '@angular/core/testing';
export class AuthenticatedUser extends PatientUserModel { export class AuthenticatedUser extends PatientUserModel {
public static SHARED_DATA = 'user-info'; public static SHARED_DATA = 'user-info';
TokenID:string; TokenID: string;
ACTUAL_TERMINATION_DATE: string; ACTUAL_TERMINATION_DATE: string;
ASSIGNMENT_END_DATE: string; ASSIGNMENT_END_DATE: string;
ASSIGNMENT_ID: number; ASSIGNMENT_ID: number;
ASSIGNMENT_NUMBER: string; ASSIGNMENT_NUMBER: string;
ASSIGNMENT_START_DATE: string; ASSIGNMENT_START_DATE: string;
ASSIGNMENT_STATUS_TYPE_ID: number; ASSIGNMENT_STATUS_TYPE_ID: number;
ASSIGNMENT_TYPE: string; ASSIGNMENT_TYPE: string;
BUSINESS_GROUP_ID: number; BUSINESS_GROUP_ID: number;
BUSINESS_GROUP_NAME: string; BUSINESS_GROUP_NAME: string;
CURRENT_EMPLOYEE_FLAG: string; CURRENT_EMPLOYEE_FLAG: string;
EMPLOYEE_DISPLAY_NAME: string; EMPLOYEE_DISPLAY_NAME: string;
EMPLOYEE_EMAIL_ADDRESS:string; EMPLOYEE_EMAIL_ADDRESS: string;
EMPLOYEE_IMAGE:string; EMPLOYEE_IMAGE: string;
EMPLOYEE_MOBILE_NUMBER: string; EMPLOYEE_MOBILE_NUMBER: string;
EMPLOYEE_NAME:string; EMPLOYEE_NAME: string;
EMPLOYEE_NUMBER: string; EMPLOYEE_NUMBER: string;
EMPLOYEE_WORK_NUMBER:string; EMPLOYEE_WORK_NUMBER: string;
EMPLOYMENT_CATEGORY: string; EMPLOYMENT_CATEGORY: string;
EMPLOYMENT_CATEGORY_MEANING: string; EMPLOYMENT_CATEGORY_MEANING: string;
FREQUENCY: string; FREQUENCY: string;
FREQUENCY_MEANING: string; FREQUENCY_MEANING: string;
FROM_ROW_NUM: number; FROM_ROW_NUM: number;
GRADE_ID: number; GRADE_ID: number;
GRADE_NAME: string; GRADE_NAME: string;
HIRE_DATE: string; HIRE_DATE: string;
JOB_ID: number; JOB_ID: number;
JOB_NAME: string; JOB_NAME: string;
LEDGER_ID: number; LEDGER_ID: number;
LOCATION_ID: number; LOCATION_ID: number;
LOCATION_NAME: string; LOCATION_NAME: string;
MANUAL_TIMECARD_FLAG: string; MANUAL_TIMECARD_FLAG: string;
MANUAL_TIMECARD_MEANING: string; MANUAL_TIMECARD_MEANING: string;
NATIONALITY_CODE: string; NATIONALITY_CODE: string;
NATIONALITY_MEANING: string; NATIONALITY_MEANING: string;
NATIONAL_IDENTIFIER:string; NATIONAL_IDENTIFIER: string;
NORMAL_HOURS: string; NORMAL_HOURS: string;
NO_OF_ROWS: number; NO_OF_ROWS: number;
ORGANIZATION_ID: number; ORGANIZATION_ID: number;
ORGANIZATION_NAME: string; ORGANIZATION_NAME: string;
PAYROLL_CODE: string; PAYROLL_CODE: string;
PAYROLL_ID: number; PAYROLL_ID: number;
PAYROLL_NAME: string; PAYROLL_NAME: string;
PERSON_ID: number; PERSON_ID: number;
PERSON_TYPE:string; PERSON_TYPE: string;
PERSON_TYPE_ID: number; PERSON_TYPE_ID: number;
PER_INFORMATION_CATEGORY: string; PER_INFORMATION_CATEGORY: string;
POSITION_ID: number; POSITION_ID: number;
POSITION_NAME: string; POSITION_NAME: string;
PRIMARY_FLAG: string; PRIMARY_FLAG: string;
ROW_NUM:number; ROW_NUM: number;
SUPERVISOR_ASSIGNMENT_ID: string; SUPERVISOR_ASSIGNMENT_ID: string;
SUPERVISOR_DISPLAY_NAME: string; SUPERVISOR_DISPLAY_NAME: string;
SUPERVISOR_EMAIL_ADDRESS: string; SUPERVISOR_EMAIL_ADDRESS: string;
SUPERVISOR_ID: number; SUPERVISOR_ID: number;
SUPERVISOR_MOBILE_NUMBER: string; SUPERVISOR_MOBILE_NUMBER: string;
SUPERVISOR_NAME: string; SUPERVISOR_NAME: string;
SUPERVISOR_NUMBER: string; SUPERVISOR_NUMBER: string;
SUPERVISOR_WORK_NUMBER: string; SUPERVISOR_WORK_NUMBER: string;
SWIPES_EXEMPTED_FLAG: string; SWIPES_EXEMPTED_FLAG: string;
SWIPES_EXEMPTED_MEANING: string; SWIPES_EXEMPTED_MEANING: string;
SYSTEM_PERSON_TYPE: string; SYSTEM_PERSON_TYPE: string;
TK_EMAIL_ADDRESS: string; TK_EMAIL_ADDRESS: string;
TK_EMPLOYEE_DISPLAY_NAME: string; TK_EMPLOYEE_DISPLAY_NAME: string;
TK_EMPLOYEE_NAME: string; TK_EMPLOYEE_NAME: string;
TK_EMPLOYEE_NUMBER: string; TK_EMPLOYEE_NUMBER: string;
TK_PERSON_ID: number; TK_PERSON_ID: number;
TO_ROW_NUM: number; TO_ROW_NUM: number;
UNIT_NUMBER: string; UNIT_NUMBER: string;
USER_STATUS: string; USER_STATUS: string;
P_SESSION_ID:number; P_SESSION_ID: number;
MobileNumber:string; MobileNumber: string;
LogInTokenID:string; LogInTokenID: string;
CompanyImageDescription: string; CompanyImageDescription: string;
CompanyImageURL: string; CompanyImageURL: string;
CompanyMainCompany: string; CompanyMainCompany: string;
CompanyBadge: string; CompanyBadge: string;
SERVICE_DAYS:Number; SERVICE_DAYS: Number;
SERVICE_MONTHS:Number; SERVICE_MONTHS: Number;
SERVICE_YEARS:Number; SERVICE_YEARS: Number;
public BusinessCardQR: string;
public MobileNumberWithZipCode: SVGStringList;
public JOB_NAME_Ar: string;
public JOB_NAME_En: string;
public EMPLOYEE_NAME_Ar: string;
public EMPLOYEE_NAME_En: string;
} }

@ -22,4 +22,8 @@ export class SMSCheckResponse extends Response {
public Mohemm_Wifi_SSID:string; public Mohemm_Wifi_SSID:string;
public Mohemm_Wifi_Password:string; public Mohemm_Wifi_Password:string;
public ForgetPasswordTokenID: string; public ForgetPasswordTokenID: string;
public BC_Domain: string;
public BC_Logo: string;
public BusinessCardPrivilege: boolean;
} }

@ -202,6 +202,7 @@ export class CommonService {
public toastPK(page: string, key: string) { public toastPK(page: string, key: string) {
this.toast(this.ts.trPK(page, key)); this.toast(this.ts.trPK(page, key));
} }
async toast(message: string) { async toast(message: string) {
const toast = await this.toastController.create({ const toast = await this.toastController.create({
message: message, message: message,
@ -217,6 +218,10 @@ export class CommonService {
this.redToast(this.ts.trPK(page, key)); this.redToast(this.ts.trPK(page, key));
} }
public greenToastPK(page: string, key: string) {
this.greenToast(this.ts.trPK(page, key));
}
async redToast(message: string) { async redToast(message: string) {
const toast = await this.toastController.create({ const toast = await this.toastController.create({
message: message, message: message,
@ -228,6 +233,17 @@ export class CommonService {
}); });
toast.present(); toast.present();
} }
async greenToast(message: string) {
const toast = await this.toastController.create({
message: message,
showCloseButton: true,
position: 'middle',
duration: 2000,
color: 'success',
closeButtonText: this.ts.trPK('general', 'close')
});
toast.present();
}
private loaderIsActive = false; private loaderIsActive = false;
async startLoadingOld() { async startLoadingOld() {

@ -227,11 +227,11 @@ export class ConnectorService {
if (!this.cs.validResponse(result)) { if (!this.cs.validResponse(result)) {
if (result.IsAuthenticated === false) { if (result.IsAuthenticated === false) {
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.openLogin(); // this.cs.openLogin();
this.getLastLoginInfo(); this.getLastLoginInfo();
}); // });
return false; return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) { } else if (result.ErrorType === 2 || result.ErrorType === 4) {
// console.log("error expired"); // console.log("error expired");

@ -7,6 +7,6 @@
</div> </div>
<div class="titleBox" [ngStyle]="link === '0' ? {'margin-left': '5px'} : {}"> <div class="titleBox" [ngStyle]="link === '0' ? {'margin-left': '5px'} : {}">
<span>{{statsValue}}</span> <span>{{statsValue}}</span>
<p class="pClass" [ngStyle]="link === '0' ? {'width': '105%', 'margin-top': '12px'} : {}">{{title}}</p> <p class="pClass" [ngStyle]="link === '0' ? {'width': '105%', 'margin-top': '12px'} : {}">{{returnTitle(title)}}</p>
</div> </div>
</div> </div>

@ -27,5 +27,9 @@ export class StatsButtonComponent implements OnInit {
ngOnInit() {} ngOnInit() {}
public onClicked() {} public onClicked() {}
returnTitle(titleText: string){
const titleArr1 = titleText.replace(/\u00a0/g, " ");
return titleArr1
}
} }

@ -59,7 +59,7 @@
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-button *ngIf="userInfo" class="button-digital-id" (click)="openBusinessCard()"> <ion-button *ngIf="userBusiness?.show_business" class="button-digital-id" (click)="openBusinessCard()">
<p style="color: black;">{{ts.trPK('general','digital-id')}}</p> <p style="color: black;">{{ts.trPK('general','digital-id')}}</p>
<img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png"> <img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png">
</ion-button> </ion-button>

@ -77,7 +77,7 @@
--border-radius: 33px !important; --border-radius: 33px !important;
border-radius: 33px !important; border-radius: 33px !important;
--min-height: 1.6cm !important; --min-height: 1.6cm !important;
width: 325px; width: 100%;
border: 1px solid black; border: 1px solid black;
} }

@ -75,6 +75,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
lastLoginDate: string; lastLoginDate: string;
user_name: string; user_name: string;
userInfo: any; userInfo: any;
userBusiness: any;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -102,6 +103,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.logintype= localStorage.getItem("login-type"); this.logintype= localStorage.getItem("login-type");
this.lastLoginDate= localStorage.getItem("login-at"); this.lastLoginDate= localStorage.getItem("login-at");
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);
@ -254,7 +256,10 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
async openBusinessCard() { async openBusinessCard() {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: BusinessCardComponent, component: BusinessCardComponent,
cssClass: 'digital-id-modal-css' cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo': this.userBusiness
}
}); });
return await modal.present(); return await modal.present();
} }

@ -266,18 +266,19 @@ export class HrRequestFormComponent implements OnInit {
request.append('MobileNo', authUser.MobileNumber); request.append('MobileNo', authUser.MobileNumber);
this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { this.MowadhafiService.getCreateTicket(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
this.cs.stopLoading(); if(this.cs.validResponse(result)){
this.handlegetCreateTicketResult(result); this.cs.stopLoading();
this.checkERM('After Service Submission'); this.checkERM('After Service Submission');
//hear you have to redirect page this.cs.greenToastPK("general", "success");
this.cs.openMyRequestPage();
this.cs.openMyRequestPage(); }else{
}) this.cs.stopLoading();
} this.cs.redToastPK("general", "try-again");
handlegetCreateTicketResult(result) { }
})
} }

@ -54,7 +54,8 @@ export class HRRequestComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.getUserInformation(); // this.getUserInformation();
this.getUserDATA();
this.checkERM('Before Service Initiation'); this.checkERM('Before Service Initiation');
@ -66,31 +67,31 @@ export class HRRequestComponent implements OnInit {
} }
getUserInformation() { getUserInformation() {
const request = { // const request = {
// P_SELECTED_EMPLOYEE_NUMBER:"121816", // // P_SELECTED_EMPLOYEE_NUMBER:"121816",
P_SELECTED_RESP_ID: -999, // P_SELECTED_RESP_ID: -999,
P_PAGE_NUM: 1, // P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1 // P_PAGE_LIMIT: 1
}; // };
this.MowadhafiService.getUserInfo(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { // this.MowadhafiService.getUserInfo(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handleUserInfoResult(result); // this.handleUserInfoResult(result);
}) // })
} }
handleUserInfoResult(result) { getUserDATA() {
this.EmpName = result.MemberInformationList[0].EMPLOYEE_NAME; const userData = this.cs.sharedService.getSharedData('user-info', false);
console.log("____________" + this.EmpName); this.EmpName = userData.EMPLOYEE_NAME;
this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER; this.EmpNum = userData.EMPLOYEE_NUMBER;
this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME; this.EmpGroup = userData.BUSINESS_GROUP_NAME;
this.EmpMobile = result.MemberInformationList[0].EMPLOYEE_MOBILE_NUMBER; this.EmpMobile = userData.EMPLOYEE_MOBILE_NUMBER;
// this.EmpJob = result.MemberInformationList[0].JOB_NAME; // this.EmpJob = userData.JOB_NAME;
this.EmpOrgName = result.MemberInformationList[0].ORGANIZATION_NAME; this.EmpOrgName = userData.ORGANIZATION_NAME;
this.EmpPayrol = result.MemberInformationList[0].PAYROLL_NAME; this.EmpPayrol = userData.PAYROLL_NAME;
// this.EmpPosition = result.MemberInformationList[0].POSITION_NAME; // this.EmpPosition = userData.POSITION_NAME;
let jobTitle = result.MemberInformationList[0].POSITION_NAME let jobTitle = userData.POSITION_NAME
jobTitle = jobTitle.split('.'); jobTitle = jobTitle.split('.');
if (jobTitle && jobTitle.length > 1) { if (jobTitle && jobTitle.length > 1) {
this.EmpPosition = jobTitle[0] + " " + jobTitle[1]; this.EmpPosition = jobTitle[0] + " " + jobTitle[1];
@ -98,11 +99,11 @@ export class HRRequestComponent implements OnInit {
this.EmpPosition = ''; this.EmpPosition = '';
} }
this.EmpEmail = result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS; this.EmpEmail = userData.EMPLOYEE_EMAIL_ADDRESS;
this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING; this.EmpCatMeaning = userData.EMPLOYMENT_CATEGORY_MEANING;
this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME; this.EmpGRADENAME = userData.GRADE_NAME;
this.EmpLocation = result.MemberInformationList[0].LOCATION_NAME; this.EmpLocation = userData.LOCATION_NAME;
this.EmpImg = result.MemberInformationList[0].EMPLOYEE_IMAGE this.EmpImg = userData.EMPLOYEE_IMAGE
// console.log("total no "+this.EmpTotal) // console.log("total no "+this.EmpTotal)
} }

@ -114,8 +114,8 @@ export class MowadhafiService {
// return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel); // return this.con.post(MowadhafiService.getCreateTicket, request, onError, errorLabel);
return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, { return this.http.post(ConnectorService.host + MowadhafiService.getCreateTicket, absence, {
reportProgress: true, // reportProgress: true,
observe: 'events' // observe: 'events'
} }
) )
} }

@ -1,12 +1,12 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { Platform, Events, MenuController } from '@ionic/angular'; import { Events } from '@ionic/angular';
import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
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 { MowadhafiService } from '../mowadhafi.service'; import { MowadhafiService } from '../mowadhafi.service';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
@Component({ @Component({
selector: 'app-my-request', selector: 'app-my-request',
@ -14,7 +14,7 @@ import { Location } from '@angular/common';
styleUrls: ['./my-request.component.scss'], styleUrls: ['./my-request.component.scss'],
}) })
export class MyRequestComponent implements OnInit { export class MyRequestComponent implements OnInit {
public direction: String; public direction: string;
public ticketsInfo : any = []; public ticketsInfo : any = [];
public ticketCount = 10; public ticketCount = 10;
public ticketPage = 1; public ticketPage = 1;
@ -32,17 +32,24 @@ export class MyRequestComponent implements OnInit {
public events: Events, public events: Events,
public MowadhafiService: MowadhafiService, public MowadhafiService: MowadhafiService,
private location: Location, private location: Location,
private menu: MenuController, public route: ActivatedRoute
) { ) {
this.direction = TranslatorService.getCurrentLanguageName(); this.direction = TranslatorService.getCurrentLanguageName();
this.route.params.subscribe(val => {
setTimeout(() => {
this.ionAlwaysEnter();
}, 100);
});
} }
ngOnInit() { ionAlwaysEnter(){
this.cs.startLoading(); this.cs.startLoading();
this.getTicketsByEmployee(); this.getTicketsByEmployee();
} }
ngOnInit() {}
goback() { goback() {
this.location.back(); this.location.back();
@ -62,11 +69,9 @@ export class MyRequestComponent implements OnInit {
getTicketsByEmployee() { getTicketsByEmployee() {
const request = { const request = {
// TokenID:"xxx",
EmployeeNumber: "", EmployeeNumber: "",
ItgPageSize: this.ticketCount, ItgPageSize: this.ticketCount,
ItgPageNo: this.ticketPage ItgPageNo: this.ticketPage
}; };
this.MowadhafiService.getTicketsByEmployee(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => { this.MowadhafiService.getTicketsByEmployee(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetTicketsByEmployeeResult(result); this.handlegetTicketsByEmployeeResult(result);
@ -75,32 +80,11 @@ export class MyRequestComponent implements OnInit {
} }
handlegetTicketsByEmployeeResult(result){ handlegetTicketsByEmployeeResult(result){
this.ticketsInfo=result.Mohemm_ITG_TicketsByEmployeeList; this.ticketsInfo = result.Mohemm_ITG_TicketsByEmployeeList;
this.ticketTotal=this.ticketsInfo[0].totalItemsCount; if(this.ticketsInfo.length > 0){
console.log("length______________________-."); this.ticketTotal=this.ticketsInfo[0].totalItemsCount;
console.log(this.ticketsInfo.length); }
this.ticketCount += 10; this.ticketCount += 10;
// this.ticketPage += 1;
// if(this.ticketsInfo.length > this.ticketCount){
// this.ticketCount = this.ticketsInfo.length - this.ticketCount;
// }else{
// this.ticketCount = this.ticketCount * this.increseCount
// }
// this.increseCount++;
// this.ticketPage = this.increseCount;
// let x;
// if(this.cs.validResponse(result)){
// x = JSON.parse(result.Mohemm_ITG_ResponseItem);
// console.log(x);
// this.ticketsInfo=x.result.data;
// for (let i = 0; i < this.ticketsInfo.length; i++) {
// // console.log(i + ' : ' + this.ticketsInfo[i].ticketTypeName)
// }
// console.log("length______________________-.");
// console.log(this.ticketsInfo.length);
// }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@ -1024,6 +1024,22 @@
"type-of-change": { "type-of-change": {
"en": " Select the type of change you want to make.", "en": " Select the type of change you want to make.",
"ar": " حدد نوع التغيير الذي تريد القيام به." "ar": " حدد نوع التغيير الذي تريد القيام به."
},
"try-again":{
"en": "somthing went wrong please try again later",
"ar": "حدث خطا الرجاء المحاولة لاحقا"
},
"app-update": {
"en": "UPDATE THE APP",
"ar": "تحديث التطبيق"
},
"update-now": {
"en": "Update Now",
"ar": "تحديث الان"
},
"success-create":{
"en": "Request has been submitted successfully",
"ar": "تم تقديم الطلب بنجاح"
} }
}, },
"home": { "home": {

Loading…
Cancel
Save