From 67e046e477d7cc836347b5bcf9bc845f094c9ad8 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 23 Apr 2019 16:14:26 +0200 Subject: [PATCH] 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 --- .../src/less/components/umb-nested-content.less | 3 +++ .../nestedcontent/nestedcontent.doctypepicker.html | 2 +- .../propertyeditors/nestedcontent/nestedcontent.html | 2 +- .../NestedContentManyValueConverter.cs | 12 ++++++------ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-nested-content.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-nested-content.less index e0abd3fd26..db0d96b79d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-nested-content.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-nested-content.less @@ -127,6 +127,9 @@ border-radius: 200px; text-decoration: none !important; } +.umb-nested-content__icon.umb-nested-content__icon--disabled:hover { + cursor: default; +} .umb-nested-content__icon:hover, .umb-nested-content__icon--active diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.doctypepicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.doctypepicker.html index a4cf675c8e..8701005743 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.doctypepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.doctypepicker.html @@ -34,7 +34,7 @@ - + Delete diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.html index 572021aebd..bca767f650 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.html @@ -37,7 +37,7 @@ diff --git a/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentManyValueConverter.cs b/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentManyValueConverter.cs index 93e4afc7e5..2181c4fd49 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentManyValueConverter.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueConverters/NestedContentManyValueConverter.cs @@ -35,9 +35,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters public override Type GetPropertyValueType(PublishedPropertyType propertyType) { var contentTypes = propertyType.DataType.ConfigurationAs().ContentTypes; - return contentTypes.Length > 1 - ? typeof (IEnumerable) - : typeof (IEnumerable<>).MakeGenericType(ModelType.For(contentTypes[0].Alias)); + return contentTypes.Length == 1 + ? typeof (IEnumerable<>).MakeGenericType(ModelType.For(contentTypes[0].Alias)) + : typeof (IEnumerable); } /// @@ -57,9 +57,9 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters { var configuration = propertyType.DataType.ConfigurationAs(); var contentTypes = configuration.ContentTypes; - var elements = contentTypes.Length > 1 - ? new List() - : PublishedModelFactory.CreateModelList(contentTypes[0].Alias); + var elements = contentTypes.Length == 1 + ? PublishedModelFactory.CreateModelList(contentTypes[0].Alias) + : new List(); var value = (string)inter; if (string.IsNullOrWhiteSpace(value)) return elements;