Files
Umbraco-CMS/src/Umbraco.Core/Models/ContentEditing/ContentPropertyDisplay.cs
Kenn Jacobsen a8f070d834 Datatype configuration refactor (#13605)
* Moved refactor from V12 based branch

* Remove obsolete config property to avoid obsoletion warnings

* Clean up test models

* Make the datatype API a little less confusing by introducing explicit models for create and update

* Remame "Configuration" to "Data" to make FE happy :)

* Safeguard deserialization of empty configs

* Less strict number handling for deserialization

* Prepare for data type config migrations

* Attempt to have contextual config serializers

* Update OpenAPI spec with (temporary) data type controller

* Fix unit tests

* Update compat suppressions (allow breakage for datatype and configuration editor)

* Make the duplicate JsonObjectConverter implementation private
2022-12-21 14:29:59 +01:00

47 lines
1.3 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models.ContentEditing;
/// <summary>
/// Represents a content property that is displayed in the UI
/// </summary>
[DataContract(Name = "property", Namespace = "")]
public class ContentPropertyDisplay : ContentPropertyBasic
{
public ContentPropertyDisplay()
{
Config = new Dictionary<string, object>();
Validation = new PropertyTypeValidation();
}
[DataMember(Name = "variations")]
public ContentVariation Variations { get; set; }
[DataMember(Name = "label", IsRequired = true)]
[Required]
public string? Label { get; set; }
[DataMember(Name = "description")]
public string? Description { get; set; }
[DataMember(Name = "view", IsRequired = true)]
[Required(AllowEmptyStrings = false)]
public string? View { get; set; }
[DataMember(Name = "config")]
public IDictionary<string, object>? Config { get; set; }
[DataMember(Name = "hideLabel")]
public bool HideLabel { get; set; }
[DataMember(Name = "labelOnTop")]
public bool? LabelOnTop { get; set; }
[DataMember(Name = "validation")]
public PropertyTypeValidation Validation { get; set; }
[DataMember(Name = "readonly")]
public bool Readonly { get; set; }
}