Adds name and description to webhooks (#18217)

* Model, service, test and migration updates to add name and description to webhook.

* Update typed client models.

* Fixed migration.

* Front-end rendering and update of name and description.

* Updated OpenApi.json

* Reworked integration tests to avoid breaking change.

* add name and description to editor header

* remove name and description properties

* render name as first column in the table

* remove focus from url

* remove required from name

* add parentheses to align UX

* add webhook paths

* use edit path const in collection

* add paths for root

* remove unused

* remove unused state

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
This commit is contained in:
Andy Butland
2025-02-10 09:23:22 +01:00
committed by GitHub
parent 25a3788255
commit f14922baae
26 changed files with 343 additions and 55 deletions

View File

@@ -1,9 +1,22 @@
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models;
public interface IWebhook : IEntity
{
// TODO (V16): Remove the default implementations from this interface.
string? Name
{
get { return null; }
set { }
}
string? Description
{
get { return null; }
set { }
}
string Url { get; set; }
string[] Events { get; set; }

View File

@@ -1,4 +1,4 @@
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Cms.Core.Models.Entities;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.Models;
@@ -24,6 +24,8 @@ public class Webhook : EntityBase, IWebhook
(enumerable, translations) => enumerable.UnsortedSequenceEqual(translations),
enumerable => enumerable.GetHashCode());
private string? _name;
private string? _description;
private string _url;
private string[] _events;
private Guid[] _contentTypeKeys;
@@ -39,6 +41,18 @@ public class Webhook : EntityBase, IWebhook
_enabled = enabled ?? false;
}
public string? Name
{
get => _name;
set => SetPropertyValueAndDetectChanges(value, ref _name!, nameof(Name));
}
public string? Description
{
get => _description;
set => SetPropertyValueAndDetectChanges(value, ref _description!, nameof(Description));
}
public string Url
{
get => _url;