diff --git a/apps/36-blocks-widget/src/app/app.component.ts b/apps/36-blocks-widget/src/app/app.component.ts index ad5a8c72..9b66aed2 100644 --- a/apps/36-blocks-widget/src/app/app.component.ts +++ b/apps/36-blocks-widget/src/app/app.component.ts @@ -7,8 +7,9 @@ import { WidgetThemeService } from './otp/service/widget-theme.service'; const REFERENCE_ID = '4512365b177668815069e61c1692def'; const THEME: WidgetTheme = WidgetTheme.System; -const TYPE: PublicScriptType = PublicScriptType.Authorization; -const AUTH_TOKEN = ''; +const TYPE: PublicScriptType = PublicScriptType.UserProfile; +const AUTH_TOKEN = + 'VnNwWTNwWEZYV2VicU1mWElaNjU2S08vZS94N3JxVVhCcUt2RU9KVy9JZ1BlWEJPczlTeU1ZNlowRVRrbVFPVGNIT09XNjJRelB3VXg0V0kyR1NGSEc3Q1VjRTNKVGJrVnk4WWMwdWJWYTBrUGJYYSs4UXpqdVkwOGVnOHI4Sk1DRW5lZDdxODFTTk14SC9UczVFTGJReWZyTmg4NHRKZVBOTFRPdzlMS2xOb29IcmZZWkhTd0FwUnBoRTY5TjJJOU1VbUdKeEhRdzRhTHFlSFpxaTByQT09'; @Component({ selector: 'proxy-root', diff --git a/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.html b/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.html index df0f8b51..5b5870de 100644 --- a/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.html +++ b/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.html @@ -315,15 +315,13 @@

Edit Profile

id="profile-mobile-readonly" type="text" [value]="displayMobile" - placeholder="Not provided" + placeholder="Enter your mobile number" readonly aria-readonly="true" - class="w-input-readonly" + (click)="startEditMobile()" + class="w-input-readonly read-only:cursor-pointer! read-only:opacity-100!" /> - } @else {

@@ -338,8 +336,7 @@

Edit Profile

autocomplete="off" class="w-input" [class.border-red-500]=" - getOtpError || - (clientForm.get('mobile')?.touched && !isProfileMobileValid()) + getOtpError || (showMobileValidation && !isProfileMobileValid()) " (keypress)="onMobileKeypress($event)" (input)="onMobileInput()" @@ -393,10 +390,7 @@

Edit Profile

@if (getOtpError) { - } @else if ( - clientForm.get('mobile')?.touched && getProfileMobileValidationError(); - as mobileError - ) { + } @else if (showMobileValidation && getProfileMobileValidationError(); as mobileError) { } @else if (clientForm.get('mobile')?.errors?.otpVerificationFailed) { diff --git a/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.ts b/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.ts index 6040a668..077f249a 100644 --- a/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.ts +++ b/apps/36-blocks-widget/src/app/otp/user-profile/user-profile.component.ts @@ -132,6 +132,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, After public isMobileOtpVerified = false; public isMobileOtpSent = false; public isNumberChanged = false; + public showMobileValidation = false; public otpError = ''; public getOtpError = ''; public resendTimer = 0; @@ -349,7 +350,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, After public get displayMobile(): string { const value = this.clientForm.get('mobile')?.value; if (!value || value === '--Not Provided--') { - return 'Not provided'; + return ''; } return value; } @@ -419,7 +420,6 @@ export class UserProfileComponent extends BaseComponent implements OnInit, After public onMobileBlur(): void { const mobileControl = this.clientForm.get('mobile'); - mobileControl?.markAsTouched(); const digits = this.getMobileIdentifier(); if (digits !== mobileControl?.value) { mobileControl?.setValue(digits, { emitEvent: false }); @@ -469,6 +469,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, After mobileControl.setErrors(null); } mobileControl.markAsTouched(); + this.showMobileValidation = true; if (!this.isProfileMobileValid()) { this.cdr.detectChanges(); return; @@ -519,6 +520,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, After this.isMobileOtpVerified = false; this.otpVerificationToken = ''; this.getOtpError = ''; + this.showMobileValidation = false; this.otpForm.reset(); const value = this.getMobileIdentifier(); if (value !== this.lastSentMobileNumber) { @@ -622,6 +624,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, After private resetMobileOtpState(): void { this.isMobileOtpVerified = false; this.isMobileOtpSent = false; + this.showMobileValidation = false; this.otpError = ''; this.getOtpError = ''; this.lastSentMobileNumber = ''; @@ -698,6 +701,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, After if (mobileChanged && enteredMobile && !this.isProfileMobileValid()) { mobileControl.markAsTouched(); + this.showMobileValidation = true; this.cdr.detectChanges(); return; }