File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed
features/login/pages/email-signup Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 77 < ion-item *ngIf ="model[modelValueName] ">
88 < ion-label color ="success "> {{ 'core.answered' | translate }}</ ion-label >
99 </ ion-item >
10- < ion-item *ngIf ="expired " class ="ion-text-wrap ">
10+ < ion-item *ngIf ="expired " class ="ion-text-wrap core-input-error ">
1111 < ion-label color ="danger "> {{ 'core.login.recaptchaexpired' | translate }}</ ion-label >
1212 </ ion-item >
13+ < ion-item *ngIf ="showRequiredError && !model[modelValueName] && !expired " class ="ion-text-wrap core-input-error ">
14+ < ion-label color ="danger "> {{ 'core.required' | translate }}</ ion-label >
15+ </ ion-item >
1316</ div >
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class CoreRecaptchaComponent implements OnInit {
3232 @Input ( ) publicKey ?: string ; // The site public key.
3333 @Input ( ) modelValueName = 'recaptcharesponse' ; // Name of the model property where to store the response.
3434 @Input ( ) siteUrl = '' ; // The site URL. If not defined, current site.
35+ @Input ( ) showRequiredError = false ; // Whether to display the required error if recaptcha hasn't been answered.
3536
3637 expired = false ;
3738
Original file line number Diff line number Diff line change @@ -186,7 +186,8 @@ <h2>{{ 'core.login.supplyinfo' | translate }}</h2>
186186 < h2 > < span [core-mark-required] ="true "> {{ 'core.login.security_question' | translate }}</ span > </ h2 >
187187 </ ion-label >
188188 </ ion-item-divider >
189- < core-recaptcha [publicKey] ="settings.recaptchapublickey " [model] ="captcha " [siteUrl] ="siteUrl "> </ core-recaptcha >
189+ < core-recaptcha [publicKey] ="settings.recaptchapublickey " [model] ="captcha " [siteUrl] ="siteUrl "
190+ [showRequiredError] ="formSubmitClicked "> </ core-recaptcha >
190191 </ ng-container >
191192
192193 <!-- Site policy (if any). -->
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export class CoreLoginEmailSignupPage implements OnInit {
6060 settingsLoaded = false ;
6161 allRequiredSupported = true ;
6262 signupUrl ?: string ;
63+ formSubmitClicked = false ;
6364 captcha = {
6465 recaptcharesponse : '' ,
6566 } ;
@@ -265,6 +266,8 @@ export class CoreLoginEmailSignupPage implements OnInit {
265266 e . preventDefault ( ) ;
266267 e . stopPropagation ( ) ;
267268
269+ this . formSubmitClicked = true ;
270+
268271 if ( ! this . signupForm . valid || ( this . settings ?. recaptchapublickey && ! this . captcha . recaptcharesponse ) ) {
269272 // Form not valid. Mark all controls as dirty to display errors.
270273 for ( const name in this . signupForm . controls ) {
You can’t perform that action at this time.
0 commit comments