diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index e98d908d..020b130c 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -120,6 +120,8 @@ export class AppComponent implements OnInit { this.events.subscribe('setMenu', () => { const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { if (user) { + console.log(user); + localStorage.setItem("digitalIDUser", JSON.stringify(user)); this.digitalIDUser = user//JSON.stringify(user); this.companyUrl = user.CompanyImageURL ? user.CompanyImageURL : '../assets/imgs/CSLogo.png'; this.companyDesc = user.CompanyImageDescription ? user.CompanyImageDescription : 'Powered By Cloud Solutions'; diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html index 64c9226f..158dc120 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html @@ -63,12 +63,5 @@ - - - - diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts index 8c6d5924..7233a9b3 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; -import {ButtonSettings} from 'src/app/hmg-common/ui/button/models/button-settingsl'; -import {TranslatorService} from 'src/app/hmg-common/services/translator/translator.service'; +import { ButtonSettings } from 'src/app/hmg-common/ui/button/models/button-settingsl'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request'; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; @@ -50,7 +50,7 @@ export class ConfirmLoginComponent implements OnInit { private iosLink: string; private androidLink: string; public isNFCAvailable = false; - direction:string; + direction: string; userInfo: any; constructor( @@ -63,19 +63,19 @@ export class ConfirmLoginComponent implements OnInit { public platform: Platform, public modalController: ModalController, private nfc: NFC - ) { - this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); - this.deviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); - // if device token undefind + ) { + this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + this.deviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); + // if device token undefind - // tslint:disable-next-line: triple-equals - if (this.deviceToken == undefined) { + // tslint:disable-next-line: triple-equals + if (this.deviceToken == undefined) { this.deviceToken = localStorage.getItem('deviceToken'); } - this.lastLogin = this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); - this.username = localStorage.getItem('user'); - this.password = localStorage.getItem('password'); - this.empname = localStorage.getItem('emp-name'); + this.lastLogin = this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); + this.username = localStorage.getItem('user'); + this.password = localStorage.getItem('password'); + this.empname = localStorage.getItem('emp-name'); } ngOnInit() { @@ -125,7 +125,7 @@ export class ConfirmLoginComponent implements OnInit { icon: 'assets/icon/login/101.png', settings: new ButtonSettings(true, true, true, true), value: 3, - disabled: this.isFaceorFinger === 'face' ? false : true, + disabled: this.isFaceorFinger === 'face' ? false : true, visible: this.onlySMSBox, buttonClass: 'buttonClassWhite', pClass: 'pClassMyFileIconBlack', @@ -161,16 +161,16 @@ export class ConfirmLoginComponent implements OnInit { switch (el.value) { case 1: - console.log(el.value); - localStorage.setItem("login-type",el.value); - console.log("login-type: "+ localStorage.getItem("login-type")) - if(this.FFloginType == 3 || this.FFloginType == 2 ){ - this.cs.setActiveTypeLogin(el.value); - }else{ - this.cs.setActiveTypeLogin(0); + console.log(el.value); + localStorage.setItem("login-type", el.value); + console.log("login-type: " + localStorage.getItem("login-type")) + if (this.FFloginType == 3 || this.FFloginType == 2) { + this.cs.setActiveTypeLogin(el.value); + } else { + this.cs.setActiveTypeLogin(0); - } - this.loginWithSMS(el); + } + this.loginWithSMS(el); break; case 2: @@ -183,15 +183,15 @@ export class ConfirmLoginComponent implements OnInit { break; case 4: - console.log(el.value); + console.log(el.value); - localStorage.setItem("login-type",el.value); - if(this.FFloginType == 3 || this.FFloginType == 2 ){ - this.cs.setActiveTypeLogin(el.value); - }else{ - this.cs.setActiveTypeLogin(0); + localStorage.setItem("login-type", el.value); + if (this.FFloginType == 3 || this.FFloginType == 2) { + this.cs.setActiveTypeLogin(el.value); + } else { + this.cs.setActiveTypeLogin(0); - } + } this.loginWithWhatsapp(el); break; default: @@ -203,46 +203,46 @@ export class ConfirmLoginComponent implements OnInit { loginWithSMS(el) { if (!el.disabled) { - if (this.loginData.LogInTokenID) { - this.sendActivationCode(1); - } else { - // this.checkUserAuthentication(1); - // this.checkUserAuthentication();** - } + if (this.loginData.LogInTokenID) { + this.sendActivationCode(1); + } else { + // this.checkUserAuthentication(1); + // this.checkUserAuthentication();** + } } } loginWithWhatsapp(el) { if (!el.disabled) { - if (this.loginData.LogInTokenID) { - this.sendActivationCode(2); - } else { - // this.checkUserAuthentication(2); - } + if (this.loginData.LogInTokenID) { + this.sendActivationCode(2); + } else { + // this.checkUserAuthentication(2); + } } } - public sendActivationCode(type: number) { + public sendActivationCode(type: number) { const request = new SendActivationByType(); this.authService.setPublicFields(request); request.OTP_SendType = type; request.MobileNumber = this.loginData.MobileNumber; - request.IsMobileFingerPrint =0; + request.IsMobileFingerPrint = 0; - request.P_USER_NAME=this.loginData.P_USER_NAME; + request.P_USER_NAME = this.loginData.P_USER_NAME; - request.LogInTokenID =this.loginData.LogInTokenID; + request.LogInTokenID = this.loginData.LogInTokenID; - request.P_LEGISLATION_CODE =this.loginData.P_LEGISLATION_CODE;//"SA"; + request.P_LEGISLATION_CODE = this.loginData.P_LEGISLATION_CODE;//"SA"; // request.VersionID ="2.0"; -// request.LanguageID = imeiData && imeiData.PreferredLanguage || request.LanguageID; + // request.LanguageID = imeiData && imeiData.PreferredLanguage || request.LanguageID; this.authService @@ -259,7 +259,7 @@ export class ConfirmLoginComponent implements OnInit { .subscribe((result: any) => { if (result.isSMSSent) { // tslint:disable-next-line: max-line-length - this.cs.sharedService.setSharedData({MobileNumber: this.loginData.MobileNumber, loginType: this.selectedOption}, SMSCheckRequest.SHARED_DATA); + this.cs.sharedService.setSharedData({ MobileNumber: this.loginData.MobileNumber, loginType: this.selectedOption }, SMSCheckRequest.SHARED_DATA); this.cs.openSMSPage(); } }); @@ -293,7 +293,7 @@ export class ConfirmLoginComponent implements OnInit { private presentBiometricDialog() { this.faio.show({ title: 'Biometric Authetnciation', // (Android Only) | optional | Default: " Biometric Sign On" - subtitle: 'Coolest Plugin ever' , // (Android Only) | optional | Default: null + subtitle: 'Coolest Plugin ever', // (Android Only) | optional | Default: null description: this.ts.trPK('general', 'auth-please'), // optional | Default: null fallbackButtonTitle: this.ts.trPK('general', 'use-pin'), // optional | When disableBackup is false defaults to "Use Pin". disableBackup: true, // optional | default: false @@ -302,39 +302,39 @@ export class ConfirmLoginComponent implements OnInit { // disableBackup: true, // Only for Android(optional) // localizedFallbackTitle: this.ts.trPK("general", "use-pin"), // Only for iOS // localizedReason: this.ts.trPK("general", "auth-please") // Only for iOS - }).then((result: any) => { - const request = { + }).then((result: any) => { + const request = { DeviceType: this.cs.getDeviceType(), DeviceToken: this.deviceToken - }; - // this.authService.setPublicFields(request); - // request.MobileNumber = this.loginData.MobileNumber; - // request.P_USER_NAME=this.loginData.P_USER_NAME; - // request.UserName=this.loginData.P_USER_NAME; - // request.LogInTokenID =this.loginData.LogInTokenID; - // request.CompanyID =1;//cs=1 , HMG=2 - this.getMobileInfo(request); - }).catch((error: any) => { - console.log(error); - }); + }; + // this.authService.setPublicFields(request); + // request.MobileNumber = this.loginData.MobileNumber; + // request.P_USER_NAME=this.loginData.P_USER_NAME; + // request.UserName=this.loginData.P_USER_NAME; + // request.LogInTokenID =this.loginData.LogInTokenID; + // request.CompanyID =1;//cs=1 , HMG=2 + this.getMobileInfo(request); + }).catch((error: any) => { + console.log(error); + }); } private getMobileInfo(request: any) { this.authService.getLoginInfo(request, () => { }, this.ts.trPK('general', 'ok')).subscribe((result: GetLoginInfoResponse) => { - if (result.Mohemm_GetMobileLoginInfoList.length > 0) { - // tslint:disable-next-line: triple-equals - if ( result.Mohemm_GetMobileLoginInfoList[0].LoginType == 2 || result.Mohemm_GetMobileLoginInfoList[0].LoginType == 3) { - this.loginTokenID = result.LogInTokenID; - this.checkSMS(); - } else { - this.onlySMSBox = false; - this.button(); - } + if (result.Mohemm_GetMobileLoginInfoList.length > 0) { + // tslint:disable-next-line: triple-equals + if (result.Mohemm_GetMobileLoginInfoList[0].LoginType == 2 || result.Mohemm_GetMobileLoginInfoList[0].LoginType == 3) { + this.loginTokenID = result.LogInTokenID; + this.checkSMS(); } else { - this.onlySMSBox = false; - this.button(); - } - }); + this.onlySMSBox = false; + this.button(); + } + } else { + this.onlySMSBox = false; + this.button(); + } + }); } @@ -348,7 +348,7 @@ export class ConfirmLoginComponent implements OnInit { if (err === "NO_NFC") { this.isNFCAvailable = false; } else if (err === "NFC_DISABLED") { - this.isNFCAvailable = true; + this.isNFCAvailable = true; } else { this.isNFCAvailable = false; } @@ -363,10 +363,10 @@ export class ConfirmLoginComponent implements OnInit { request.P_USER_NAME = data.P_USER_NAME; request.MobileNumber = data.MobileNumber; request.IsDeviceNFC = this.isNFCAvailable; - this.authService.checkSMS(request, () => {}, this.ts.trPK('general', 'ok')) + this.authService.checkSMS(request, () => { }, this.ts.trPK('general', 'ok')) .subscribe((result: SMSCheckResponse) => { if (this.cs.validResponse(result)) { - + // Wifi Credientials CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID; CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password; @@ -375,7 +375,7 @@ export class ConfirmLoginComponent implements OnInit { this.authService.setAuthenticatedUser(result).subscribe(() => { localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME); this.user_name = result.MemberInformationList[0].EMPLOYEE_NAME; - const currDateTime = moment().format('MMM DD , YYYY HH:mm'); + const currDateTime = moment().format('MMM DD , YYYY HH:mm'); localStorage.setItem('login-at', currDateTime); if (this.platform.is('cordova')) { this.insertMobileLogin(); @@ -401,91 +401,104 @@ export class ConfirmLoginComponent implements OnInit { request.EmployeeName = this.user_name; this.authService.insertMobileLoginInfo(request, () => { }, this.ts.trPK('general', 'ok'), this.isPostNoLoad) .subscribe((result: any) => { - console.log('successful insertMobileLoginInfo' ); - }); -} + console.log('successful insertMobileLoginInfo'); + }); + } -// do silent login -private checkUserAuthentication() { - this.cs.startLoading(); - const request = new LoginRequest(); - request.P_USER_NAME = this.username; - request.P_LANGUAGE = 'US'; // this.language; - request.P_PASSWORD = this.password; - this.authService + // do silent login + private checkUserAuthentication() { + this.cs.startLoading(); + const request = new LoginRequest(); + request.P_USER_NAME = this.username; + request.P_LANGUAGE = 'US'; // this.language; + request.P_PASSWORD = this.password; + this.authService .login(request, () => { - console.log('error here'); + console.log('error here'); }, this.ts.trPK('general', 'ok')) .subscribe((result: CheckUserAuthenticationResponse) => { - console.log('success'); - this.cs.stopLoading(); - if (this.cs.validResponse(result)) { - this.loginData = new LoginModel(); - this.loginData.LogInTokenID = result.LogInTokenID; - this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER; - this.loginData.P_USER_NAME = this.username; - this.loginData.EmployeeName = this.user_name; - this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); - this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); - this.confirm(this.loginType); - } else { - if (result.IsPasswordExpired) { - // alert("dont forget to handelpresentPasswordExpiredDialog() "); - // this.presentPasswordExpiredDialog(); ***** - } + console.log('success'); + this.cs.stopLoading(); + if (this.cs.validResponse(result)) { + this.loginData = new LoginModel(); + this.loginData.LogInTokenID = result.LogInTokenID; + this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER; + this.loginData.P_USER_NAME = this.username; + this.loginData.EmployeeName = this.user_name; + this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); + this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); + this.confirm(this.loginType); + } else { + if (result.IsPasswordExpired) { + // alert("dont forget to handelpresentPasswordExpiredDialog() "); + // this.presentPasswordExpiredDialog(); ***** } + } }); -} + } -private handleAppUpdate(result) { - this.iosLink = result.IOSLink; - this.androidLink = result.AndroidLink; - if (this.platform.is('android')) { + private handleAppUpdate(result) { + this.iosLink = result.IOSLink; + this.androidLink = result.AndroidLink; + if (this.platform.is('android')) { if (this.androidLink) { - window.open(this.androidLink, '_system'); + window.open(this.androidLink, '_system'); } - } else if (this.platform.is('ios')) { + } else if (this.platform.is('ios')) { if (this.iosLink) { - window.open(this.iosLink, '_system'); + window.open(this.iosLink, '_system'); } + } } -} -public checkAppUpdated() { - 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); - }); - // tslint:disable-next-line: triple-equals - } else if (result.MessageStatus == 1) { - this.checkUserAuthentication(); - } - }); -} - -checkAccess(el: any) { - const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); - this.loginType = el; - if (this.accessFromOutSide) { - this.checkAppUpdated(); - } else { + public checkAppUpdated() { + this.authService.checkApplicationVersion(() => { }).subscribe((result: CheckAppVersionResponse) => { // tslint:disable-next-line: triple-equals - if (!data == undefined ) { - this.confirm(this.loginType); - } else { + if (result.MessageStatus == 2 && result.ErrorType == 4) { + this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { + this.handleAppUpdate(result); + }); + // tslint:disable-next-line: triple-equals + } else if (result.MessageStatus == 1) { + this.checkUserAuthentication(); + } + }); + } + + checkAccess(el: any, isDigitalID = false, buttonType?) { + const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); + if (isDigitalID) { + this.button(); + this.checkButtonType(buttonType); + } + else { + console.log(data); + this.loginType = el; + if (this.accessFromOutSide) { this.checkAppUpdated(); + } else { + // tslint:disable-next-line: triple-equals + if (!data == undefined) { + this.confirm(this.loginType); + } else { + this.checkAppUpdated(); + } + } } } -} -async openDigitalId() { - const modal = await this.modalController.create({ - component: DigitalIdComponent, - cssClass: 'digital-id-modal-css' - }); - return await modal.present(); -} + checkButtonType(typeNumber) { + let buttonSelected; + this.buttons.forEach(element => { + element.forEach(elementValue => { + if(typeNumber === elementValue.value){ + buttonSelected = elementValue; + } + }); + }); + this.sharedData.setSharedData(true, "loginWithDigitalIDButton"); + this.loginType = buttonSelected; + this.checkAppUpdated(); + } -}​ +} diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.html b/Mohem/src/app/authentication/digital-id/digital-id.component.html index 8a998ebd..9049dba7 100644 --- a/Mohem/src/app/authentication/digital-id/digital-id.component.html +++ b/Mohem/src/app/authentication/digital-id/digital-id.component.html @@ -1,4 +1,4 @@ - - - + @@ -48,22 +40,23 @@ -

191817

+

{{userInfo.EMPLOYEE_NUMBER}}

-

Enad Hilal Ahmed

+

{{userInfo.EMPLOYEE_DISPLAY_NAME}}

-

Mobile Developer

+

{{userInfo.JOB_NAME}}

- + + diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.ts b/Mohem/src/app/authentication/digital-id/digital-id.component.ts index da088354..9472fff8 100644 --- a/Mohem/src/app/authentication/digital-id/digital-id.component.ts +++ b/Mohem/src/app/authentication/digital-id/digital-id.component.ts @@ -16,6 +16,9 @@ export class DigitalIdComponent implements OnInit { ) { } ngOnInit() { + if(JSON.parse(localStorage.getItem('digitalIDUser'))){ + this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); + } console.log(this.userInfo); } 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 db2c1fc6..018cb146 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -336,6 +336,8 @@ export class AuthenticationService { user.TokenID = result.TokenID; user.CompanyImageDescription=result.CompanyImageDescription; user.CompanyImageURL=result.CompanyImageURL; + user.CompanyBadge = result.CompanyBadge; + user.CompanyMainCompany = result.CompanyMainCompany; user.LogInTokenID = this.cs.sharedService.getSharedData( AuthenticationService.LOGIN_DATA, false 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 2438134c..998e84ea 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 @@ -78,6 +78,8 @@ MobileNumber:string; LogInTokenID:string; CompanyImageDescription: string; CompanyImageURL: string; +CompanyMainCompany: string; +CompanyBadge: string; SERVICE_DAYS:Number; SERVICE_MONTHS:Number; SERVICE_YEARS:Number; 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 7c703fb2..73d27b74 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 @@ -15,6 +15,8 @@ export class SMSCheckResponse extends Response { public LogInTokenID : string; public CompanyImageDescription:string; public CompanyImageURL:string; + public CompanyMainCompany: string; + public CompanyBadge: string; public EMPLOYEE_MOBILE_NUMBER:string; public EMPLOYEE_NAME:string; public Mohemm_Wifi_SSID:string; 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 e1c3a368..5af2c3cf 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 @@ -49,13 +49,17 @@ - - - - + + + +

{{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 2f287ba3..b4a36600 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 @@ -65,4 +65,32 @@ .text1 { line-height: 1.5; -} \ No newline at end of file +} + +.button-digital-id{ + --background: white !important; + background: white !important; + white-space: normal; + color: white; + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 33px !important; + border-radius: 33px !important; + --min-height: 1.6cm !important; + width: 325px; + border: 1px solid black; +} + +.digital-id-en{ + color: black; + position: absolute; + right: 25px; + width: 10%; + } + + .digital-id-ar{ + color: black; + position: absolute; + left: 25px; + width: 10%; + } \ No newline at end of file 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 39703cbe..037509e7 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 @@ -14,8 +14,9 @@ import { ConfirmLoginComponent } from 'src/app/authentication/confirm-login/conf import * as moment from 'moment' import { ButtonSettings } from '../button/models/button-settingsl'; -import { Events } from '@ionic/angular'; +import { Events, ModalController } from '@ionic/angular'; import { SharedDataService } from '../../services/shared-data-service/shared-data.service'; +import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component"; @Component({ selector: "welcome-login", @@ -72,6 +73,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy { logintype: any; lastLoginDate: string; user_name: string; + userInfo: any; constructor( public ts: TranslatorService, @@ -79,6 +81,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy { public authservice: AuthenticationService, public events: Events, public sharedData: SharedDataService, + public modalController: ModalController, ) { } ngOnInit() { @@ -97,6 +100,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy { this.empname= localStorage.getItem("emp-name"); this.logintype= localStorage.getItem("login-type"); this.lastLoginDate= localStorage.getItem("login-at"); + this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); @@ -220,6 +224,21 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy { this.loginWithUser.emit(); } + testLogin(){ + let x = { + title: 'login,verify-with-whatsapp', + url: null, + icon: 'assets/icon/login/104.png', + settings: new ButtonSettings(true, true, true, true), + value: 4, + visible: true, + buttonClass: 'buttonClassWhite', + pClass: 'pClassMyFileIconBlack', + class: 'nationalIdIcon', + }; + this.confimLogin.checkAccess(this.logintype, true, this.logintype); + } + // getDate(date: string) { @@ -233,5 +252,14 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy { // alert(time) return time; } + + async openDigitalId() { + const modal = await this.modalController.create({ + component: DigitalIdComponent, + cssClass: 'digital-id-modal-css' + }); + return await modal.present(); + } + } diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index df033ecd..268fe9c3 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -1,7 +1,7 @@ import { EitService } from './../eit/services/eit.service'; import { Component, OnInit } from '@angular/core'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; -import { Platform, MenuController, Events, ActionSheetController } from '@ionic/angular'; +import { Platform, MenuController, Events, ActionSheetController, ModalController } from '@ionic/angular'; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; @@ -38,6 +38,7 @@ import { isThisISOWeek } from 'date-fns'; import { Router } from '@angular/router'; import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; import { NFC, Ndef} from "@ionic-native/nfc/ngx" +import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component'; @Component({ selector: 'app-home', @@ -156,6 +157,7 @@ export class HomePage implements OnInit { public router: Router, private platform: Platform, public backgroundGeolocation: BackgroundGeolocation, + public modalController: ModalController, private nfc: NFC ) { this.events.subscribe('img-change', displayImg => { @@ -166,6 +168,7 @@ export class HomePage implements OnInit { } ngOnInit() { + let openDigitalIDCard = this.sharedData.getSharedData("loginWithDigitalIDButton", true); this.platform.backButton.subscribeWithPriority(9999, () => { if (this.router.isActive('/home', true)) { this.common.openHome(); @@ -179,6 +182,10 @@ export class HomePage implements OnInit { this.events.subscribe('getNotCount', badge => { this.notBadge = badge; }); + if(openDigitalIDCard === true){ + console.log("DONE"); + this.openDigitalId(); + } } ionViewWillEnter() { @@ -767,4 +774,12 @@ public showAttendanceOptions() { this.openPage(this.ticketRequestObject); } } + + async openDigitalId() { + const modal = await this.modalController.create({ + component: DigitalIdComponent, + cssClass: 'digital-id-modal-css' + }); + return await modal.present(); + } } diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html index 198a2606..c9f828cc 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -284,19 +284,21 @@ - + - {{action.name}} + {{action.name}} + Request Information + - + Skip diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts index 90162fe0..1452df31 100644 --- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -144,22 +144,22 @@ export class WorkListMainItgComponent implements OnInit { imageURL(actionName) { if (actionName == "Approve") { - return "../assets/imgs/action-approve.png" + return "../assets/imgs/mohemm-action/Approve.png" } if (actionName == "Reject") { - return "../assets/imgs/action-reject.png" + return "../assets/imgs/mohemm-action/Reject.png" } if (actionName == "RequestInformation") { - return "../assets/imgs/action-info.png" + return "../assets/imgs/mohemm-action/info.png" } if (actionName == "Grant") { - return "../assets/imgs/action-info.png" + return "../assets/imgs/mohemm-action/info.png" } if (actionName == "Delegate") { - return "../assets/imgs/action-info.png" + return "../assets/imgs/mohemm-action/info.png" } if (actionName == "Answer") { - return "../assets/imgs/action-info.png" + return "../assets/imgs/mohemm-action/info.png" } } diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html index a8c4ab86..56e1f721 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html @@ -30,7 +30,7 @@ - + {{'worklistMain, attach-file' | translate}} @@ -649,40 +649,40 @@ - + - - {{approve_label}} + + {{approve_label}} - + - {{close_label}} + {{close_label}} - - {{reject_label}} + + {{reject_label}} - - {{reqInfo_label}} + + {{reqInfo_label}} - + {{'worklistMain, skip' | translate}} - + {{'worklistMain, more' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss index 3a68dd25..8e9c423c 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss @@ -110,7 +110,7 @@ } .margin-left { - margin-left: 30px; + margin-left: 0px; } .active-Segment { @@ -134,4 +134,9 @@ text-transform: none; --color-checked: none; border: 0; + } + + .action-btn { + white-space: pre-wrap; + font-size: 12px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index 5bc30dac..62fa3497 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -164,13 +164,10 @@ export class WorklistMainMRComponent implements OnInit { { this.slides.slideTo(3); } - console.log(" event.detail.value: " + event.detail.value); } public slideChanged(event: any) { this.slides.getActiveIndex().then(index => { - console.log(index); - console.log(event); if(index === 0) { this.activeSegment = 'info'; @@ -187,7 +184,6 @@ export class WorklistMainMRComponent implements OnInit { { this.activeSegment = 'attach'; } - console.log(this.activeSegment); }); } diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html index 1ca7ee25..02711308 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html @@ -536,36 +536,36 @@ - + - - {{approve_label}} + + {{approve_label}} - - {{close_label}} + + {{close_label}} - - {{reject_label}} + + {{reject_label}} - - {{reqInfo_label}} + + {{reqInfo_label}} - - {{'worklistMain, skip' | translate}} + + {{'worklistMain, skip' | translate}} - - {{'worklistMain, more' | translate}} + + {{'worklistMain, more' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss index 8b52107b..8c86b6a3 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss @@ -113,7 +113,7 @@ } .margin-left { - margin-left: 30px; + margin-left: 0px; } .active-Segment { @@ -137,4 +137,8 @@ text-transform: none; --color-checked: none; border: 0; + } + .action-btn { + white-space: pre-wrap; + font-size: 12px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html index 5607e12d..b4f6cd3a 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html @@ -368,45 +368,45 @@ - + - + - {{approve_label}} + {{approve_label}} - + - {{close_label}} + {{close_label}} - + - {{reject_label}} + {{reject_label}} - + - {{reqInfo_label}} + {{reqInfo_label}} - - {{'worklistMain, skip' | translate}} + + {{'worklistMain, skip' | translate}} - - {{'worklistMain, more' | translate}} + + {{'worklistMain, more' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss index 92be66f2..635158dc 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss @@ -110,7 +110,7 @@ } .margin-left { - margin-left: 30px; + margin-left: 0px; } .active-Segment { @@ -134,4 +134,8 @@ text-transform: none; --color-checked: none; border: 0; + } + .action-btn { + white-space: pre-wrap; + font-size: 12px; } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index c22ebe93..d13459cc 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -439,41 +439,41 @@ - + - + - {{approve_label}} + {{approve_label}} - + - {{close_label}} + {{close_label}} - + - {{reject_label}} + {{reject_label}} - + - {{reqInfo_label}} + {{reqInfo_label}} - - {{'worklistMain, skip' | translate}} + + {{'worklistMain, skip' | translate}} - - {{'worklistMain, more' | translate}} + + {{'worklistMain, more' | translate}} diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss index 5a62c470..7d218c79 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss @@ -325,4 +325,8 @@ ion-card{ text-transform: none; --color-checked: none; border: 0; +} +.action-btn { + white-space: pre-wrap; + font-size: 12px; } \ No newline at end of file diff --git a/Mohem/src/assets/imgs/mohemm-action/Approve.png b/Mohem/src/assets/imgs/mohemm-action/Approve.png new file mode 100644 index 00000000..1f6e0f80 Binary files /dev/null and b/Mohem/src/assets/imgs/mohemm-action/Approve.png differ diff --git a/Mohem/src/assets/imgs/mohemm-action/Delegated.png b/Mohem/src/assets/imgs/mohemm-action/Delegated.png new file mode 100644 index 00000000..b2296015 Binary files /dev/null and b/Mohem/src/assets/imgs/mohemm-action/Delegated.png differ diff --git a/Mohem/src/assets/imgs/mohemm-action/More.png b/Mohem/src/assets/imgs/mohemm-action/More.png new file mode 100644 index 00000000..925f6ea5 Binary files /dev/null and b/Mohem/src/assets/imgs/mohemm-action/More.png differ diff --git a/Mohem/src/assets/imgs/mohemm-action/Reject.png b/Mohem/src/assets/imgs/mohemm-action/Reject.png new file mode 100644 index 00000000..7f4693f1 Binary files /dev/null and b/Mohem/src/assets/imgs/mohemm-action/Reject.png differ diff --git a/Mohem/src/assets/imgs/mohemm-action/Skip.png b/Mohem/src/assets/imgs/mohemm-action/Skip.png new file mode 100644 index 00000000..03b3c23f Binary files /dev/null and b/Mohem/src/assets/imgs/mohemm-action/Skip.png differ diff --git a/Mohem/src/assets/imgs/mohemm-action/info.png b/Mohem/src/assets/imgs/mohemm-action/info.png new file mode 100644 index 00000000..7d37568e Binary files /dev/null and b/Mohem/src/assets/imgs/mohemm-action/info.png differ