From 3da120ce33d325912c7db9c81d73566667d1868f Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 17 May 2018 13:32:20 +0200 Subject: [PATCH] Adds Property Type to the published content model, fixes some web.config versions --- .../PublishedContent/IPublishedProperty.cs | 2 + .../PublishedContent/PublishedPropertyType.cs | 4 +- .../SolidPublishedSnapshot.cs | 1 + .../Umbraco/Views/Preview/web.config | 4 +- src/Umbraco.Web.UI/Views/Web.config | 98 +++++++++---------- .../umbraco/Install/Views/Web.config | 10 +- src/Umbraco.Web.UI/web.Template.Debug.config | 4 +- src/Umbraco.Web.UI/web.Template.config | 4 +- src/Umbraco.Web/HtmlHelperRenderExtensions.cs | 66 ------------- 9 files changed, 66 insertions(+), 127 deletions(-) diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs index 9d2cca3e6d..cfab82213a 100644 --- a/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs +++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedProperty.cs @@ -5,6 +5,8 @@ /// public interface IPublishedProperty { + PublishedPropertyType PropertyType { get; } + /// /// Gets the alias of the property. /// diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs index 507e6f7843..bf1d940dbe 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs @@ -11,7 +11,9 @@ namespace Umbraco.Core.Models.PublishedContent /// Instances of the class are immutable, ie /// if the property type changes, then a new class needs to be created. public class PublishedPropertyType - { + { + //fixme - API design review, should this be an interface? + private readonly IPublishedModelFactory _publishedModelFactory; private readonly PropertyValueConverterCollection _propertyValueConverters; private readonly object _locker = new object(); diff --git a/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs b/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs index c5b27554c9..4f63533693 100644 --- a/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs +++ b/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs @@ -250,6 +250,7 @@ namespace Umbraco.Tests.PublishedContent class SolidPublishedProperty : IPublishedProperty { + public PublishedPropertyType PropertyType { get; set; } public string Alias { get; set; } public object SolidSourceValue { get; set; } public object SolidValue { get; set; } diff --git a/src/Umbraco.Web.UI/Umbraco/Views/Preview/web.config b/src/Umbraco.Web.UI/Umbraco/Views/Preview/web.config index 5ab8bbc7d6..339972c139 100644 --- a/src/Umbraco.Web.UI/Umbraco/Views/Preview/web.config +++ b/src/Umbraco.Web.UI/Umbraco/Views/Preview/web.config @@ -9,7 +9,7 @@ - + @@ -34,7 +34,7 @@ - + diff --git a/src/Umbraco.Web.UI/Views/Web.config b/src/Umbraco.Web.UI/Views/Web.config index 9a97ba5be2..9c0bd5b5df 100644 --- a/src/Umbraco.Web.UI/Views/Web.config +++ b/src/Umbraco.Web.UI/Views/Web.config @@ -1,65 +1,65 @@ - - -
-
- - + + +
+
+ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + - - - - + + + + - - - - - - - + + + + + + - - + + - - - - - + + + + + diff --git a/src/Umbraco.Web.UI/umbraco/Install/Views/Web.config b/src/Umbraco.Web.UI/umbraco/Install/Views/Web.config index d7f2ec9848..a14bad0760 100644 --- a/src/Umbraco.Web.UI/umbraco/Install/Views/Web.config +++ b/src/Umbraco.Web.UI/umbraco/Install/Views/Web.config @@ -9,7 +9,7 @@ - + @@ -38,11 +38,11 @@ --> + pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" + pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" + userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.6.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> - + diff --git a/src/Umbraco.Web.UI/web.Template.Debug.config b/src/Umbraco.Web.UI/web.Template.Debug.config index 510b4f17db..9bda916f26 100644 --- a/src/Umbraco.Web.UI/web.Template.Debug.config +++ b/src/Umbraco.Web.UI/web.Template.Debug.config @@ -356,7 +356,7 @@ - + @@ -368,7 +368,7 @@ - + diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index b20e6646a1..7eedec3ec0 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -95,7 +95,7 @@ - + @@ -124,7 +124,7 @@ - + diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs index 1ebfcb2841..6b3581aeab 100644 --- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs @@ -195,72 +195,6 @@ namespace Umbraco.Web return htmlHelper.Action(actionName, metaData.ControllerName, routeVals); } - #region GetCropUrl - - [Obsolete("Use the UrlHelper.GetCropUrl extension instead")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static IHtmlString GetCropUrl(this HtmlHelper htmlHelper, IPublishedContent mediaItem, string cropAlias) - { - return new HtmlString(mediaItem.GetCropUrl(cropAlias: cropAlias, useCropDimensions: true)); - } - - [Obsolete("Use the UrlHelper.GetCropUrl extension instead")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static IHtmlString GetCropUrl(this HtmlHelper htmlHelper, IPublishedContent mediaItem, string propertyAlias, string cropAlias) - { - return new HtmlString(mediaItem.GetCropUrl(propertyAlias: propertyAlias, cropAlias: cropAlias, useCropDimensions: true)); - } - - [Obsolete("Use the UrlHelper.GetCropUrl extension instead")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static IHtmlString GetCropUrl(this HtmlHelper htmlHelper, - IPublishedContent mediaItem, - int? width = null, - int? height = null, - string propertyAlias = Constants.Conventions.Media.File, - string cropAlias = null, - int? quality = null, - ImageCropMode? imageCropMode = null, - ImageCropAnchor? imageCropAnchor = null, - bool preferFocalPoint = false, - bool useCropDimensions = false, - bool cacheBuster = true, - string furtherOptions = null, - ImageCropRatioMode? ratioMode = null, - bool upScale = true) - { - return - new HtmlString(mediaItem.GetCropUrl(width, height, propertyAlias, cropAlias, quality, imageCropMode, - imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBuster, furtherOptions, ratioMode, - upScale)); - } - - [Obsolete("Use the UrlHelper.GetCropUrl extension instead")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static IHtmlString GetCropUrl(this HtmlHelper htmlHelper, - string imageUrl, - int? width = null, - int? height = null, - string imageCropperValue = null, - string cropAlias = null, - int? quality = null, - ImageCropMode? imageCropMode = null, - ImageCropAnchor? imageCropAnchor = null, - bool preferFocalPoint = false, - bool useCropDimensions = false, - string cacheBusterValue = null, - string furtherOptions = null, - ImageCropRatioMode? ratioMode = null, - bool upScale = true) - { - return - new HtmlString(imageUrl.GetCropUrl(width, height, imageCropperValue, cropAlias, quality, imageCropMode, - imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode, - upScale)); - } - - #endregion - #region BeginUmbracoForm ///