Skip to content

Commit 4750101

Browse files
Added 'mandatory' tag as a visual indicator for webhook events being … (#21075)
* Added 'mandatory' tag as a visual indicator for webhook events being mandatory. * Map the webhook validation for no events specified to a specific API response problem details message. --------- Co-authored-by: Andy Butland <[email protected]>
1 parent 830250b commit 4750101

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Umbraco.Cms.Api.Management/Controllers/Webhook/WebhookControllerBase.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ protected IActionResult WebhookOperationStatusResult(WebhookOperationStatus stat
2121
.WithTitle("Cancelled by notification")
2222
.WithDetail("A notification handler prevented the webhook operation.")
2323
.Build()),
24+
WebhookOperationStatus.NoEvents => BadRequest(new ProblemDetailsBuilder()
25+
.WithTitle("No events specified")
26+
.WithDetail("The webhook must be configured to listen to at least one event.")
27+
.Build()),
2428
_ => StatusCode(StatusCodes.Status500InternalServerError, new ProblemDetailsBuilder()
2529
.WithTitle("Unknown webhook operation status.")
2630
.Build()),

src/Umbraco.Web.UI.Client/src/packages/webhook/webhook/workspace/views/webhook-details-workspace-view.element.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,13 @@ export class UmbWebhookDetailsWorkspaceViewElement extends UmbLitElement impleme
107107
mandatory
108108
label=${this.localize.term('webhooks_url')}
109109
description=${this.localize.term('webhooks_urlDescription')}>
110-
<uui-input @input=${this.#onUrlChange} .value=${this._webhook.url} slot="editor" required="true"></uui-input>
110+
<uui-input
111+
@input=${this.#onUrlChange}
112+
.value=${this._webhook.url}
113+
slot="editor" required="true"></uui-input>
111114
</umb-property-layout>
112115
<umb-property-layout
116+
mandatory
113117
label=${this.localize.term('webhooks_events')}
114118
description=${this.localize.term('webhooks_eventDescription')}>
115119
<umb-input-webhook-events

0 commit comments

Comments
 (0)