From 24adfbe410ff8b0603e2e4db725728b620c576f2 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Mon, 6 Jul 2020 11:24:10 +0300 Subject: [PATCH] add placeHolder to check-user, forget and sms-page, also fix if the user enter the OTP wrong delete all numbers and change the cursor posision to be in first digit --- .../check-user/check-user.component.html | 4 ++-- .../forgot/forgot.component.html | 8 ++++---- .../sms-page/sms-page.page.html | 2 +- .../authentication/sms-page/sms-page.page.ts | 20 ++++++++++++++++--- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Mohem/src/app/authentication/check-user/check-user.component.html b/Mohem/src/app/authentication/check-user/check-user.component.html index 841a2b96..977d1d4d 100644 --- a/Mohem/src/app/authentication/check-user/check-user.component.html +++ b/Mohem/src/app/authentication/check-user/check-user.component.html @@ -23,8 +23,8 @@ - {{ts.trPK('login','check-user-place-holder')}} - diff --git a/Mohem/src/app/authentication/forgot/forgot.component.html b/Mohem/src/app/authentication/forgot/forgot.component.html index f363261d..954bb38f 100644 --- a/Mohem/src/app/authentication/forgot/forgot.component.html +++ b/Mohem/src/app/authentication/forgot/forgot.component.html @@ -24,16 +24,16 @@ - {{'changePassword,newPassword' | translate}} - - {{'changePassword,confirmPassword' | translate}} - diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.html b/Mohem/src/app/authentication/sms-page/sms-page.page.html index 815489bd..9f10c202 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.html +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.html @@ -45,7 +45,7 @@ + inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()" #ref autofocus="true" id="firstDigit"> {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => { + // tslint:disable-next-line: max-line-length + this.authService.checkSMS(request, () => {this.restCursorPosition()}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => { if (this.common.validResponse(result)) { AuthenticationService.servicePrivilage = result.Privilege_List; this.authService.setAuthenticatedUser(result).subscribe(() => { @@ -183,10 +185,19 @@ export class SmsPageComponent implements OnInit { this.activeType =this.common.setActiveTypeLogin(0); this.common.openHome(); }); + }else{ } }); } + public restCursorPosition(){ + + this.smc_code = []; + setTimeout(()=>{ + this.inputElement.setFocus(); + },500) + } + public insertMobileLogin() { const request = new GetLoginInfoRequest(); this.authService.setPublicFields(request); @@ -220,6 +231,9 @@ export class SmsPageComponent implements OnInit { this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW); this.common.openChangePassword(); } + }else{ + this.smc_code =[]; + } }); }