diff --git a/src/Umbraco.Tests/PropertyEditors/BlockListPropertyValueConverterTests.cs b/src/Umbraco.Tests/PropertyEditors/BlockListPropertyValueConverterTests.cs index 300c19ac1e..a8a500d5c0 100644 --- a/src/Umbraco.Tests/PropertyEditors/BlockListPropertyValueConverterTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/BlockListPropertyValueConverterTests.cs @@ -47,7 +47,7 @@ namespace Umbraco.Tests.PropertyEditors private BlockListConfiguration ConfigForMany() => new BlockListConfiguration { - ElementTypes = new[] { + Blocks = new[] { new BlockListConfiguration.ElementType { Alias = "Test1" @@ -61,7 +61,7 @@ namespace Umbraco.Tests.PropertyEditors private BlockListConfiguration ConfigForSingle() => new BlockListConfiguration { - ElementTypes = new[] { + Blocks = new[] { new BlockListConfiguration.ElementType { Alias = "Test1" @@ -111,7 +111,7 @@ namespace Umbraco.Tests.PropertyEditors var valueType = editor.GetPropertyValueType(propType); - var modelType = typeof(IEnumerable<>).MakeGenericType(ModelType.For(config.ElementTypes[0].Alias)); + var modelType = typeof(IEnumerable<>).MakeGenericType(ModelType.For(config.Blocks[0].Alias)); // we can't compare the exact match of types because ModelType.For generates a new/different type even if the same alias is used Assert.AreEqual(modelType.FullName, valueType.FullName); diff --git a/src/Umbraco.Web/PropertyEditors/BlockListConfiguration.cs b/src/Umbraco.Web/PropertyEditors/BlockListConfiguration.cs index 344604325e..6485bd061a 100644 --- a/src/Umbraco.Web/PropertyEditors/BlockListConfiguration.cs +++ b/src/Umbraco.Web/PropertyEditors/BlockListConfiguration.cs @@ -10,9 +10,8 @@ namespace Umbraco.Web.PropertyEditors public class BlockListConfiguration { - // TODO: rename this to blockDefinitions, cause its not elementTypes, its a dictionary of objects that define blocks, part of a block is the elementType used as content model. - [ConfigurationField("elementTypes", "Available Blocks", "views/propertyeditors/blocklist/prevalue/blocklist.elementtypepicker.html", Description = "Define the available blocks.")] - public ElementType[] ElementTypes { get; set; } + [ConfigurationField("blocks", "Available Blocks", "views/propertyeditors/blocklist/prevalue/blocklist.elementtypepicker.html", Description = "Define the available blocks.")] + public BlockConfiguration[] Blocks { get; set; } [ConfigurationField("validationLimit", "Amount", "numberrange", Description = "Set a required range of blocks")] @@ -27,7 +26,7 @@ namespace Umbraco.Web.PropertyEditors public int? Max { get; set; } } - public class ElementType + public class BlockConfiguration { // TODO: rename this to contentElementTypeAlias, I would like this to be specific, since we have the settings. [JsonProperty("elementTypeAlias")] diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs index 3d8e8e2b13..94d64ee29d 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs @@ -34,7 +34,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters /// public override Type GetPropertyValueType(IPublishedPropertyType propertyType) { - var contentTypes = propertyType.DataType.ConfigurationAs().ElementTypes; + var contentTypes = propertyType.DataType.ConfigurationAs().Blocks; return contentTypes.Length == 1 ? typeof(IEnumerable<>).MakeGenericType(ModelType.For(contentTypes[0].Alias)) : typeof(IEnumerable); @@ -58,7 +58,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters using (_proflog.DebugDuration($"ConvertPropertyToBlockList ({propertyType.DataType.Id})")) { var configuration = propertyType.DataType.ConfigurationAs(); - var contentTypes = configuration.ElementTypes; + var contentTypes = configuration.Blocks; var elements = (contentTypes.Length == 1 ? (IList)_publishedModelFactory.CreateModelList(contentTypes[0].Alias) : new List()) @@ -116,6 +116,6 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters } } - + } }