From 8655be1b283b40feeaf9989d8b5cfe181bc7ad27 Mon Sep 17 00:00:00 2001 From: elitsa Date: Tue, 14 Jan 2020 16:50:22 +0100 Subject: [PATCH] Moving more PropertyEditors to Umbraco.Infrastructure --- .../PropertyEditors/GridConfigurationEditor.cs | 1 - .../PropertyEditors/MultipleValueEditor.cs | 7 +++---- .../PropertyEditors/ValueListUniqueValueValidator.cs | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) rename src/{Umbraco.Web => Umbraco.Infrastructure}/PropertyEditors/GridConfigurationEditor.cs (97%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/PropertyEditors/MultipleValueEditor.cs (85%) rename src/{Umbraco.Web => Umbraco.Infrastructure}/PropertyEditors/ValueListUniqueValueValidator.cs (94%) diff --git a/src/Umbraco.Web/PropertyEditors/GridConfigurationEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/GridConfigurationEditor.cs similarity index 97% rename from src/Umbraco.Web/PropertyEditors/GridConfigurationEditor.cs rename to src/Umbraco.Infrastructure/PropertyEditors/GridConfigurationEditor.cs index 8a275b69cd..f9ff1ad0c4 100644 --- a/src/Umbraco.Web/PropertyEditors/GridConfigurationEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/GridConfigurationEditor.cs @@ -4,7 +4,6 @@ using System.Linq; using Newtonsoft.Json; using Umbraco.Core.IO; using Umbraco.Core.PropertyEditors; -using Umbraco.Core.PropertyEditors.Validators; namespace Umbraco.Web.PropertyEditors { diff --git a/src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MultipleValueEditor.cs similarity index 85% rename from src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs rename to src/Umbraco.Infrastructure/PropertyEditors/MultipleValueEditor.cs index 392b4e890a..40525bff79 100644 --- a/src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/MultipleValueEditor.cs @@ -2,7 +2,6 @@ using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; @@ -17,12 +16,12 @@ namespace Umbraco.Web.PropertyEditors /// /// This is re-used by editors such as the multiple drop down list or check box list /// - internal class MultipleValueEditor : DataValueEditor + public class MultipleValueEditor : DataValueEditor { private readonly ILogger _logger; - internal MultipleValueEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute) - : base(dataTypeService, localizationService, localizedTextService,shortStringHelper, attribute) + public MultipleValueEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute) + : base(dataTypeService, localizationService, localizedTextService, shortStringHelper, attribute) { _logger = logger; } diff --git a/src/Umbraco.Web/PropertyEditors/ValueListUniqueValueValidator.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueListUniqueValueValidator.cs similarity index 94% rename from src/Umbraco.Web/PropertyEditors/ValueListUniqueValueValidator.cs rename to src/Umbraco.Infrastructure/PropertyEditors/ValueListUniqueValueValidator.cs index 38dc6fb3ae..c4f105fd02 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueListUniqueValueValidator.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueListUniqueValueValidator.cs @@ -10,7 +10,7 @@ namespace Umbraco.Web.PropertyEditors /// /// Represents a validator which ensures that all values in the list are unique. /// - internal class ValueListUniqueValueValidator : IValueValidator + public class ValueListUniqueValueValidator : IValueValidator { public IEnumerable Validate(object value, string valueType, object dataTypeConfiguration) { @@ -24,7 +24,7 @@ namespace Umbraco.Web.PropertyEditors var groupedValues = json.OfType() .Where(x => x["value"] != null) - .Select((x, index) => new { value = x["value"].ToString(), index}) + .Select((x, index) => new { value = x["value"].ToString(), index }) .Where(x => x.value.IsNullOrWhiteSpace() == false) .GroupBy(x => x.value);