fixing bugs

MOE_DEV_NEW_TEMPORARY_DESIGN
enadhilal 4 years ago
parent ff0492718e
commit 4aa50bbfda

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

@ -36,6 +36,7 @@ export class AppComponent implements OnInit {
deviceToken: string;
TeamFlag: string = 'false';
isIOS = false;
userInfo;
public requestGetLoginInfo: {
DeviceType: string;
DeviceToken: string; // this.deviceToken
@ -286,11 +287,12 @@ export class AppComponent implements OnInit {
return await modal.present();
}
async openBusinessCard() {
this.userInfo = this.cs.sharedService.getSharedData('bussiness-card-info', false);
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo': this.digitalIDUser//JSON.parse(this.digitalIDUser)
'userInfo': this.userInfo
}
});
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 { DigitalIdComponent } from './authentication/digital-id/digital-id.component';
import { BusinessCardComponent } from './authentication/business-card/business-card.component';
import { AppUpdateComponent } from './authentication/app-update/app-update.component';
@NgModule({
declarations: [AppComponent, DigitalIdComponent, BusinessCardComponent],
entryComponents: [DigitalIdComponent, BusinessCardComponent],
declarations: [AppComponent, DigitalIdComponent, BusinessCardComponent, AppUpdateComponent],
entryComponents: [DigitalIdComponent, BusinessCardComponent, AppUpdateComponent],
imports: [
BrowserModule,
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">
<img *ngIf="userInfo.PAYROLL_CODE === 'CS' " style="width: 100%; max-width: 100%; height: 30%;" src="../../../assets/imgs/IDTOP.png">
<img *ngIf="userInfo.PAYROLL_CODE !== 'CS' " style="width: 100%; max-width: 100%;" src="../../../assets/imgs/IDTOP_HMG.png.png">
<ion-grid>
<ion-content dir="ltr" *ngIf="userInfo.company_type == 'CS'">
<ion-grid style="transform: rotate(90deg); padding: 20px;">
<ion-row>
<ion-col size="6" *ngIf="userInfo.EMPLOYEE_IMAGE != null">
<img class="digital-id-image-size"
[src]="'data:image/png;base64,'+userInfo.EMPLOYEE_IMAGE">
<ion-col size='6'>
<img style="width: 120px;" [src]='userInfo.company_logo' alt="https://hmgwebservices.com/images/Moheem/CS.jpg"/>
</ion-col>
<ion-col size="6" *ngIf="userInfo.EMPLOYEE_IMAGE == null">
<img style="width: 70%;height: 180%; ; bottom: 0%; position: absolute; border: 1px solid #e6e6e6; border-radius: 20px;"
src="../../../assets/imgs/profilePic.png">
<ion-col size='6'>
<img style="width: 130px;margin-top: 0px;position: relative;left: 410px;" [src]="userInfo.qr"/>
</ion-col>
<ion-col size="6">
<p><b style="font-size: 25px !important; font-family: sans-serif;">{{userInfo.ASSIGNMENT_NUMBER}}</b></p>
</ion-row>
<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-row>
<ion-row>
<ion-col>
<p><b style="font-size: 20px !important;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</b></p>
<p style="font-size: 15px !important;">{{userJobName}}</p>
<ion-label>
<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-row>
<ion-row>
<ion-col>
<img style="width: 50%; max-width: 100%; margin-left: 25%;" [src]="userInfo.EmployeeQR">
<ion-col>
<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-row>
</ion-grid>
</ion-content>
</ion-content>
<ion-content *ngIf="userInfo.CompanyMainCompany != 'CS'" dir="ltr">
<ion-grid>
<!-- <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> -->
<ion-content dir="ltr" *ngIf="userInfo.company_type != 'CS'">
<ion-grid style="transform: rotate(90deg); padding: 25px;">
<ion-row>
<ion-col size="3"></ion-col>
<ion-col size="9" *ngIf="userInfo.EMPLOYEE_IMAGE != null" padding>
<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 style="padding-left: 315px;">
<img style="width: 380px; position: fixed; left: 340; height: 81px;" [src]='userInfo.company_logo' alt="../assets/imgs/HMG_LOGO.png"/>
</ion-col>
</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: 20px; padding: 0%;">{{userInfo.EMPLOYEE_NUMBER}}</p>
<ion-row>
<ion-col>
<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-row>
<ion-row>
<ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;">
<p style="font-size: 20px; padding: 0%;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</p>
<ion-col>
<ion-label>
<h5 class='font-text-style'>{{userInfo.job_en}}</h5>
</ion-label>
</ion-col>
</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%;">{{userJobName}}</p>
<ion-row>
<ion-col>
<ion-label>
<h5 class='font-text-style'>{{userInfo.mobile}}</h5>
</ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<img *ngIf="userInfo.CompanyImageURL" style="width: 90%; max-width: 100%; margin-left: 6%;" [src]="userInfo.CompanyBadge">
<img *ngIf="!userInfo.CompanyImageURL" style="width: 50%; max-width: 100%; margin-left: 16%;" src="../../../assets/imgs/HMG_LOGO.png">
<ion-col>
<ion-label>
<h5 class='font-text-style'>{{userInfo.email}}</h5>
</ion-label>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<img style="width: 50%; max-width: 100%; margin-left: 25%;" [src]="userInfo.EmployeeQR">
<ion-col>
<ion-label>
<h5 class='font-text-style'>{{userInfo.company_url}}</h5>
</ion-label>
</ion-col>
</ion-row>
</ion-grid>
</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>
</ion-content>

@ -27,5 +27,11 @@
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 { 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';
@Component({
@ -11,24 +12,13 @@ export class BusinessCardComponent implements OnInit {
@Input() userInfo: any;
public userJobName: any;
constructor(
public modalCtrl: ModalController,
public ts: TranslatorService,
public common: CommonService
) { }
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];
}
}
}
ngOnInit() {}
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 { ModalController } from '@ionic/angular';
import { DigitalIdComponent } from '../digital-id/digital-id.component';
import { AppUpdateComponent } from '../app-update/app-update.component';
@Component({
selector: 'login',
@ -196,9 +197,10 @@ export class LoginComponent implements OnInit, OnDestroy {
this.authService.checkApplicationVersion(() => { }).subscribe((result: CheckAppVersionResponse) => {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 2 && result.ErrorType == 4) {
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
this.handleAppUpdate(result);
});
this.appUpdate(result.ErrorEndUserMessage, result);
// this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
// this.handleAppUpdate(result);
// });
// tslint:disable-next-line: triple-equals
} else if (result.MessageStatus == 1) {
this.checkUserAuthentication();
@ -401,4 +403,16 @@ export class LoginComponent implements OnInit, OnDestroy {
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 showErrorMessage = false;
public messageValue: string;
public businessInfo: object;
constructor(
public navCtrl: NavController,
@ -195,9 +196,29 @@ export class SmsPageComponent implements OnInit {
request.IsDeviceNFC = this.isNFCAvailable;
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).subscribe((result: SMSCheckResponse) => {
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
CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
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;
this.authService.setAuthenticatedUser(result).subscribe(() => {

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

@ -2,86 +2,92 @@ import { PatientUserModel } from './PatientUserModel';
import { TestBed } from '@angular/core/testing';
export class AuthenticatedUser extends PatientUserModel {
public static SHARED_DATA = 'user-info';
TokenID:string;
ACTUAL_TERMINATION_DATE: string;
ASSIGNMENT_END_DATE: string;
ASSIGNMENT_ID: number;
ASSIGNMENT_NUMBER: string;
ASSIGNMENT_START_DATE: string;
ASSIGNMENT_STATUS_TYPE_ID: number;
ASSIGNMENT_TYPE: string;
BUSINESS_GROUP_ID: number;
BUSINESS_GROUP_NAME: string;
CURRENT_EMPLOYEE_FLAG: string;
EMPLOYEE_DISPLAY_NAME: string;
EMPLOYEE_EMAIL_ADDRESS:string;
EMPLOYEE_IMAGE:string;
EMPLOYEE_MOBILE_NUMBER: string;
EMPLOYEE_NAME:string;
EMPLOYEE_NUMBER: string;
EMPLOYEE_WORK_NUMBER:string;
EMPLOYMENT_CATEGORY: string;
EMPLOYMENT_CATEGORY_MEANING: string;
FREQUENCY: string;
FREQUENCY_MEANING: string;
FROM_ROW_NUM: number;
GRADE_ID: number;
GRADE_NAME: string;
HIRE_DATE: string;
JOB_ID: number;
JOB_NAME: string;
LEDGER_ID: number;
LOCATION_ID: number;
LOCATION_NAME: string;
MANUAL_TIMECARD_FLAG: string;
MANUAL_TIMECARD_MEANING: string;
NATIONALITY_CODE: string;
NATIONALITY_MEANING: string;
NATIONAL_IDENTIFIER:string;
NORMAL_HOURS: string;
NO_OF_ROWS: number;
ORGANIZATION_ID: number;
ORGANIZATION_NAME: string;
PAYROLL_CODE: string;
PAYROLL_ID: number;
PAYROLL_NAME: string;
PERSON_ID: number;
PERSON_TYPE:string;
PERSON_TYPE_ID: number;
PER_INFORMATION_CATEGORY: string;
POSITION_ID: number;
POSITION_NAME: string;
PRIMARY_FLAG: string;
ROW_NUM:number;
SUPERVISOR_ASSIGNMENT_ID: string;
SUPERVISOR_DISPLAY_NAME: string;
SUPERVISOR_EMAIL_ADDRESS: string;
SUPERVISOR_ID: number;
SUPERVISOR_MOBILE_NUMBER: string;
SUPERVISOR_NAME: string;
SUPERVISOR_NUMBER: string;
SUPERVISOR_WORK_NUMBER: string;
SWIPES_EXEMPTED_FLAG: string;
SWIPES_EXEMPTED_MEANING: string;
SYSTEM_PERSON_TYPE: string;
TK_EMAIL_ADDRESS: string;
TK_EMPLOYEE_DISPLAY_NAME: string;
TK_EMPLOYEE_NAME: string;
TK_EMPLOYEE_NUMBER: string;
TK_PERSON_ID: number;
TO_ROW_NUM: number;
UNIT_NUMBER: string;
USER_STATUS: string;
P_SESSION_ID:number;
MobileNumber:string;
LogInTokenID:string;
CompanyImageDescription: string;
CompanyImageURL: string;
CompanyMainCompany: string;
CompanyBadge: string;
SERVICE_DAYS:Number;
SERVICE_MONTHS:Number;
SERVICE_YEARS:Number;
public static SHARED_DATA = 'user-info';
TokenID: string;
ACTUAL_TERMINATION_DATE: string;
ASSIGNMENT_END_DATE: string;
ASSIGNMENT_ID: number;
ASSIGNMENT_NUMBER: string;
ASSIGNMENT_START_DATE: string;
ASSIGNMENT_STATUS_TYPE_ID: number;
ASSIGNMENT_TYPE: string;
BUSINESS_GROUP_ID: number;
BUSINESS_GROUP_NAME: string;
CURRENT_EMPLOYEE_FLAG: string;
EMPLOYEE_DISPLAY_NAME: string;
EMPLOYEE_EMAIL_ADDRESS: string;
EMPLOYEE_IMAGE: string;
EMPLOYEE_MOBILE_NUMBER: string;
EMPLOYEE_NAME: string;
EMPLOYEE_NUMBER: string;
EMPLOYEE_WORK_NUMBER: string;
EMPLOYMENT_CATEGORY: string;
EMPLOYMENT_CATEGORY_MEANING: string;
FREQUENCY: string;
FREQUENCY_MEANING: string;
FROM_ROW_NUM: number;
GRADE_ID: number;
GRADE_NAME: string;
HIRE_DATE: string;
JOB_ID: number;
JOB_NAME: string;
LEDGER_ID: number;
LOCATION_ID: number;
LOCATION_NAME: string;
MANUAL_TIMECARD_FLAG: string;
MANUAL_TIMECARD_MEANING: string;
NATIONALITY_CODE: string;
NATIONALITY_MEANING: string;
NATIONAL_IDENTIFIER: string;
NORMAL_HOURS: string;
NO_OF_ROWS: number;
ORGANIZATION_ID: number;
ORGANIZATION_NAME: string;
PAYROLL_CODE: string;
PAYROLL_ID: number;
PAYROLL_NAME: string;
PERSON_ID: number;
PERSON_TYPE: string;
PERSON_TYPE_ID: number;
PER_INFORMATION_CATEGORY: string;
POSITION_ID: number;
POSITION_NAME: string;
PRIMARY_FLAG: string;
ROW_NUM: number;
SUPERVISOR_ASSIGNMENT_ID: string;
SUPERVISOR_DISPLAY_NAME: string;
SUPERVISOR_EMAIL_ADDRESS: string;
SUPERVISOR_ID: number;
SUPERVISOR_MOBILE_NUMBER: string;
SUPERVISOR_NAME: string;
SUPERVISOR_NUMBER: string;
SUPERVISOR_WORK_NUMBER: string;
SWIPES_EXEMPTED_FLAG: string;
SWIPES_EXEMPTED_MEANING: string;
SYSTEM_PERSON_TYPE: string;
TK_EMAIL_ADDRESS: string;
TK_EMPLOYEE_DISPLAY_NAME: string;
TK_EMPLOYEE_NAME: string;
TK_EMPLOYEE_NUMBER: string;
TK_PERSON_ID: number;
TO_ROW_NUM: number;
UNIT_NUMBER: string;
USER_STATUS: string;
P_SESSION_ID: number;
MobileNumber: string;
LogInTokenID: string;
CompanyImageDescription: string;
CompanyImageURL: string;
CompanyMainCompany: string;
CompanyBadge: string;
SERVICE_DAYS: Number;
SERVICE_MONTHS: 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_Password: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) {
this.toast(this.ts.trPK(page, key));
}
async toast(message: string) {
const toast = await this.toastController.create({
message: message,
@ -217,6 +218,10 @@ export class CommonService {
this.redToast(this.ts.trPK(page, key));
}
public greenToastPK(page: string, key: string) {
this.greenToast(this.ts.trPK(page, key));
}
async redToast(message: string) {
const toast = await this.toastController.create({
message: message,
@ -228,6 +233,17 @@ export class CommonService {
});
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;
async startLoadingOld() {

@ -227,11 +227,11 @@ export class ConnectorService {
if (!this.cs.validResponse(result)) {
if (result.IsAuthenticated === false) {
this.cs.stopLoading();
this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
// this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
this.cs.sharedService.clearAll();
// this.cs.openLogin();
this.getLastLoginInfo();
});
// });
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {
// console.log("error expired");

@ -7,6 +7,6 @@
</div>
<div class="titleBox" [ngStyle]="link === '0' ? {'margin-left': '5px'} : {}">
<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>

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

@ -59,7 +59,7 @@
</ion-row>
<ion-row>
<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>
<img [ngClass]=" direction === 'en' ? 'digital-id-en' : 'digital-id-ar'" src="../assets/imgs/ID_ico.png">
</ion-button>

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

@ -75,6 +75,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
lastLoginDate: string;
user_name: string;
userInfo: any;
userBusiness: any;
constructor(
public ts: TranslatorService,
@ -102,6 +103,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.logintype= localStorage.getItem("login-type");
this.lastLoginDate= localStorage.getItem("login-at");
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() {
const modal = await this.modalController.create({
component: BusinessCardComponent,
cssClass: 'digital-id-modal-css'
cssClass: 'digital-id-modal-css',
componentProps: {
'userInfo': this.userBusiness
}
});
return await modal.present();
}

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

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

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

@ -1,12 +1,12 @@
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 { TranslatorService } from 'src/app/hmg-common/services/translator/translator.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 { MowadhafiService } from '../mowadhafi.service';
import { Location } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-my-request',
@ -14,7 +14,7 @@ import { Location } from '@angular/common';
styleUrls: ['./my-request.component.scss'],
})
export class MyRequestComponent implements OnInit {
public direction: String;
public direction: string;
public ticketsInfo : any = [];
public ticketCount = 10;
public ticketPage = 1;
@ -32,17 +32,24 @@ export class MyRequestComponent implements OnInit {
public events: Events,
public MowadhafiService: MowadhafiService,
private location: Location,
private menu: MenuController,
public route: ActivatedRoute
) {
this.direction = TranslatorService.getCurrentLanguageName();
this.route.params.subscribe(val => {
setTimeout(() => {
this.ionAlwaysEnter();
}, 100);
});
}
ngOnInit() {
ionAlwaysEnter(){
this.cs.startLoading();
this.getTicketsByEmployee();
}
ngOnInit() {}
goback() {
this.location.back();
@ -62,11 +69,9 @@ export class MyRequestComponent implements OnInit {
getTicketsByEmployee() {
const request = {
// TokenID:"xxx",
EmployeeNumber: "",
ItgPageSize: this.ticketCount,
ItgPageNo: this.ticketPage
};
this.MowadhafiService.getTicketsByEmployee(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlegetTicketsByEmployeeResult(result);
@ -75,32 +80,11 @@ export class MyRequestComponent implements OnInit {
}
handlegetTicketsByEmployeeResult(result){
this.ticketsInfo=result.Mohemm_ITG_TicketsByEmployeeList;
this.ticketTotal=this.ticketsInfo[0].totalItemsCount;
console.log("length______________________-.");
console.log(this.ticketsInfo.length);
this.ticketsInfo = result.Mohemm_ITG_TicketsByEmployeeList;
if(this.ticketsInfo.length > 0){
this.ticketTotal=this.ticketsInfo[0].totalItemsCount;
}
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": {
"en": " Select the type of change you want to make.",
"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": {

Loading…
Cancel
Save