Fix health check webhook event registration

This commit is contained in:
Ronald Barendse
2023-12-04 14:11:42 +01:00
parent 80dcc04df0
commit 8a65c00279
3 changed files with 18 additions and 15 deletions

View File

@@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;
namespace Umbraco.Cms.Core.Webhooks.Events.HealthCheck;
namespace Umbraco.Cms.Core.Webhooks.Events;
[WebhookEvent("Health Check Completed")]
public class HealthCheckCompletedWebhookEvent : WebhookEventBase<HealthCheckCompletedNotification>

View File

@@ -1,6 +1,5 @@
using Umbraco.Cms.Core.Webhooks;
using Umbraco.Cms.Core.Webhooks.Events;
using Umbraco.Cms.Core.Webhooks.Events.HealthCheck;
using static Umbraco.Cms.Core.DependencyInjection.WebhookEventCollectionBuilderExtensions;
namespace Umbraco.Cms.Core.DependencyInjection;
@@ -180,6 +179,21 @@ public static class WebhookEventCollectionBuilderCmsExtensions
return builder;
}
/// <summary>
/// Adds the health check webhook events.
/// </summary>
/// <param name="builder">The builder.</param>
/// <returns>
/// The builder.
/// </returns>
public static WebhookEventCollectionBuilderCms AddHealthCheck(this WebhookEventCollectionBuilderCms builder)
{
builder.Builder
.Append<HealthCheckCompletedWebhookEvent>();
return builder;
}
/// <summary>
/// Adds the language webhook events.
/// </summary>
@@ -314,17 +328,6 @@ public static class WebhookEventCollectionBuilderCmsExtensions
return builder;
}
/// <summary>
/// Adds the healthcheck webhook events.
/// </summary>
/// <param name="builder">The builder.</param>
/// <returns>
/// The builder.
/// </returns>
public static WebhookEventCollectionBuilder AddHealthCheck(this WebhookEventCollectionBuilder builder)
=> builder
.Append<HealthCheckCompletedWebhookEvent>();
/// <summary>
/// Adds all available user (including password, login and user group) webhook events.
/// </summary>

View File

@@ -31,6 +31,7 @@ public static class WebhookEventCollectionBuilderExtensions
.AddDictionary()
.AddDomain()
.AddFile()
.AddHealthCheck()
.AddLanguage()
.AddMedia()
.AddMember()
@@ -38,8 +39,7 @@ public static class WebhookEventCollectionBuilderExtensions
.AddPublicAccess()
.AddRelation()
.AddRelationType()
.AddUser()
.AddHealthCheck();
.AddUser();
}
});