diff --git a/src/Umbraco.Abstractions/Composing/Current.cs b/src/Umbraco.Abstractions/Composing/Current.cs
new file mode 100644
index 0000000000..63da21fe88
--- /dev/null
+++ b/src/Umbraco.Abstractions/Composing/Current.cs
@@ -0,0 +1,10 @@
+using Umbraco.Core.Logging;
+
+namespace Umbraco.Composing
+{
+ public static class Current
+ {
+
+ public static ILogger Logger { get; set; }
+ }
+}
diff --git a/src/Umbraco.Abstractions/StringExtensions.cs b/src/Umbraco.Abstractions/StringExtensions.cs
index 37a6ae4258..f41091a058 100644
--- a/src/Umbraco.Abstractions/StringExtensions.cs
+++ b/src/Umbraco.Abstractions/StringExtensions.cs
@@ -9,6 +9,7 @@ using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using Umbraco.Core.IO;
+using Umbraco.Core.Strings;
namespace Umbraco.Core
{
@@ -1289,5 +1290,41 @@ namespace Umbraco.Core
return Attempt.Fail(input);
}
+
+ // FORMAT STRINGS
+
+ ///
+ /// Cleans a string to produce a string that can safely be used in an alias.
+ ///
+ /// The text to filter.
+ /// The safe alias.
+ public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper)
+ {
+ return shortStringHelper.CleanStringForSafeAlias(alias);
+ }
+
+ ///
+ /// Cleans a string to produce a string that can safely be used in an alias.
+ ///
+ /// The text to filter.
+ /// A value indicating that we want to camel-case the alias.
+ /// The safe alias.
+ public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper, bool camel)
+ {
+ var a = shortStringHelper.CleanStringForSafeAlias(alias);
+ if (string.IsNullOrWhiteSpace(a) || camel == false) return a;
+ return char.ToLowerInvariant(a[0]) + a.Substring(1);
+ }
+
+ ///
+ /// Cleans a string, in the context of a specified culture, to produce a string that can safely be used in an alias.
+ ///
+ /// The text to filter.
+ /// The culture.
+ /// The safe alias.
+ public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper, string culture)
+ {
+ return shortStringHelper.CleanStringForSafeAlias(alias, culture);
+ }
}
}
diff --git a/src/Umbraco.Core/Manifest/DataEditorConverter.cs b/src/Umbraco.Core/Manifest/DataEditorConverter.cs
index 5c0948fa5f..c422294e9f 100644
--- a/src/Umbraco.Core/Manifest/DataEditorConverter.cs
+++ b/src/Umbraco.Core/Manifest/DataEditorConverter.cs
@@ -7,6 +7,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Serialization;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Core.Manifest
{
@@ -20,17 +21,19 @@ namespace Umbraco.Core.Manifest
private readonly IDataTypeService _dataTypeService;
private readonly ILocalizationService _localizationService;
private readonly ILocalizedTextService _textService;
+ private readonly IShortStringHelper _shortStringHelper;
///
/// Initializes a new instance of the class.
///
- public DataEditorConverter(ILogger logger, IIOHelper ioHelper, IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService textService)
+ public DataEditorConverter(ILogger logger, IIOHelper ioHelper, IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService textService, IShortStringHelper shortStringHelper)
{
_logger = logger;
_ioHelper = ioHelper;
_dataTypeService = dataTypeService;
_localizationService = localizationService;
_textService = textService;
+ _shortStringHelper = shortStringHelper;
}
///
@@ -58,7 +61,7 @@ namespace Umbraco.Core.Manifest
type = EditorType.MacroParameter;
}
- return new DataEditor(_logger, type);
+ return new DataEditor(_logger, _dataTypeService, _localizationService, _shortStringHelper, type);
}
///
@@ -85,7 +88,7 @@ namespace Umbraco.Core.Manifest
// explicitly assign a value editor of type ValueEditor
// (else the deserializer will try to read it before setting it)
// (and besides it's an interface)
- target.ExplicitValueEditor = new DataValueEditor(_dataTypeService, _localizationService, _textService);
+ target.ExplicitValueEditor = new DataValueEditor(_dataTypeService, _localizationService, _textService, _shortStringHelper);
// in the manifest, validators are a simple dictionary eg
// {
@@ -157,7 +160,7 @@ namespace Umbraco.Core.Manifest
if (jobject.Property("view") != null)
{
// explicitly assign a value editor of type ParameterValueEditor
- target.ExplicitValueEditor = new DataValueEditor(_dataTypeService, _localizationService, _textService);
+ target.ExplicitValueEditor = new DataValueEditor(_dataTypeService, _localizationService, _textService, _shortStringHelper);
// move the 'view' property
jobject["editor"] = new JObject { ["view"] = jobject["view"] };
diff --git a/src/Umbraco.Core/Manifest/ManifestParser.cs b/src/Umbraco.Core/Manifest/ManifestParser.cs
index fe76af7428..2074409ec8 100644
--- a/src/Umbraco.Core/Manifest/ManifestParser.cs
+++ b/src/Umbraco.Core/Manifest/ManifestParser.cs
@@ -10,6 +10,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Serialization;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Core.Manifest
{
@@ -20,6 +21,7 @@ namespace Umbraco.Core.Manifest
{
private readonly IJsonSerializer _jsonSerializer;
private readonly ILocalizedTextService _localizedTextService;
+ private readonly IShortStringHelper _shortStringHelper;
private static readonly string Utf8Preamble = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
private readonly IAppPolicyCache _cache;
@@ -35,11 +37,22 @@ namespace Umbraco.Core.Manifest
///
/// Initializes a new instance of the class.
///
- public ManifestParser(AppCaches appCaches, ManifestValueValidatorCollection validators, ManifestFilterCollection filters, ILogger logger, IIOHelper ioHelper, IDataTypeService dataTypeService, ILocalizationService localizationService, IJsonSerializer jsonSerializer, ILocalizedTextService localizedTextService)
+ public ManifestParser(
+ AppCaches appCaches,
+ ManifestValueValidatorCollection validators,
+ ManifestFilterCollection filters,
+ ILogger logger,
+ IIOHelper ioHelper,
+ IDataTypeService dataTypeService,
+ ILocalizationService localizationService,
+ IJsonSerializer jsonSerializer,
+ ILocalizedTextService localizedTextService,
+ IShortStringHelper shortStringHelper)
: this(appCaches, validators, filters, "~/App_Plugins", logger, ioHelper, dataTypeService, localizationService)
{
_jsonSerializer = jsonSerializer;
_localizedTextService = localizedTextService;
+ _shortStringHelper = shortStringHelper;
}
///
@@ -176,7 +189,7 @@ namespace Umbraco.Core.Manifest
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(text));
var manifest = JsonConvert.DeserializeObject(text,
- new DataEditorConverter(_logger, _ioHelper, _dataTypeService, _localizationService, _localizedTextService),
+ new DataEditorConverter(_logger, _ioHelper, _dataTypeService, _localizationService, _localizedTextService, _shortStringHelper),
new ValueValidatorConverter(_validators),
new DashboardAccessRuleConverter());
diff --git a/src/Umbraco.Core/Packaging/PackageDataInstallation.cs b/src/Umbraco.Core/Packaging/PackageDataInstallation.cs
index 2d031be7f1..10e14ebfe9 100644
--- a/src/Umbraco.Core/Packaging/PackageDataInstallation.cs
+++ b/src/Umbraco.Core/Packaging/PackageDataInstallation.cs
@@ -14,6 +14,7 @@ using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
+using Umbraco.Core.Strings;
namespace Umbraco.Core.Packaging
{
@@ -26,13 +27,14 @@ namespace Umbraco.Core.Packaging
private readonly IDataTypeService _dataTypeService;
private readonly PropertyEditorCollection _propertyEditors;
private readonly IScopeProvider _scopeProvider;
+ private readonly IShortStringHelper _shortStringHelper;
private readonly IEntityService _entityService;
private readonly IContentTypeService _contentTypeService;
private readonly IContentService _contentService;
public PackageDataInstallation(ILogger logger, IFileService fileService, IMacroService macroService, ILocalizationService localizationService,
IDataTypeService dataTypeService, IEntityService entityService, IContentTypeService contentTypeService,
- IContentService contentService, PropertyEditorCollection propertyEditors, IScopeProvider scopeProvider)
+ IContentService contentService, PropertyEditorCollection propertyEditors, IScopeProvider scopeProvider, IShortStringHelper shortStringHelper)
{
_logger = logger;
_fileService = fileService;
@@ -41,6 +43,7 @@ namespace Umbraco.Core.Packaging
_dataTypeService = dataTypeService;
_propertyEditors = propertyEditors;
_scopeProvider = scopeProvider;
+ _shortStringHelper = shortStringHelper;
_entityService = entityService;
_contentTypeService = contentTypeService;
_contentService = contentService;
@@ -893,7 +896,7 @@ namespace Umbraco.Core.Packaging
var editorAlias = dataTypeElement.Attribute("Id")?.Value?.Trim();
if (!_propertyEditors.TryGet(editorAlias, out var editor))
- editor = new VoidEditor(_logger) { Alias = editorAlias };
+ editor = new VoidEditor(_logger, _dataTypeService, _localizationService, _shortStringHelper) { Alias = editorAlias };
var dataType = new DataType(editor)
{
diff --git a/src/Umbraco.Core/Persistence/Factories/DataTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/DataTypeFactory.cs
index 43ecdbd03f..89e757ace7 100644
--- a/src/Umbraco.Core/Persistence/Factories/DataTypeFactory.cs
+++ b/src/Umbraco.Core/Persistence/Factories/DataTypeFactory.cs
@@ -2,11 +2,13 @@
using System.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
+using Umbraco.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence.Dtos;
using Umbraco.Core.PropertyEditors;
+using Current = Umbraco.Core.Composing.Current;
namespace Umbraco.Core.Persistence.Factories
{
@@ -19,7 +21,7 @@ namespace Umbraco.Core.Persistence.Factories
logger.Warn(typeof(DataType), "Could not find an editor with alias {EditorAlias}, treating as Label."
+" The site may fail to boot and / or load data types and run.", dto.EditorAlias);
//convert to label
- editor = new LabelPropertyEditor(logger, ioHelper);
+ editor = new LabelPropertyEditor(logger, ioHelper, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper);
}
var dataType = new DataType(editor);
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index bd7c9a03b3..ab4f013e6a 100755
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -212,24 +212,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -404,7 +386,6 @@
-
diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj
index ca2a9cec22..eea225d59c 100644
--- a/src/Umbraco.Examine/Umbraco.Examine.csproj
+++ b/src/Umbraco.Examine/Umbraco.Examine.csproj
@@ -114,6 +114,10 @@
{31785bc3-256c-4613-b2f5-a1b0bdded8c1}
Umbraco.Core
+
+ {3ae7bf57-966b-45a5-910a-954d7c554441}
+ Umbraco.Infrastructure
+
\ No newline at end of file
diff --git a/src/Umbraco.Core/ObjectJsonExtensions.cs b/src/Umbraco.Infrastructure/ObjectJsonExtensions.cs
similarity index 100%
rename from src/Umbraco.Core/ObjectJsonExtensions.cs
rename to src/Umbraco.Infrastructure/ObjectJsonExtensions.cs
diff --git a/src/Umbraco.Core/PropertyEditors/ConfigurationEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/ConfigurationEditor.cs
similarity index 99%
rename from src/Umbraco.Core/PropertyEditors/ConfigurationEditor.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ConfigurationEditor.cs
index 8151753a43..07c9c0a080 100644
--- a/src/Umbraco.Core/PropertyEditors/ConfigurationEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ConfigurationEditor.cs
@@ -66,7 +66,7 @@ namespace Umbraco.Core.PropertyEditors
[JsonProperty("defaultConfig")]
public virtual IDictionary DefaultConfiguration {
get => _defaultConfiguration;
- internal set => _defaultConfiguration = value;
+ set => _defaultConfiguration = value;
}
///
diff --git a/src/Umbraco.Core/PropertyEditors/ConfigurationEditorOfTConfiguration.cs b/src/Umbraco.Infrastructure/PropertyEditors/ConfigurationEditorOfTConfiguration.cs
similarity index 100%
rename from src/Umbraco.Core/PropertyEditors/ConfigurationEditorOfTConfiguration.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ConfigurationEditorOfTConfiguration.cs
diff --git a/src/Umbraco.Core/PropertyEditors/DataEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/DataEditor.cs
similarity index 91%
rename from src/Umbraco.Core/PropertyEditors/DataEditor.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/DataEditor.cs
index fdb9be3f4b..0a233e3f3a 100644
--- a/src/Umbraco.Core/PropertyEditors/DataEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/DataEditor.cs
@@ -2,8 +2,11 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.Serialization;
+using Umbraco.Composing;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
+using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Core.PropertyEditors
{
@@ -19,13 +22,19 @@ namespace Umbraco.Core.PropertyEditors
[DataContract]
public class DataEditor : IDataEditor
{
+ private readonly IDataTypeService _dataTypeService;
+ private readonly ILocalizationService _localizationService;
+ private readonly IShortStringHelper _shortStringHelper;
private IDictionary _defaultConfiguration;
///
/// Initializes a new instance of the class.
///
- public DataEditor(ILogger logger, EditorType type = EditorType.PropertyValue)
+ public DataEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, EditorType type = EditorType.PropertyValue)
{
+ _dataTypeService = dataTypeService;
+ _localizationService = localizationService;
+ _shortStringHelper = shortStringHelper;
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
// defaults
@@ -166,7 +175,7 @@ namespace Umbraco.Core.PropertyEditors
if (Attribute == null)
throw new InvalidOperationException("The editor does not specify a view.");
- return new DataValueEditor(Current.Services.DataTypeService, Current.Services.LocalizationService, Attribute);
+ return new DataValueEditor(_dataTypeService, _localizationService, _shortStringHelper, Attribute);
}
///
diff --git a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/DataValueEditor.cs
similarity index 97%
rename from src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/DataValueEditor.cs
index 6d1e46e090..aa36738081 100644
--- a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/DataValueEditor.cs
@@ -6,12 +6,14 @@ using System.Linq;
using System.Xml.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using Umbraco.Composing;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors.Validators;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Core.PropertyEditors
{
@@ -21,15 +23,17 @@ namespace Umbraco.Core.PropertyEditors
public class DataValueEditor : IDataValueEditor
{
private readonly ILocalizedTextService _localizedTextService;
+ private readonly IShortStringHelper _shortStringHelper;
protected IDataTypeService DataTypeService { get; }
protected ILocalizationService LocalizationService { get; }
///
/// Initializes a new instance of the class.
///
- public DataValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService) // for tests, and manifest
+ public DataValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper) // for tests, and manifest
{
_localizedTextService = localizedTextService;
+ _shortStringHelper = shortStringHelper;
ValueType = ValueTypes.String;
Validators = new List();
DataTypeService = dataTypeService;
@@ -39,9 +43,10 @@ namespace Umbraco.Core.PropertyEditors
///
/// Initializes a new instance of the class.
///
- public DataValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute)
+ public DataValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
{
if (attribute == null) throw new ArgumentNullException(nameof(attribute));
+ _shortStringHelper = shortStringHelper;
var view = attribute.View;
if (string.IsNullOrWhiteSpace(view))
@@ -284,7 +289,7 @@ namespace Umbraco.Core.PropertyEditors
{
published &= property.PropertyType.SupportsPublishing;
- var nodeName = property.PropertyType.Alias.ToSafeAlias();
+ var nodeName = property.PropertyType.Alias.ToSafeAlias(_shortStringHelper);
foreach (var pvalue in property.Values)
{
diff --git a/src/Umbraco.Core/PropertyEditors/LabelConfigurationEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/LabelConfigurationEditor.cs
similarity index 100%
rename from src/Umbraco.Core/PropertyEditors/LabelConfigurationEditor.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/LabelConfigurationEditor.cs
diff --git a/src/Umbraco.Core/PropertyEditors/LabelPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/LabelPropertyEditor.cs
similarity index 56%
rename from src/Umbraco.Core/PropertyEditors/LabelPropertyEditor.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/LabelPropertyEditor.cs
index f7ada3212f..804b4ac2f3 100644
--- a/src/Umbraco.Core/PropertyEditors/LabelPropertyEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/LabelPropertyEditor.cs
@@ -1,7 +1,9 @@
-using Umbraco.Core.Composing;
+using Umbraco.Composing;
+using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Core.PropertyEditors
{
@@ -16,18 +18,24 @@ namespace Umbraco.Core.PropertyEditors
public class LabelPropertyEditor : DataEditor
{
private readonly IIOHelper _ioHelper;
+ private readonly IDataTypeService _dataTypeService;
+ private readonly ILocalizationService _localizationService;
+ private readonly IShortStringHelper _shortStringHelper;
///
/// Initializes a new instance of the class.
///
- public LabelPropertyEditor(ILogger logger, IIOHelper ioHelper)
- : base(logger)
+ public LabelPropertyEditor(ILogger logger, IIOHelper ioHelper, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper)
+ : base(logger, dataTypeService, localizationService, shortStringHelper)
{
_ioHelper = ioHelper;
+ _dataTypeService = dataTypeService;
+ _localizationService = localizationService;
+ _shortStringHelper = shortStringHelper;
}
///
- protected override IDataValueEditor CreateValueEditor() => new LabelPropertyValueEditor(Current.Services.DataTypeService, Current.Services.LocalizationService, Attribute);
+ protected override IDataValueEditor CreateValueEditor() => new LabelPropertyValueEditor(_dataTypeService, _localizationService, _shortStringHelper, Attribute);
///
protected override IConfigurationEditor CreateConfigurationEditor() => new LabelConfigurationEditor(_ioHelper);
@@ -35,8 +43,8 @@ namespace Umbraco.Core.PropertyEditors
// provides the property value editor
internal class LabelPropertyValueEditor : DataValueEditor
{
- public LabelPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute)
- : base(dataTypeService, localizationService, attribute)
+ public LabelPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute)
+ : base(dataTypeService, localizationService, shortStringHelper, attribute)
{ }
///
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs
similarity index 100%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs
similarity index 99%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs
index 886145ca7a..3a35bdfc9a 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/GridValueConverter.cs
@@ -6,6 +6,7 @@ using Umbraco.Core.Composing;
using Umbraco.Core.Configuration.Grid;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Composing;
namespace Umbraco.Core.PropertyEditors.ValueConverters
{
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValue.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValue.cs
similarity index 98%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValue.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValue.cs
index c05ab1c8fa..89cd7b49c3 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValue.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValue.cs
@@ -59,7 +59,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
: Crops.FirstOrDefault(x => x.Alias.InvariantEquals(alias));
}
- internal void AppendCropBaseUrl(StringBuilder url, ImageCropperCrop crop, bool defaultCrop, bool preferFocalPoint)
+ public void AppendCropBaseUrl(StringBuilder url, ImageCropperCrop crop, bool defaultCrop, bool preferFocalPoint)
{
if (preferFocalPoint && HasFocalPoint()
|| crop != null && crop.Coordinates == null && HasFocalPoint()
@@ -155,7 +155,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
/// Applies a configuration.
///
/// Ensures that all crops defined in the configuration exists in the value.
- internal void ApplyConfiguration(ImageCropperConfiguration configuration)
+ public void ApplyConfiguration(ImageCropperConfiguration configuration)
{
// merge the crop values - the alias + width + height comes from
// configuration, but each crop can store its own coordinates
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
similarity index 98%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
index 6f5bd571b7..64e4312b3f 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
@@ -4,6 +4,7 @@ using Newtonsoft.Json;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Composing;
namespace Umbraco.Core.PropertyEditors.ValueConverters
{
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueTypeConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueTypeConverter.cs
similarity index 100%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueTypeConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueTypeConverter.cs
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs
similarity index 99%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs
index 12e6238705..3e6abdac64 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/JsonValueConverter.cs
@@ -4,6 +4,7 @@ using Newtonsoft.Json.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Composing;
namespace Umbraco.Core.PropertyEditors.ValueConverters
{
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/LabelValueConverter.cs
similarity index 100%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/LabelValueConverter.cs
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs
similarity index 100%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/SliderValueConverter.cs
similarity index 98%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/SliderValueConverter.cs
index 11502687b7..88c1770a06 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/SliderValueConverter.cs
@@ -79,7 +79,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
private static readonly ConcurrentDictionary Storages = new ConcurrentDictionary();
- internal static void ClearCaches()
+ public static void ClearCaches()
{
Storages.Clear();
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TagsValueConverter.cs
similarity index 98%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TagsValueConverter.cs
index b54c693c14..0b347b8500 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TagsValueConverter.cs
@@ -72,7 +72,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
private static readonly ConcurrentDictionary Storages = new ConcurrentDictionary();
- internal static void ClearCaches()
+ public static void ClearCaches()
{
Storages.Clear();
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
similarity index 100%
rename from src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
diff --git a/src/Umbraco.Core/PropertyEditors/VoidEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/VoidEditor.cs
similarity index 70%
rename from src/Umbraco.Core/PropertyEditors/VoidEditor.cs
rename to src/Umbraco.Infrastructure/PropertyEditors/VoidEditor.cs
index b3a3e8ac0c..62ab331782 100644
--- a/src/Umbraco.Core/PropertyEditors/VoidEditor.cs
+++ b/src/Umbraco.Infrastructure/PropertyEditors/VoidEditor.cs
@@ -1,5 +1,7 @@
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
+using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Core.PropertyEditors
{
@@ -19,8 +21,8 @@ namespace Umbraco.Core.PropertyEditors
/// A logger.
/// The default alias of the editor is "Umbraco.Void". When a suffix is provided,
/// it is appended to the alias. Eg if the suffix is "Foo" the alias is "Umbraco.Void.Foo".
- public VoidEditor(string aliasSuffix, ILogger logger)
- : base(logger)
+ public VoidEditor(string aliasSuffix, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper)
+ : base(logger, dataTypeService, localizationService, shortStringHelper)
{
Alias = "Umbraco.Void";
if (string.IsNullOrWhiteSpace(aliasSuffix)) return;
@@ -32,8 +34,8 @@ namespace Umbraco.Core.PropertyEditors
///
/// A logger.
/// The alias of the editor is "Umbraco.Void".
- public VoidEditor(ILogger logger)
- : this(null, logger)
+ public VoidEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper)
+ : this(null, logger, dataTypeService, localizationService, shortStringHelper)
{ }
}
}
diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
index 478fe4868f..c2c25ec833 100644
--- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
+++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
@@ -41,4 +41,16 @@
+
+
+ <_Parameter1>Umbraco.Core
+
+
+ <_Parameter1>Umbraco.Tests
+
+
+ <_Parameter1>Umbraco.Tests.Benchmarks
+
+
+
diff --git a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs
index 24938e462e..f08706a9d0 100644
--- a/src/Umbraco.Tests/Manifest/ManifestParserTests.cs
+++ b/src/Umbraco.Tests/Manifest/ManifestParserTests.cs
@@ -15,6 +15,7 @@ using Umbraco.Core.Services;
using Umbraco.Core.Dashboards;
using Umbraco.Core.IO;
using Umbraco.Core.Serialization;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Manifest
@@ -33,7 +34,7 @@ namespace Umbraco.Tests.Manifest
new RegexValidator(Mock.Of(), null),
new DelimitedValueValidator(),
};
- _parser = new ManifestParser(AppCaches.Disabled, new ManifestValueValidatorCollection(validators), new ManifestFilterCollection(Array.Empty()), Mock.Of(), TestHelper.IOHelper, Mock.Of(), Mock.Of(), new JsonNetSerializer(), Mock.Of());
+ _parser = new ManifestParser(AppCaches.Disabled, new ManifestValueValidatorCollection(validators), new ManifestFilterCollection(Array.Empty()), Mock.Of(), TestHelper.IOHelper, Mock.Of(), Mock.Of(), new JsonNetSerializer(), Mock.Of(), Mock.Of());
}
[Test]
diff --git a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs
index 0792bf4126..56876538b8 100644
--- a/src/Umbraco.Tests/Models/ContentExtensionsTests.cs
+++ b/src/Umbraco.Tests/Models/ContentExtensionsTests.cs
@@ -33,7 +33,7 @@ namespace Umbraco.Tests.Models
Composition.Register(_ => Mock.Of());
// all this is required so we can validate properties...
- var editor = new TextboxPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), IOHelper) { Alias = "test" };
+ var editor = new TextboxPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), IOHelper, ShortStringHelper) { Alias = "test" };
Composition.Register(_ => new DataEditorCollection(new[] { editor }));
Composition.Register();
var dataType = Mock.Of();
diff --git a/src/Umbraco.Tests/Models/ContentTests.cs b/src/Umbraco.Tests/Models/ContentTests.cs
index 0b705004f9..f5b222e0d9 100644
--- a/src/Umbraco.Tests/Models/ContentTests.cs
+++ b/src/Umbraco.Tests/Models/ContentTests.cs
@@ -44,7 +44,7 @@ namespace Umbraco.Tests.Models
Composition.Register(_ => Mock.Of());
// all this is required so we can validate properties...
- var editor = new TextboxPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper) { Alias = "test" };
+ var editor = new TextboxPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper) { Alias = "test" };
Composition.Register(_ => new DataEditorCollection(new [] { editor }));
Composition.Register();
var dataType = Mock.Of();
diff --git a/src/Umbraco.Tests/Models/DataTypeTests.cs b/src/Umbraco.Tests/Models/DataTypeTests.cs
index 50d9f6e21b..59c1efea26 100644
--- a/src/Umbraco.Tests/Models/DataTypeTests.cs
+++ b/src/Umbraco.Tests/Models/DataTypeTests.cs
@@ -7,6 +7,8 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Serialization;
+using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Tests.Models
{
@@ -16,7 +18,7 @@ namespace Umbraco.Tests.Models
[Test]
public void Can_Deep_Clone()
{
- var dtd = new DataType(new VoidEditor(Mock.Of()), 9)
+ var dtd = new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of()), 9)
{
CreateDate = DateTime.Now,
CreatorId = 5,
@@ -59,7 +61,7 @@ namespace Umbraco.Tests.Models
[Test]
public void Can_Serialize_Without_Error()
{
- var dtd = new DataType(new VoidEditor(Mock.Of()), 9)
+ var dtd = new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of()), 9)
{
CreateDate = DateTime.Now,
CreatorId = 5,
diff --git a/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs
index ff30c123a2..4afeab7ece 100644
--- a/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs
+++ b/src/Umbraco.Tests/Models/Mapping/ContentTypeModelMappingTests.cs
@@ -7,6 +7,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Entities;
using Umbraco.Tests.Testing;
@@ -33,7 +34,7 @@ namespace Umbraco.Tests.Models.Mapping
base.Compose();
// create and register a fake property editor collection to return fake property editors
- var editors = new DataEditor[] { new TextboxPropertyEditor(Mock.Of(), _dataTypeService.Object, _localizationService.Object, IOHelper), };
+ var editors = new DataEditor[] { new TextboxPropertyEditor(Mock.Of(), _dataTypeService.Object, _localizationService.Object, IOHelper, ShortStringHelper), };
var dataEditors = new DataEditorCollection(editors);
_editorsMock = new Mock(dataEditors);
_editorsMock.Setup(x => x[It.IsAny()]).Returns(editors[0]);
@@ -296,7 +297,7 @@ namespace Umbraco.Tests.Models.Mapping
{
//Arrange
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
// setup the mocks to return the data we want to test against...
@@ -356,7 +357,7 @@ namespace Umbraco.Tests.Models.Mapping
{
//Arrange
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
// setup the mocks to return the data we want to test against...
@@ -411,7 +412,7 @@ namespace Umbraco.Tests.Models.Mapping
{
//Arrange
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
// setup the mocks to return the data we want to test against...
@@ -472,7 +473,7 @@ namespace Umbraco.Tests.Models.Mapping
public void MemberPropertyGroupBasic_To_MemberPropertyGroup()
{
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
var basic = new PropertyGroupBasic
{
@@ -543,7 +544,7 @@ namespace Umbraco.Tests.Models.Mapping
public void PropertyGroupBasic_To_PropertyGroup()
{
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
var basic = new PropertyGroupBasic
{
@@ -609,7 +610,7 @@ namespace Umbraco.Tests.Models.Mapping
public void MemberPropertyTypeBasic_To_PropertyType()
{
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
var basic = new MemberPropertyTypeBasic()
{
@@ -647,7 +648,7 @@ namespace Umbraco.Tests.Models.Mapping
public void PropertyTypeBasic_To_PropertyType()
{
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
var basic = new PropertyTypeBasic()
{
@@ -686,7 +687,7 @@ namespace Umbraco.Tests.Models.Mapping
{
//Arrange
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
// setup the mocks to return the data we want to test against...
@@ -779,7 +780,7 @@ namespace Umbraco.Tests.Models.Mapping
{
//Arrange
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
// setup the mocks to return the data we want to test against...
@@ -867,7 +868,7 @@ namespace Umbraco.Tests.Models.Mapping
public void MemberPropertyTypeBasic_To_MemberPropertyTypeDisplay()
{
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
var basic = new MemberPropertyTypeBasic()
{
@@ -907,7 +908,7 @@ namespace Umbraco.Tests.Models.Mapping
public void PropertyTypeBasic_To_PropertyTypeDisplay()
{
_dataTypeService.Setup(x => x.GetDataType(It.IsAny()))
- .Returns(new DataType(new VoidEditor(Mock.Of())));
+ .Returns(new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())));
var basic = new PropertyTypeBasic()
{
diff --git a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs
index d88b3f1be4..22a4def2df 100644
--- a/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs
+++ b/src/Umbraco.Tests/Models/Mapping/ContentWebModelMappingTests.cs
@@ -11,6 +11,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services.Implement;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Entities;
using Umbraco.Web.Models.ContentEditing;
@@ -37,7 +38,7 @@ namespace Umbraco.Tests.Models.Mapping
Composition.Register(_ => Mock.Of());
// all this is required so we can validate properties...
- var editor = new TextboxPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), IOHelper) { Alias = "test" };
+ var editor = new TextboxPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), IOHelper, TestHelper.ShortStringHelper) { Alias = "test" };
Composition.Register(_ => new DataEditorCollection(new[] { editor }));
Composition.Register();
var dataType = Mock.Of();
@@ -60,7 +61,7 @@ namespace Umbraco.Tests.Models.Mapping
///
/// The constructor will setup the property editor based on the attribute if one is found
///
- public TestPropertyEditor(ILogger logger) : base(logger)
+ public TestPropertyEditor(ILogger logger) : base(logger, Mock.Of(), Mock.Of(), Mock.Of())
{ }
}
diff --git a/src/Umbraco.Tests/Models/VariationTests.cs b/src/Umbraco.Tests/Models/VariationTests.cs
index c2651a6ff6..2270dd595c 100644
--- a/src/Umbraco.Tests/Models/VariationTests.cs
+++ b/src/Umbraco.Tests/Models/VariationTests.cs
@@ -9,6 +9,7 @@ using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Models
@@ -41,7 +42,7 @@ namespace Umbraco.Tests.Models
var dataEditors = new DataEditorCollection(new IDataEditor[]
{
- new DataEditor(Mock.Of()) { Alias = "editor", ExplicitValueEditor = TestHelper.CreateDataValueEditor("view") }
+ new DataEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of()) { Alias = "editor", ExplicitValueEditor = TestHelper.CreateDataValueEditor("view") }
});
var propertyEditors = new PropertyEditorCollection(dataEditors);
diff --git a/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs b/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs
index 1c863bd007..d34ddca9b1 100644
--- a/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs
+++ b/src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs
@@ -2,6 +2,7 @@
using System.Linq;
using System.Threading;
using System.Xml.Linq;
+using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Composing;
@@ -16,6 +17,7 @@ using Umbraco.Tests.Services;
using Umbraco.Tests.Services.Importing;
using Umbraco.Tests.Testing;
using Umbraco.Core.Composing.CompositionExtensions;
+using Umbraco.Core.Strings;
namespace Umbraco.Tests.Packaging
{
@@ -29,7 +31,7 @@ namespace Umbraco.Tests.Packaging
public class Editor1 : DataEditor
{
public Editor1(ILogger logger)
- : base(logger)
+ : base(logger, Mock.Of(), Mock.Of(), Mock.Of())
{
Alias = "7e062c13-7c41-4ad9-b389-41d88aeef87c";
}
@@ -39,7 +41,7 @@ namespace Umbraco.Tests.Packaging
public class Editor2 : DataEditor
{
public Editor2(ILogger logger)
- : base(logger)
+ : base(logger, Mock.Of(), Mock.Of(), Mock.Of())
{
Alias = "d15e1281-e456-4b24-aa86-1dda3e4299d5";
}
diff --git a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs
index 0af5cf1b70..d58e1df0b3 100644
--- a/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs
+++ b/src/Umbraco.Tests/Packaging/PackageInstallationTest.cs
@@ -13,6 +13,7 @@ using Umbraco.Core.Models.Packaging;
using Umbraco.Core.Packaging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Scoping;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
using File = System.IO.File;
@@ -48,7 +49,8 @@ namespace Umbraco.Tests.Packaging
ServiceContext.DataTypeService, ServiceContext.EntityService,
ServiceContext.ContentTypeService, ServiceContext.ContentService,
Factory.GetInstance(),
- Factory.GetInstance());
+ Factory.GetInstance(),
+ Factory.GetInstance());
private IPackageInstallation PackageInstallation => new PackageInstallation(
PackageDataInstallation,
diff --git a/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs b/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs
index 9819e7cd64..46bcc6f432 100644
--- a/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs
+++ b/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs
@@ -14,6 +14,8 @@ using Umbraco.Tests.TestHelpers;
using System.Linq;
using Umbraco.Core.Persistence.Dtos;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
namespace Umbraco.Tests.Persistence.Querying
{
@@ -23,7 +25,7 @@ namespace Umbraco.Tests.Persistence.Querying
[Test]
public void Equals_Claus_With_Two_Entity_Values()
{
- var dataType = new DataType(new VoidEditor(Mock.Of()))
+ var dataType = new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of()))
{
Id = 12345
};
@@ -160,7 +162,7 @@ namespace Umbraco.Tests.Persistence.Querying
Assert.AreEqual("upper([umbracoUser].[userLogin]) = upper(@0)", result);
Assert.AreEqual("hello@world.com", modelToSqlExpressionHelper.GetSqlParameters()[0]);
}
-
+
[Test]
public void Sql_Replace_Mapped()
{
diff --git a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs
index 1ddb9f8c8c..3c19e15fff 100644
--- a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs
+++ b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs
@@ -349,7 +349,7 @@ namespace Umbraco.Tests.Persistence.Repositories
using (provider.CreateScope())
{
var repository = CreateRepository();
- var dataTypeDefinition = new DataType(new LabelPropertyEditor(Logger, IOHelper))
+ var dataTypeDefinition = new DataType(new LabelPropertyEditor(Logger, IOHelper, DataTypeService, LocalizationService, ShortStringHelper))
{
DatabaseType = ValueStorageType.Integer,
Name = "AgeDataType",
@@ -387,7 +387,7 @@ namespace Umbraco.Tests.Persistence.Repositories
using (provider.CreateScope())
{
var repository = CreateRepository();
- var dataTypeDefinition = new DataType(new IntegerPropertyEditor(Logger))
+ var dataTypeDefinition = new DataType(new IntegerPropertyEditor(Logger, DataTypeService, LocalizationService, ShortStringHelper))
{
DatabaseType = ValueStorageType.Integer,
Name = "AgeDataType",
@@ -398,7 +398,7 @@ namespace Umbraco.Tests.Persistence.Repositories
// Act
var definition = repository.Get(dataTypeDefinition.Id);
definition.Name = "AgeDataType Updated";
- definition.Editor = new LabelPropertyEditor(Logger, IOHelper); //change
+ definition.Editor = new LabelPropertyEditor(Logger, IOHelper, DataTypeService, LocalizationService, ShortStringHelper); //change
repository.Save(definition);
var definitionUpdated = repository.Get(dataTypeDefinition.Id);
@@ -418,7 +418,7 @@ namespace Umbraco.Tests.Persistence.Repositories
using (provider.CreateScope())
{
var repository = CreateRepository();
- var dataTypeDefinition = new DataType(new LabelPropertyEditor(Logger, IOHelper))
+ var dataTypeDefinition = new DataType(new LabelPropertyEditor(Logger, IOHelper, DataTypeService, LocalizationService, ShortStringHelper))
{
DatabaseType = ValueStorageType.Integer,
Name = "AgeDataType",
diff --git a/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs b/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs
index 1a5e657bb7..007cb771df 100644
--- a/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs
+++ b/src/Umbraco.Tests/PropertyEditors/ColorListValidatorTest.cs
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.PropertyEditors
public void Only_Tests_On_JArray()
{
var validator = new ColorPickerConfigurationEditor.ColorListValidator();
- var result = validator.Validate("hello", null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ var result = validator.Validate("hello", null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(0, result.Count());
}
@@ -24,7 +24,7 @@ namespace Umbraco.Tests.PropertyEditors
public void Only_Tests_On_JArray_Of_Item_JObject()
{
var validator = new ColorPickerConfigurationEditor.ColorListValidator();
- var result = validator.Validate(new JArray("hello", "world"), null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ var result = validator.Validate(new JArray("hello", "world"), null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(0, result.Count());
}
@@ -37,7 +37,7 @@ namespace Umbraco.Tests.PropertyEditors
JObject.FromObject(new { value = "zxcvzxcvxzcv" }),
JObject.FromObject(new { value = "ABC" }),
JObject.FromObject(new { value = "1234567" })),
- null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(2, result.Count());
}
}
diff --git a/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs b/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs
index cf8c734f40..dbf4696836 100644
--- a/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs
+++ b/src/Umbraco.Tests/PropertyEditors/EnsureUniqueValuesValidatorTest.cs
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.PropertyEditors
public void Only_Tests_On_JArray()
{
var validator = new ValueListUniqueValueValidator();
- var result = validator.Validate("hello", null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ var result = validator.Validate("hello", null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(0, result.Count());
}
@@ -24,7 +24,7 @@ namespace Umbraco.Tests.PropertyEditors
public void Only_Tests_On_JArray_Of_Item_JObject()
{
var validator = new ValueListUniqueValueValidator();
- var result = validator.Validate(new JArray("hello", "world"), null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ var result = validator.Validate(new JArray("hello", "world"), null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(0, result.Count());
}
@@ -32,7 +32,7 @@ namespace Umbraco.Tests.PropertyEditors
public void Allows_Unique_Values()
{
var validator = new ValueListUniqueValueValidator();
- var result = validator.Validate(new JArray(JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "world" })), null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ var result = validator.Validate(new JArray(JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "world" })), null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(0, result.Count());
}
@@ -41,7 +41,7 @@ namespace Umbraco.Tests.PropertyEditors
{
var validator = new ValueListUniqueValueValidator();
var result = validator.Validate(new JArray(JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "hello" })),
- null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(1, result.Count());
}
@@ -54,7 +54,7 @@ namespace Umbraco.Tests.PropertyEditors
JObject.FromObject(new { value = "hello" }),
JObject.FromObject(new { value = "world" }),
JObject.FromObject(new { value = "world" })),
- null, new ColorPickerPropertyEditor(Mock.Of(), TestHelper.IOHelper));
+ null, new ColorPickerPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper));
Assert.AreEqual(2, result.Count());
}
}
diff --git a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs
index 5e18e8ce78..2441630dd0 100644
--- a/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs
+++ b/src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs
@@ -84,7 +84,7 @@ namespace Umbraco.Tests.PropertyEditors
var mediaFileSystem = new MediaFileSystem(Mock.Of(), scheme, logger, shortStringHelper);
var dataTypeService = new TestObjects.TestDataTypeService(
- new DataType(new ImageCropperPropertyEditor(Mock.Of(), mediaFileSystem, Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper)) { Id = 1 });
+ new DataType(new ImageCropperPropertyEditor(Mock.Of(), mediaFileSystem, Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper, TestHelper.ShortStringHelper)) { Id = 1 });
var factory = new PublishedContentTypeFactory(Mock.Of(), new PropertyValueConverterCollection(Array.Empty()), dataTypeService);
diff --git a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
index 64cca36f04..c86414d906 100644
--- a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
+++ b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
@@ -11,6 +11,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web.PropertyEditors;
@@ -30,7 +31,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void DropDownMultipleValueEditor_Format_Data_For_Cache()
{
- var dataType = new DataType(new CheckBoxListPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper))
+ var dataType = new DataType(new CheckBoxListPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper))
{
Configuration = new ValueListConfiguration
{
@@ -59,7 +60,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void DropDownValueEditor_Format_Data_For_Cache()
{
- var dataType = new DataType(new CheckBoxListPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper))
+ var dataType = new DataType(new CheckBoxListPropertyEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of(), TestHelper.IOHelper))
{
Configuration = new ValueListConfiguration
{
diff --git a/src/Umbraco.Tests/Published/ConvertersTests.cs b/src/Umbraco.Tests/Published/ConvertersTests.cs
index eb4066e2af..f6e614836f 100644
--- a/src/Umbraco.Tests/Published/ConvertersTests.cs
+++ b/src/Umbraco.Tests/Published/ConvertersTests.cs
@@ -10,6 +10,8 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Tests.Components;
using Umbraco.Tests.PublishedContent;
using Umbraco.Tests.TestHelpers;
@@ -32,7 +34,7 @@ namespace Umbraco.Tests.Published
});
var dataTypeService = new TestObjects.TestDataTypeService(
- new DataType(new VoidEditor(Mock.Of())) { Id = 1 });
+ new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 1 });
var contentTypeFactory = new PublishedContentTypeFactory(Mock.Of(), converters, dataTypeService);
@@ -112,7 +114,7 @@ namespace Umbraco.Tests.Published
});
var dataTypeService = new TestObjects.TestDataTypeService(
- new DataType(new VoidEditor(Mock.Of())) { Id = 1 });
+ new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 1 });
var contentTypeFactory = new PublishedContentTypeFactory(Mock.Of(), converters, dataTypeService);
@@ -206,8 +208,8 @@ namespace Umbraco.Tests.Published
var converters = Current.Factory.GetInstance();
var dataTypeService = new TestObjects.TestDataTypeService(
- new DataType(new VoidEditor(Mock.Of())) { Id = 1 },
- new DataType(new VoidEditor("2", Mock.Of())) { Id = 2 });
+ new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 1 },
+ new DataType(new VoidEditor("2", Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 2 });
var contentTypeFactory = new PublishedContentTypeFactory(factory, converters, dataTypeService);
diff --git a/src/Umbraco.Tests/Published/NestedContentTests.cs b/src/Umbraco.Tests/Published/NestedContentTests.cs
index 6b04d87e9d..16a648f38c 100644
--- a/src/Umbraco.Tests/Published/NestedContentTests.cs
+++ b/src/Umbraco.Tests/Published/NestedContentTests.cs
@@ -35,7 +35,7 @@ namespace Umbraco.Tests.Published
var localizationService = Mock.Of();
PropertyEditorCollection editors = null;
- var editor = new NestedContentPropertyEditor(logger, new Lazy(() => editors), Mock.Of(), localizationService, TestHelper.IOHelper);
+ var editor = new NestedContentPropertyEditor(logger, new Lazy(() => editors), Mock.Of(), localizationService, TestHelper.IOHelper, TestHelper.ShortStringHelper);
editors = new PropertyEditorCollection(new DataEditorCollection(new DataEditor[] { editor }));
var dataType1 = new DataType(editor)
@@ -66,7 +66,7 @@ namespace Umbraco.Tests.Published
}
};
- var dataType3 = new DataType(new TextboxPropertyEditor(logger, Mock.Of(), localizationService, TestHelper.IOHelper))
+ var dataType3 = new DataType(new TextboxPropertyEditor(logger, Mock.Of(), localizationService, TestHelper.IOHelper, TestHelper.ShortStringHelper))
{
Id = 3
};
diff --git a/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs b/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs
index fe2b080310..e377c9b784 100644
--- a/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs
+++ b/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs
@@ -10,6 +10,7 @@ using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
+using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web;
using Umbraco.Web.PublishedCache;
@@ -33,7 +34,7 @@ namespace Umbraco.Tests.Published
});
var dataTypeService = new TestObjects.TestDataTypeService(
- new DataType(new VoidEditor(Mock.Of())) { Id = 1 });
+ new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 1 });
var publishedContentTypeFactory = new PublishedContentTypeFactory(Mock.Of(), converters, dataTypeService);
@@ -114,7 +115,7 @@ namespace Umbraco.Tests.Published
});
var dataTypeService = new TestObjects.TestDataTypeService(
- new DataType(new VoidEditor(Mock.Of())) { Id = 1 });
+ new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 1 });
var publishedContentTypeFactory = new PublishedContentTypeFactory(Mock.Of(), converters, dataTypeService);
@@ -192,7 +193,7 @@ namespace Umbraco.Tests.Published
});
var dataTypeService = new TestObjects.TestDataTypeService(
- new DataType(new VoidEditor(Mock.Of())) { Id = 1 });
+ new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 1 });
var publishedContentTypeFactory = new PublishedContentTypeFactory(Mock.Of(), converters, dataTypeService);
diff --git a/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs b/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
index 0845daee9c..eaa2dc05fb 100644
--- a/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/NuCacheChildrenTests.cs
@@ -70,7 +70,7 @@ namespace Umbraco.Tests.PublishedContent
Mock.Get(runtime).Setup(x => x.Level).Returns(RuntimeLevel.Run);
// create data types, property types and content types
- var dataType = new DataType(new VoidEditor("Editor", Mock.Of())) { Id = 3 };
+ var dataType = new DataType(new VoidEditor("Editor", Mock.Of