Enhancement: allow specifying JSON encoding for webhooks (#8799)

This commit is contained in:
shamoon
2025-01-18 12:19:50 -08:00
committed by GitHub
parent cd50f20a20
commit ed1775e689
9 changed files with 99 additions and 8 deletions

View File

@@ -338,7 +338,10 @@
<input type="hidden" formControlName="id" />
<div class="col">
<pngx-input-text i18n-title title="Webhook url" formControlName="url" [error]="error?.actions?.[i]?.url"></pngx-input-text>
<pngx-input-switch i18n-title title="Use parameters for webhook body" formControlName="use_params"></pngx-input-switch>
<div class="d-flex">
<pngx-input-switch i18n-title title="Use parameters for webhook body" formControlName="use_params" [horizontal]="true"></pngx-input-switch>
<pngx-input-switch i18n-title title="Send webhook payload as JSON" formControlName="as_json" [horizontal]="true" class="ms-5"></pngx-input-switch>
</div>
@if (formGroup.get('webhook').value['use_params']) {
<pngx-input-entries i18n-title title="Webhook params" formControlName="params" [error]="error?.actions?.[i]?.params"></pngx-input-entries>
} @else {

View File

@@ -471,6 +471,7 @@ export class WorkflowEditDialogComponent
id: new FormControl(action.webhook?.id),
url: new FormControl(action.webhook?.url),
use_params: new FormControl(action.webhook?.use_params),
as_json: new FormControl(action.webhook?.as_json),
params: new FormControl(action.webhook?.params),
body: new FormControl(action.webhook?.body),
headers: new FormControl(action.webhook?.headers),
@@ -588,6 +589,7 @@ export class WorkflowEditDialogComponent
id: null,
url: null,
use_params: true,
as_json: false,
params: null,
body: null,
headers: null,

View File

@@ -22,6 +22,8 @@ export interface WorkflowActionWebhook extends ObjectWithId {
use_params?: boolean
as_json?: boolean
params?: object
body?: string