Moving more PropertyEditors to Umbraco.Infrastructure
This commit is contained in:
@@ -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
|
||||
{
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user