Moving more PropertyEditors to Umbraco.Infrastructure

This commit is contained in:
elitsa
2020-01-14 16:50:22 +01:00
parent 2646a20647
commit 8655be1b28
3 changed files with 5 additions and 7 deletions

View File

@@ -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
{

View File

@@ -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
/// <remarks>
/// This is re-used by editors such as the multiple drop down list or check box list
/// </remarks>
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;
}

View File

@@ -10,7 +10,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a validator which ensures that all values in the list are unique.
/// </summary>
internal class ValueListUniqueValueValidator : IValueValidator
public class ValueListUniqueValueValidator : IValueValidator
{
public IEnumerable<ValidationResult> Validate(object value, string valueType, object dataTypeConfiguration)
{
@@ -24,7 +24,7 @@ namespace Umbraco.Web.PropertyEditors
var groupedValues = json.OfType<JObject>()
.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);