From b393ed8a4099fad19e11457d15b7ef4859a83cee Mon Sep 17 00:00:00 2001 From: shezamishal19 Date: Sat, 10 Aug 2024 20:20:23 +0530 Subject: [PATCH 1/2] new file --- random.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 random.txt diff --git a/random.txt b/random.txt new file mode 100644 index 00000000000..7fec8e25e5a --- /dev/null +++ b/random.txt @@ -0,0 +1 @@ +hello siri \ No newline at end of file From 360e37569de0789cfbcaf565a5556e17ef4e7f88 Mon Sep 17 00:00:00 2001 From: shezamishal19 Date: Sat, 10 Aug 2024 23:48:37 +0530 Subject: [PATCH 2/2] added a Custom noEhitespaceValidator --- build.gradle | 2 +- .../session-links-recovery-page.component.ts | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index c31de8ad72d..983487e92ae 100644 --- a/build.gradle +++ b/build.gradle @@ -743,4 +743,4 @@ task jacocoReport(type: JacocoReport) { fileTree(dir: it, exclude: ["**/*.jar"]) }) } -} +} \ No newline at end of file diff --git a/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts b/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts index 4feb3ec3cce..a5945e6e0d8 100644 --- a/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts +++ b/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { ReCaptcha2Component } from 'ngx-captcha'; import { finalize } from 'rxjs/operators'; import { environment } from '../../../environments/environment'; @@ -41,9 +41,21 @@ export class SessionLinksRecoveryPageComponent implements OnInit { }); } + /** + * Custom validator to disallow whitespace-only values. + */ + noWhitespaceValidator(control: AbstractControl): { [key: string]: boolean } | null { + if (control.value && control.value.trim().length === 0) { + return { 'whitespace': true }; + } + return null; + } + /** * Sends the feedback session links to the recovery email address. */ + + onSubmitFormSessionLinksRecovery(sessionLinksRecoveryForm: UntypedFormGroup): void { if (!this.captchaSiteKey) { this.captchaResponse = '';