Skip to content
Snippets Groups Projects
Commit 900bf204 authored by Lukasz Lopatowski's avatar Lukasz Lopatowski
Browse files

Merge branch 'webhooks-update' into 'develop'

Webhooks update

See merge request !196
parents b832c0b6 456aa364
No related branches found
No related tags found
1 merge request!196Webhooks update
......@@ -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>
......
......@@ -69,4 +69,13 @@ export class WebhookDetailsComponent extends BaseComponent implements OnInit {
this.webhook.authorizationHeader = this.authorizationHeader;
}
}
public isFormValid(): boolean {
if(this.authRequired) {
return this.webhook.tokenValue !== null && this.webhook.tokenValue !== "" &&
this.webhook.authorizationHeader !== null && this.webhook.authorizationHeader !== "";
} else {
return true;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment