diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index adb41c30..27f17150 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -76,7 +76,7 @@ - + @@ -175,7 +175,7 @@ - + diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index b7fe55b8..872f968f 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -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(); diff --git a/Mohem/src/app/app.module.ts b/Mohem/src/app/app.module.ts index 31b0d1c1..bce56c04 100644 --- a/Mohem/src/app/app.module.ts +++ b/Mohem/src/app/app.module.ts @@ -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, diff --git a/Mohem/src/app/authentication/app-update/app-update.component.html b/Mohem/src/app/authentication/app-update/app-update.component.html new file mode 100644 index 00000000..b2c6510d --- /dev/null +++ b/Mohem/src/app/authentication/app-update/app-update.component.html @@ -0,0 +1,26 @@ + +
+ +
+
+ +
+

{{ 'general,app-update' | translate }}

+ +

{{'home, app-update' | translate}}

+ +

{{msg}}

+ + + + + + + {{ 'general,update-now' | translate }} + + + + + ​ +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/app-update/app-update.component.scss b/Mohem/src/app/authentication/app-update/app-update.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/authentication/app-update/app-update.component.spec.ts b/Mohem/src/app/authentication/app-update/app-update.component.spec.ts new file mode 100644 index 00000000..f4094f06 --- /dev/null +++ b/Mohem/src/app/authentication/app-update/app-update.component.spec.ts @@ -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; + + 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(); + }); +}); diff --git a/Mohem/src/app/authentication/app-update/app-update.component.ts b/Mohem/src/app/authentication/app-update/app-update.component.ts new file mode 100644 index 00000000..fe110da6 --- /dev/null +++ b/Mohem/src/app/authentication/app-update/app-update.component.ts @@ -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 + }); + } + +} diff --git a/Mohem/src/app/authentication/business-card/business-card.component.html b/Mohem/src/app/authentication/business-card/business-card.component.html index 54e4d4fc..3ab67a35 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.html +++ b/Mohem/src/app/authentication/business-card/business-card.component.html @@ -1,74 +1,113 @@ - - - - + + - - + + https://hmgwebservices.com/images/Moheem/CS.jpg - - + + - -

{{userInfo.ASSIGNMENT_NUMBER}}

+
+ + + +

{{userInfo.name_en}}

+
+
+ + +

{{userInfo.name_ar}}

+
-

{{userInfo.EMPLOYEE_DISPLAY_NAME}}

-

{{userJobName}}

+ +
{{userInfo.job_en}}
+
+
+ + +
{{userInfo.ar}}
+
- - + + +
{{userInfo.mobile}}
+
+
+
+ + + +
{{userInfo.email}}
+
+
+
+ + + +
{{userInfo.company_url}}
+
-
+
- - + + + + + - - - - + + ../assets/imgs/HMG_LOGO.png - - -

{{userInfo.EMPLOYEE_NUMBER}}

+ + + + + + +

{{userInfo.name_en}}

+
- -

{{userInfo.EMPLOYEE_DISPLAY_NAME}}

+ + +
{{userInfo.job_en}}
+
- - -

{{userJobName}}

+ + + +
{{userInfo.mobile}}
+
- - - + + +
{{userInfo.email}}
+
- - + + +
{{userInfo.company_url}}
+
-
- - -
- -
-
\ No newline at end of file +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/business-card/business-card.component.scss b/Mohem/src/app/authentication/business-card/business-card.component.scss index fe2a0924..c356aa64 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.scss +++ b/Mohem/src/app/authentication/business-card/business-card.component.scss @@ -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; +} diff --git a/Mohem/src/app/authentication/business-card/business-card.component.ts b/Mohem/src/app/authentication/business-card/business-card.component.ts index a0df234d..bdf79545 100644 --- a/Mohem/src/app/authentication/business-card/business-card.component.ts +++ b/Mohem/src/app/authentication/business-card/business-card.component.ts @@ -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() { diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 7f3c4e89..ead3db32 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -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(); + } + } diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index 1be921ed..85c155ae 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -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(() => { diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index 9952d38e..5642d5b3 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -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; diff --git a/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts b/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts index 998e84ea..f859e5f8 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/authenticated-user.ts @@ -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; } diff --git a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts index c6332dba..387a7d73 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts @@ -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; + } diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index e71f00c0..cac80b88 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -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() { diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index ddd23f6d..074ecfa9 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -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"); diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html index 71a76dd0..bdd4003f 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html @@ -7,6 +7,6 @@
{{statsValue}} -

{{title}}

+

{{returnTitle(title)}}

\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts index b9161f22..10c654cc 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts @@ -27,5 +27,9 @@ export class StatsButtonComponent implements OnInit { ngOnInit() {} public onClicked() {} - + + returnTitle(titleText: string){ + const titleArr1 = titleText.replace(/\u00a0/g, " "); + return titleArr1 + } } diff --git a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html index feb98981..c6de39de 100644 --- a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html +++ b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html @@ -59,7 +59,7 @@ - +

{{ts.trPK('general','digital-id')}}

diff --git a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.scss b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.scss index b4a36600..7677217e 100644 --- a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.scss +++ b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.scss @@ -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; } diff --git a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts index eff2f3db..7726efb1 100644 --- a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts +++ b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts @@ -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(); } diff --git a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts index d0b0d3bb..d7848c6f 100644 --- a/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts +++ b/Mohem/src/app/mowadhafi/hr-request-form/hr-request-form.component.ts @@ -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"); + } + }) } diff --git a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts index 149a8596..73cd4751 100644 --- a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts +++ b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts @@ -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) } diff --git a/Mohem/src/app/mowadhafi/mowadhafi.service.ts b/Mohem/src/app/mowadhafi/mowadhafi.service.ts index 20f13c9a..8976393b 100644 --- a/Mohem/src/app/mowadhafi/mowadhafi.service.ts +++ b/Mohem/src/app/mowadhafi/mowadhafi.service.ts @@ -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' } ) } diff --git a/Mohem/src/app/mowadhafi/my-request/my-request.component.ts b/Mohem/src/app/mowadhafi/my-request/my-request.component.ts index 06e83aa2..6d72c3c1 100644 --- a/Mohem/src/app/mowadhafi/my-request/my-request.component.ts +++ b/Mohem/src/app/mowadhafi/my-request/my-request.component.ts @@ -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); - - // } } } diff --git a/Mohem/src/assets/icon/update.png b/Mohem/src/assets/icon/update.png new file mode 100644 index 00000000..e461c733 Binary files /dev/null and b/Mohem/src/assets/icon/update.png differ diff --git a/Mohem/src/assets/icon/update_rocket_image.png b/Mohem/src/assets/icon/update_rocket_image.png new file mode 100644 index 00000000..85862eba Binary files /dev/null and b/Mohem/src/assets/icon/update_rocket_image.png differ diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 01c556c6..d79c02b4 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -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": {