From c64ab643c94e9190e9d195d166279c7a1570b7d6 Mon Sep 17 00:00:00 2001
From: kbeyro <121854496+kbeyro@users.noreply.github.com>
Date: Wed, 28 May 2025 13:38:18 +0200
Subject: [PATCH 1/2] add check if value is preseng

---
 .../webhook-details/webhook-details.component.html     |  6 +++---
 .../webhook-details/webhook-details.component.ts       | 10 ++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.html b/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.html
index 371001ac..d8860c3d 100644
--- a/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.html
+++ b/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.html
@@ -58,7 +58,7 @@
                     <div class="col-sm-10">
                         <div class="col-sm-10">
                             <input type="text" class="form-control" id="token" name="token" [ngModelOptions]="{standalone: true}"
-                                   [(ngModel)]="webhook.tokenValue" [disabled]="false" >
+                                   [(ngModel)]="webhook.tokenValue" [disabled]="false" [required]="authRequired" >
                         </div>
                     </div>
                 </div>
@@ -69,13 +69,13 @@
                     <div class="col-sm-10">
                         <div class="col-sm-10">
                             <input type="text" class="form-control" id="auth" name="auth" [ngModelOptions]="{standalone: true}"
-                                   [(ngModel)]="webhook.authorizationHeader" [disabled]="false">
+                                   [(ngModel)]="webhook.authorizationHeader" [disabled]="false" [required]="authRequired">
                         </div>
                     </div>
                 </div>
 
             <div class="flex justify-content-end">
-                <button [disabled]="!webhookForm.form.valid" type="submit" class="btn btn-primary"
+                <button [disabled]="!webhookForm.form.valid || !isFormValid()" type="submit" class="btn btn-primary"
                         type="submit">{{ 'PORTAL_CONFIGURATION.SUBMIT_BUTTON' | translate }}</button>
             </div>
                
diff --git a/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts b/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts
index 6cf5451c..0ddd3066 100644
--- a/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts
+++ b/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts
@@ -69,4 +69,14 @@ export class WebhookDetailsComponent extends BaseComponent implements OnInit {
         this.webhook.authorizationHeader = this.authorizationHeader; 
       }
     }
+
+    public isFormValid(): boolean {
+      if(this.authRequired) {
+               this.webhook.authorizationHeader !== null && this.webhook.authorizationHeader !== "")
+        return this.webhook.tokenValue !== null && this.webhook.tokenValue !== "" &&
+               this.webhook.authorizationHeader !== null && this.webhook.authorizationHeader !== "";
+      } else {
+        return true;
+      } 
+    }
 }
-- 
GitLab


From 456aa36404a57b085314146c1f9bfbf2bb804453 Mon Sep 17 00:00:00 2001
From: kbeyro <121854496+kbeyro@users.noreply.github.com>
Date: Wed, 28 May 2025 13:38:43 +0200
Subject: [PATCH 2/2] smallfix

---
 .../admin/webhook/webhook-details/webhook-details.component.ts   | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts b/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts
index 0ddd3066..5d4d504f 100644
--- a/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts
+++ b/src/app/appmarket/admin/webhook/webhook-details/webhook-details.component.ts
@@ -72,7 +72,6 @@ export class WebhookDetailsComponent extends BaseComponent implements OnInit {
 
     public isFormValid(): boolean {
       if(this.authRequired) {
-               this.webhook.authorizationHeader !== null && this.webhook.authorizationHeader !== "")
         return this.webhook.tokenValue !== null && this.webhook.tokenValue !== "" &&
                this.webhook.authorizationHeader !== null && this.webhook.authorizationHeader !== "";
       } else {
-- 
GitLab