V8: Allow nested content without blueprints (#4777)

* Don't assume there is at least one NC blueprint
* NC disabled icon styling (hover pointer type)
* Allow and handle NC configs without blueprints
This commit is contained in:
Kenn Jacobsen
2019-04-23 16:14:26 +02:00
committed by Niels Lyngsø
parent aba409600b
commit 67e046e477
4 changed files with 11 additions and 8 deletions

View File

@@ -35,9 +35,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
public override Type GetPropertyValueType(PublishedPropertyType propertyType)
{
var contentTypes = propertyType.DataType.ConfigurationAs<NestedContentConfiguration>().ContentTypes;
return contentTypes.Length > 1
? typeof (IEnumerable<IPublishedElement>)
: typeof (IEnumerable<>).MakeGenericType(ModelType.For(contentTypes[0].Alias));
return contentTypes.Length == 1
? typeof (IEnumerable<>).MakeGenericType(ModelType.For(contentTypes[0].Alias))
: typeof (IEnumerable<IPublishedElement>);
}
/// <inheritdoc />
@@ -57,9 +57,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
{
var configuration = propertyType.DataType.ConfigurationAs<NestedContentConfiguration>();
var contentTypes = configuration.ContentTypes;
var elements = contentTypes.Length > 1
? new List<IPublishedElement>()
: PublishedModelFactory.CreateModelList(contentTypes[0].Alias);
var elements = contentTypes.Length == 1
? PublishedModelFactory.CreateModelList(contentTypes[0].Alias)
: new List<IPublishedElement>();
var value = (string)inter;
if (string.IsNullOrWhiteSpace(value)) return elements;