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(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 3 }; var dataTypes = new[] { diff --git a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs index 63eac1479b..86024d84b6 100644 --- a/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs +++ b/src/Umbraco.Tests/PublishedContent/NuCacheTests.cs @@ -120,7 +120,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(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 3 }; var dataTypes = new[] { diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs index cc455b8e5d..297a6feb71 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.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.TestHelpers; using Umbraco.Web; using PublishedContentExtensions = Umbraco.Web.PublishedContentExtensions; @@ -125,7 +127,7 @@ namespace Umbraco.Tests.PublishedContent private IPublishedContent GetContent(bool createChildren, int indexVals) { 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 factory = new PublishedContentTypeFactory(Mock.Of(), new PropertyValueConverterCollection(Array.Empty()), dataTypeService); var contentTypeAlias = createChildren ? "Parent" : "Child"; diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs index 2f58cfcd74..a0b91e8eaa 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentSnapshotTestBase.cs @@ -19,6 +19,8 @@ using Umbraco.Core.IO; 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.Testing.Objects.Accessors; @@ -92,7 +94,7 @@ namespace Umbraco.Tests.PublishedContent private SolidPublishedSnapshot CreatePublishedSnapshot() { 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 factory = new PublishedContentTypeFactory(Mock.Of(), new PropertyValueConverterCollection(Array.Empty()), dataTypeService); var caches = new SolidPublishedSnapshot(); diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs index 7bbc7f0303..670c9af560 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Web.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Core.Strings; using Umbraco.Web; namespace Umbraco.Tests.PublishedContent @@ -46,7 +47,9 @@ namespace Umbraco.Tests.PublishedContent Mock.Of(), Mock.Of(), Mock.Of(), - Mock.Of(), IOHelper)) { Id = 1 }); + Mock.Of(), + Mock.Of(), + IOHelper)) { Id = 1 }); var publishedContentTypeFactory = new PublishedContentTypeFactory(Mock.Of(), converters, dataTypeService); diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index 968f80e1a2..73393e6ab1 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -52,12 +52,12 @@ namespace Umbraco.Tests.PublishedContent var localizationService = Mock.Of(); var dataTypeService = new TestObjects.TestDataTypeService( - new DataType(new VoidEditor(logger)) { Id = 1 }, - new DataType(new TrueFalsePropertyEditor(logger, IOHelper)) { Id = 1001 }, - new DataType(new RichTextPropertyEditor(logger, mediaService, contentTypeBaseServiceProvider, umbracoContextAccessor, Mock.Of(), localizationService, IOHelper)) { Id = 1002 }, - new DataType(new IntegerPropertyEditor(logger)) { Id = 1003 }, - new DataType(new TextboxPropertyEditor(logger, Mock.Of(), localizationService, TestHelper.IOHelper)) { Id = 1004 }, - new DataType(new MediaPickerPropertyEditor(logger, IOHelper)) { Id = 1005 }); + new DataType(new VoidEditor(logger, Mock.Of(), localizationService, ShortStringHelper)) { Id = 1 }, + new DataType(new TrueFalsePropertyEditor(logger, Mock.Of(), localizationService, IOHelper, ShortStringHelper)) { Id = 1001 }, + new DataType(new RichTextPropertyEditor(logger, mediaService, contentTypeBaseServiceProvider, umbracoContextAccessor, Mock.Of(), localizationService, ShortStringHelper, IOHelper)) { Id = 1002 }, + new DataType(new IntegerPropertyEditor(logger, Mock.Of(), localizationService, ShortStringHelper)) { Id = 1003 }, + new DataType(new TextboxPropertyEditor(logger, Mock.Of(), localizationService, IOHelper, ShortStringHelper)) { Id = 1004 }, + new DataType(new MediaPickerPropertyEditor(logger, Mock.Of(), localizationService, IOHelper, ShortStringHelper)) { Id = 1005 }); Composition.RegisterUnique(f => dataTypeService); } diff --git a/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs b/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs index 860b9b9179..4d44bcca66 100644 --- a/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs +++ b/src/Umbraco.Tests/PublishedContent/SolidPublishedSnapshot.cs @@ -9,6 +9,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.TestHelpers; using Umbraco.Web; using Umbraco.Web.PublishedCache; @@ -411,7 +413,7 @@ namespace Umbraco.Tests.PublishedContent static AutoPublishedContentType() { var dataTypeService = new TestObjects.TestDataTypeService( - new DataType(new VoidEditor(Mock.Of())) { Id = 666 }); + new DataType(new VoidEditor(Mock.Of(), Mock.Of(), Mock.Of(), Mock.Of())) { Id = 666 }); var factory = new PublishedContentTypeFactory(Mock.Of(), new PropertyValueConverterCollection(Array.Empty()), dataTypeService); Default = factory.CreatePropertyType("*", 666); diff --git a/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs b/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs index e7c310ffef..9de481dfa0 100644 --- a/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/CachedDataTypeServiceTests.cs @@ -23,7 +23,7 @@ namespace Umbraco.Tests.Services { var dataTypeService = ServiceContext.DataTypeService; - IDataType dataType = new DataType(new LabelPropertyEditor(Logger, IOHelper)) { Name = "Testing Textfield", DatabaseType = ValueStorageType.Ntext }; + IDataType dataType = new DataType(new LabelPropertyEditor(Logger, IOHelper, DataTypeService, LocalizationService, ShortStringHelper)) { Name = "Testing Textfield", DatabaseType = ValueStorageType.Ntext }; dataTypeService.Save(dataType); //Get all the first time (no cache) diff --git a/src/Umbraco.Tests/Services/DataTypeServiceTests.cs b/src/Umbraco.Tests/Services/DataTypeServiceTests.cs index 561ade1b54..74e3ca1d96 100644 --- a/src/Umbraco.Tests/Services/DataTypeServiceTests.cs +++ b/src/Umbraco.Tests/Services/DataTypeServiceTests.cs @@ -24,7 +24,7 @@ namespace Umbraco.Tests.Services var dataTypeService = ServiceContext.DataTypeService; // Act - IDataType dataType = new DataType(new LabelPropertyEditor(Logger, IOHelper)) { Name = "Testing Textfield", DatabaseType = ValueStorageType.Ntext }; + IDataType dataType = new DataType(new LabelPropertyEditor(Logger, IOHelper, DataTypeService, LocalizationService, ShortStringHelper)) { Name = "Testing Textfield", DatabaseType = ValueStorageType.Ntext }; dataTypeService.Save(dataType); // Assert @@ -66,7 +66,7 @@ namespace Umbraco.Tests.Services var dataTypeService = ServiceContext.DataTypeService; // Act - var dataTypeDefinition = new DataType(new LabelPropertyEditor(Logger, IOHelper)) { Name = string.Empty, DatabaseType = ValueStorageType.Ntext }; + var dataTypeDefinition = new DataType(new LabelPropertyEditor(Logger, IOHelper, DataTypeService, LocalizationService, ShortStringHelper)) { Name = string.Empty, DatabaseType = ValueStorageType.Ntext }; // Act & Assert Assert.Throws(() => dataTypeService.Save(dataTypeDefinition)); diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs index 286f2fd9e4..b43ec64a2f 100644 --- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs @@ -255,7 +255,7 @@ namespace Umbraco.Tests.Strings [Test] public void ToSafeAliasWithCulture() { - var output = "JUST-ANYTHING".ToSafeAlias(null); + var output = "JUST-ANYTHING".ToSafeAlias((string)null); Assert.AreEqual("SAFE-ALIAS-CULTURE::JUST-ANYTHING", output); } diff --git a/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs b/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs index f7e3744600..c1ce87e017 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseWebTest.cs @@ -11,6 +11,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.PublishedContent; using Umbraco.Tests.TestHelpers.Stubs; using Umbraco.Tests.Testing.Objects.Accessors; @@ -39,7 +40,7 @@ namespace Umbraco.Tests.TestHelpers // AutoPublishedContentTypes generates properties automatically 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 factory = new PublishedContentTypeFactory(Mock.Of(), new PropertyValueConverterCollection(Array.Empty()), dataTypeService); var type = new AutoPublishedContentType(0, "anything", new PublishedPropertyType[] { }); diff --git a/src/Umbraco.Tests/TestHelpers/TestHelper.cs b/src/Umbraco.Tests/TestHelpers/TestHelper.cs index fc14c04da8..c154fa11f9 100644 --- a/src/Umbraco.Tests/TestHelpers/TestHelper.cs +++ b/src/Umbraco.Tests/TestHelpers/TestHelper.cs @@ -295,6 +295,7 @@ namespace Umbraco.Tests.TestHelpers return new DataValueEditor( Mock.Of(), Mock.Of(), + Mock.Of(), new DataEditorAttribute(name, name, name) { ValueType = valueType diff --git a/src/Umbraco.Tests/TestHelpers/TestObjects.cs b/src/Umbraco.Tests/TestHelpers/TestObjects.cs index e9942506f2..a5bed1dca0 100644 --- a/src/Umbraco.Tests/TestHelpers/TestObjects.cs +++ b/src/Umbraco.Tests/TestHelpers/TestObjects.cs @@ -183,7 +183,7 @@ namespace Umbraco.Tests.TestHelpers new PackagesRepository(contentService.Value, contentTypeService.Value, dataTypeService.Value, fileService.Value, macroService.Value, localizationService.Value, ioHelper, new EntityXmlSerializer(contentService.Value, mediaService.Value, dataTypeService.Value, userService.Value, localizationService.Value, contentTypeService.Value, urlSegmentProviders), logger, umbracoVersion, globalSettings, "installedPackages.config"), new PackageInstallation( - new PackageDataInstallation(logger, fileService.Value, macroService.Value, localizationService.Value, dataTypeService.Value, entityService.Value, contentTypeService.Value, contentService.Value, propertyEditorCollection, scopeProvider), + new PackageDataInstallation(logger, fileService.Value, macroService.Value, localizationService.Value, dataTypeService.Value, entityService.Value, contentTypeService.Value, contentService.Value, propertyEditorCollection, scopeProvider, shortStringHelper), new PackageFileInstallation(compiledPackageXmlParser, ioHelper, new ProfilingLogger(logger, new TestProfiler())), compiledPackageXmlParser, Mock.Of(), new DirectoryInfo(ioHelper.GetRootDirectorySafe())), ioHelper); diff --git a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs index eaf20bb810..e8fdb8915c 100644 --- a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs +++ b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs @@ -45,6 +45,7 @@ using Umbraco.Web.Sections; using Current = Umbraco.Core.Composing.Current; using FileSystems = Umbraco.Core.IO.FileSystems; using Umbraco.Core.Dictionary; +using Umbraco.Core.Services; using Umbraco.Net; namespace Umbraco.Tests.Testing @@ -104,6 +105,8 @@ namespace Umbraco.Tests.Testing protected ILogger Logger => Factory.GetInstance(); protected IIOHelper IOHelper { get; private set; } + protected IDataTypeService DataTypeService => Factory.GetInstance(); + protected ILocalizationService LocalizationService => Factory.GetInstance(); protected IShortStringHelper ShortStringHelper { get; private set; } protected IUmbracoVersion UmbracoVersion { get; private set; } @@ -325,7 +328,8 @@ namespace Umbraco.Tests.Testing { Assembly.Load("Umbraco.Core"), Assembly.Load("Umbraco.Web"), - Assembly.Load("Umbraco.Tests") + Assembly.Load("Umbraco.Tests"), + Assembly.Load("Umbraco.Infrastructure") }); } diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index 072e2277b7..2652368819 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -5309,14 +5309,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5331,20 +5329,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -5461,8 +5456,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -5474,7 +5468,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5489,7 +5482,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5497,14 +5489,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5523,7 +5513,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -5604,8 +5593,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -5617,7 +5605,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -5739,7 +5726,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index d4e153ea9e..043402365c 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -24,6 +24,7 @@ using Umbraco.Core.Persistence; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Scoping; using Umbraco.Core.Services; +using Umbraco.Core.Strings; using Umbraco.Web.Models; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; @@ -50,6 +51,7 @@ namespace Umbraco.Web.Editors private readonly IEntityXmlSerializer _serializer; private readonly PropertyEditorCollection _propertyEditors; private readonly IScopeProvider _scopeProvider; + private readonly IShortStringHelper _shortStringHelper; public ContentTypeController(IEntityXmlSerializer serializer, ICultureDictionary cultureDictionary, @@ -58,12 +60,14 @@ namespace Umbraco.Web.Editors ISqlContext sqlContext, PropertyEditorCollection propertyEditors, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, - IScopeProvider scopeProvider) + IScopeProvider scopeProvider, + IShortStringHelper shortStringHelper) : base(cultureDictionary, globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper) { _serializer = serializer; _propertyEditors = propertyEditors; _scopeProvider = scopeProvider; + _shortStringHelper = shortStringHelper; } public int GetCount() @@ -522,7 +526,7 @@ namespace Umbraco.Web.Editors } var dataInstaller = new PackageDataInstallation(Logger, Services.FileService, Services.MacroService, Services.LocalizationService, - Services.DataTypeService, Services.EntityService, Services.ContentTypeService, Services.ContentService, _propertyEditors, _scopeProvider); + Services.DataTypeService, Services.EntityService, Services.ContentTypeService, Services.ContentService, _propertyEditors, _scopeProvider, _shortStringHelper); var xd = new XmlDocument {XmlResolver = null}; xd.Load(filePath); diff --git a/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs index 01bdf569ec..48f640d789 100644 --- a/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/CheckBoxListPropertyEditor.cs @@ -3,6 +3,7 @@ using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -20,17 +21,19 @@ namespace Umbraco.Web.PropertyEditors private readonly ILocalizedTextService _textService; private readonly IDataTypeService _dataTypeService; private readonly ILocalizationService _localizationService; + private readonly IShortStringHelper _shortStringHelper; private readonly IIOHelper _ioHelper; /// /// The constructor will setup the property editor based on the attribute if one is found /// - public CheckBoxListPropertyEditor(ILogger logger, ILocalizedTextService textService, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) - : base(logger) + public CheckBoxListPropertyEditor(ILogger logger, ILocalizedTextService textService, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, IIOHelper ioHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { _textService = textService; _dataTypeService = dataTypeService; _localizationService = localizationService; + _shortStringHelper = shortStringHelper; _ioHelper = ioHelper; } @@ -38,6 +41,6 @@ namespace Umbraco.Web.PropertyEditors protected override IConfigurationEditor CreateConfigurationEditor() => new ValueListConfigurationEditor(_textService, _ioHelper); /// - protected override IDataValueEditor CreateValueEditor() => new MultipleValueEditor(Logger, _dataTypeService, _localizationService, Attribute); + protected override IDataValueEditor CreateValueEditor() => new MultipleValueEditor(Logger, _dataTypeService, _localizationService, _shortStringHelper, Attribute); } } diff --git a/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs index aae71f429e..12393ef16e 100644 --- a/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ColorPickerPropertyEditor.cs @@ -1,7 +1,10 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; +using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -15,8 +18,8 @@ namespace Umbraco.Web.PropertyEditors { private readonly IIOHelper _ioHelper; - public ColorPickerPropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + public ColorPickerPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs index f462c3f9db..42669b5480 100644 --- a/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ContentPickerPropertyEditor.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -21,7 +22,7 @@ namespace Umbraco.Web.PropertyEditors private readonly IIOHelper _ioHelper; public ContentPickerPropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs index dbc0b96bb2..0cd9272c31 100644 --- a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -23,7 +24,7 @@ namespace Umbraco.Web.PropertyEditors /// /// public DateTimePropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs b/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs index b8dada173f..24aca12224 100644 --- a/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DateValueEditor.cs @@ -1,8 +1,10 @@ using System; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -13,7 +15,7 @@ namespace Umbraco.Web.PropertyEditors internal class DateValueEditor : DataValueEditor { public DateValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { Validators.Add(new DateTimeValidator()); } diff --git a/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs index 880cf8f204..7a81c16740 100644 --- a/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DecimalPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.PropertyEditors.Validators; @@ -20,7 +21,7 @@ namespace Umbraco.Web.PropertyEditors /// Initializes a new instance of the class. /// public DecimalPropertyEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { } /// diff --git a/src/Umbraco.Web/PropertyEditors/DropDownFlexiblePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DropDownFlexiblePropertyEditor.cs index 60c0c04c4f..636370e600 100644 --- a/src/Umbraco.Web/PropertyEditors/DropDownFlexiblePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DropDownFlexiblePropertyEditor.cs @@ -3,6 +3,7 @@ using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -17,20 +18,22 @@ namespace Umbraco.Web.PropertyEditors private readonly ILocalizedTextService _textService; private readonly IDataTypeService _dataTypeService; private readonly ILocalizationService _localizationService; + private readonly IShortStringHelper _shortStringHelper; private readonly IIOHelper _ioHelper; - public DropDownFlexiblePropertyEditor(ILocalizedTextService textService, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) - : base(logger) + public DropDownFlexiblePropertyEditor(ILocalizedTextService textService, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, IIOHelper ioHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { _textService = textService; _dataTypeService = dataTypeService; _localizationService = localizationService; + _shortStringHelper = shortStringHelper; _ioHelper = ioHelper; } protected override IDataValueEditor CreateValueEditor() { - return new MultipleValueEditor(Logger, _dataTypeService, _localizationService, Attribute); + return new MultipleValueEditor(Logger, _dataTypeService, _localizationService, _shortStringHelper, Attribute); } protected override IConfigurationEditor CreateConfigurationEditor() => new DropDownFlexibleConfigurationEditor(_textService, _ioHelper); diff --git a/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs index faf7291cf5..2a021bac31 100644 --- a/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/EmailAddressPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -19,7 +20,8 @@ namespace Umbraco.Web.PropertyEditors /// /// The constructor will setup the property editor based on the attribute if one is found /// - public EmailAddressPropertyEditor(ILogger logger, IIOHelper ioHelper) : base(logger) + public EmailAddressPropertyEditor(ILogger logger, IIOHelper ioHelper) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs index 366f3938a6..8e636326e2 100644 --- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.IO; using Umbraco.Core.Logging; @@ -28,7 +29,7 @@ namespace Umbraco.Web.PropertyEditors private readonly ILocalizationService _localizationService; public FileUploadPropertyEditor(ILogger logger, IMediaFileSystem mediaFileSystem, IContentSection contentSection, IDataTypeService dataTypeService, ILocalizationService localizationService) - : base(logger) + : base(logger, dataTypeService, localizationService, Current.ShortStringHelper) { _mediaFileSystem = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem)); _contentSection = contentSection; diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs index 172d8070af..97da19c0a4 100644 --- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using Newtonsoft.Json.Linq; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; @@ -19,7 +20,7 @@ namespace Umbraco.Web.PropertyEditors private readonly IMediaFileSystem _mediaFileSystem; public FileUploadPropertyValueEditor(DataEditorAttribute attribute, IMediaFileSystem mediaFileSystem, IDataTypeService dataTypeService, ILocalizationService localizationService) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { _mediaFileSystem = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem)); } diff --git a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs index ca4fc32fd0..c8cf52ed64 100644 --- a/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Models; @@ -35,7 +36,7 @@ namespace Umbraco.Web.PropertyEditors private ILogger _logger; public GridPropertyEditor(ILogger logger, IMediaService mediaService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IUmbracoContextAccessor umbracoContextAccessor, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) - : base(logger) + : base(logger, dataTypeService, localizationService, Current.ShortStringHelper) { _mediaService = mediaService; _contentTypeBaseServiceProvider = contentTypeBaseServiceProvider; @@ -64,7 +65,7 @@ namespace Umbraco.Web.PropertyEditors private ILogger _logger; public GridPropertyValueEditor(DataEditorAttribute attribute, IMediaService mediaService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IUmbracoContextAccessor umbracoContextAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { _mediaService = mediaService; _contentTypeBaseServiceProvider = contentTypeBaseServiceProvider; diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs index f0e046ed83..17e1e8064d 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.IO; using Umbraco.Core.Logging; @@ -12,6 +13,7 @@ using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; using Umbraco.Core.PropertyEditors.ValueConverters; using Umbraco.Core.Services; +using Umbraco.Core.Strings; using Umbraco.Web.Media; namespace Umbraco.Web.PropertyEditors @@ -39,8 +41,8 @@ namespace Umbraco.Web.PropertyEditors /// /// Initializes a new instance of the class. /// - public ImageCropperPropertyEditor(ILogger logger, IMediaFileSystem mediaFileSystem, IContentSection contentSettings, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) - : base(logger) + public ImageCropperPropertyEditor(ILogger logger, IMediaFileSystem mediaFileSystem, IContentSection contentSettings, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { _mediaFileSystem = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem)); _contentSettings = contentSettings ?? throw new ArgumentNullException(nameof(contentSettings)); diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs index 1dab41d4e6..c4deca8549 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs @@ -2,6 +2,7 @@ using System; using Newtonsoft.Json; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Models; @@ -22,7 +23,7 @@ namespace Umbraco.Web.PropertyEditors private readonly IMediaFileSystem _mediaFileSystem; public ImageCropperPropertyValueEditor(DataEditorAttribute attribute, ILogger logger, IMediaFileSystem mediaFileSystem, IDataTypeService dataTypeService, ILocalizationService localizationService) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _mediaFileSystem = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem)); diff --git a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs index 7717ced4a5..17d6948daf 100644 --- a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs @@ -1,7 +1,10 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.PropertyEditors.Validators; +using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -16,8 +19,8 @@ namespace Umbraco.Web.PropertyEditors ValueType = ValueTypes.Integer)] public class IntegerPropertyEditor : DataEditor { - public IntegerPropertyEditor(ILogger logger) - : base(logger) + public IntegerPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { } /// diff --git a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs index 1394a7477e..7e19553911 100644 --- a/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -25,7 +26,7 @@ namespace Umbraco.Web.PropertyEditors /// /// public ListViewPropertyEditor(ILogger logger, IIOHelper iioHelper) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _iioHelper = iioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs index 530fabeb11..6c73183361 100644 --- a/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MarkdownPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -23,7 +24,7 @@ namespace Umbraco.Web.PropertyEditors /// Initializes a new instance of the class. /// public MarkdownPropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs index 6021eb3169..927c5ca31b 100644 --- a/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs @@ -1,7 +1,10 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; +using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -23,8 +26,8 @@ namespace Umbraco.Web.PropertyEditors /// /// Initializes a new instance of the class. /// - public MediaPickerPropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + public MediaPickerPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs index b8e67c863c..c44420f4c6 100644 --- a/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MemberGroupPickerPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -14,7 +15,7 @@ namespace Umbraco.Web.PropertyEditors public class MemberGroupPickerPropertyEditor : DataEditor { public MemberGroupPickerPropertyEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { } } } diff --git a/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs index 69020ba350..cdda8a4ce3 100644 --- a/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MemberPickerPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -14,7 +15,7 @@ namespace Umbraco.Web.PropertyEditors public class MemberPickerPropertyEditor : DataEditor { public MemberPickerPropertyEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { } protected override IConfigurationEditor CreateConfigurationEditor() => new MemberPickerConfiguration(); diff --git a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs index 808387155e..3f1b1ca8b7 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -17,7 +18,7 @@ namespace Umbraco.Web.PropertyEditors private readonly IIOHelper _ioHelper; public MultiNodeTreePickerPropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs index f91f56e9e9..b337cd9681 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerPropertyEditor.cs @@ -1,5 +1,6 @@ using System; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Logging; @@ -24,7 +25,8 @@ namespace Umbraco.Web.PropertyEditors private readonly ILocalizationService _localizationService; private readonly IIOHelper _ioHelper; - public MultiUrlPickerPropertyEditor(ILogger logger, IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) : base(logger, EditorType.PropertyValue) + public MultiUrlPickerPropertyEditor(ILogger logger, IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) + : base(logger, dataTypeService, localizationService, Current.ShortStringHelper, EditorType.PropertyValue) { _entityService = entityService ?? throw new ArgumentNullException(nameof(entityService)); _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor)); diff --git a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs index 97d787dbba..98778db7ee 100644 --- a/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Models.Editors; using Umbraco.Core.Models.Entities; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Web.Composing; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.PublishedCache; @@ -21,7 +22,7 @@ namespace Umbraco.Web.PropertyEditors private readonly ILogger _logger; private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; - public MultiUrlPickerValueEditor(IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) : base(dataTypeService, localizationService, attribute) + public MultiUrlPickerValueEditor(IEntityService entityService, IPublishedSnapshotAccessor publishedSnapshotAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { _entityService = entityService ?? throw new ArgumentNullException(nameof(entityService)); _publishedSnapshotAccessor = publishedSnapshotAccessor ?? throw new ArgumentNullException(nameof(publishedSnapshotAccessor)); diff --git a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs index 96a17c8001..de09074fdd 100644 --- a/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs @@ -37,7 +37,7 @@ namespace Umbraco.Web.PropertyEditors /// Initializes a new instance of the class. /// public MultipleTextStringPropertyEditor(ILogger logger, IIOHelper ioHelper, IDataTypeService dataTypeService, ILocalizationService localizationService, ILocalizedTextService localizedTextService) - : base(logger) + : base(logger, dataTypeService, localizationService, Current.ShortStringHelper) { _ioHelper = ioHelper; _dataTypeService = dataTypeService; @@ -59,7 +59,7 @@ namespace Umbraco.Web.PropertyEditors private readonly ILocalizedTextService _localizedTextService; public MultipleTextStringPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute, ILocalizedTextService localizedTextService) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { _localizedTextService = localizedTextService; } diff --git a/src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs b/src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs index f5ca6c5cfe..1738c0f8aa 100644 --- a/src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs @@ -2,10 +2,12 @@ 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; using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -19,8 +21,8 @@ namespace Umbraco.Web.PropertyEditors { private readonly ILogger _logger; - internal MultipleValueEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) - : base(dataTypeService, localizationService, attribute) + internal MultipleValueEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IShortStringHelper shortStringHelper, DataEditorAttribute attribute) + : base(dataTypeService, localizationService, shortStringHelper, attribute) { _logger = logger; } diff --git a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs index bcb0580a1a..fa38c80fd1 100644 --- a/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs @@ -13,6 +13,7 @@ using Umbraco.Core.Models; using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -35,8 +36,8 @@ namespace Umbraco.Web.PropertyEditors internal const string ContentTypeAliasPropertyKey = "ncContentTypeAlias"; - public NestedContentPropertyEditor(ILogger logger, Lazy propertyEditors, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) - : base (logger) + public NestedContentPropertyEditor(ILogger logger, Lazy propertyEditors, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper) + : base (logger, dataTypeService, localizationService, shortStringHelper) { _propertyEditors = propertyEditors; _dataTypeService = dataTypeService; @@ -66,7 +67,7 @@ namespace Umbraco.Web.PropertyEditors ); public NestedContentPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute, PropertyEditorCollection propertyEditors) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { _propertyEditors = propertyEditors; Validators.Add(new NestedContentValidator(propertyEditors, GetElementType)); diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs index 149243f122..8edde60e9d 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/ContentTypeParameterEditor.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Composing; +using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors.ParameterEditors @@ -17,7 +18,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors /// Initializes a new instance of the class. /// public ContentTypeParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { // configure DefaultConfiguration.Add("multiple", false); diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs index 0ca657ac39..57ab499339 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -18,7 +19,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors /// Initializes a new instance of the class. /// public MultipleContentPickerParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { // configure DefaultConfiguration.Add("multiPicker", "1"); diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs index c8f19f8acd..3eacde2059 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentTypeParameterEditor.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Composing; +using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors.ParameterEditors @@ -11,7 +12,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors public class MultipleContentTypeParameterEditor : DataEditor { public MultipleContentTypeParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { // configure DefaultConfiguration.Add("multiple", true); diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs index 1208a5eecc..297d0ddae6 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleMediaPickerParameterEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -19,7 +20,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors /// Initializes a new instance of the class. /// public MultipleMediaPickerParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { DefaultConfiguration.Add("multiPicker", "1"); } diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs index 2a7079d578..199704ade6 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyGroupParameterEditor.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Composing; +using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors.ParameterEditors @@ -11,7 +12,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors public class MultiplePropertyGroupParameterEditor : DataEditor { public MultiplePropertyGroupParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { // configure DefaultConfiguration.Add("multiple", true); diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs index fe1432a655..5dd135778f 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/MultiplePropertyTypeParameterEditor.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Composing; +using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors.ParameterEditors @@ -11,7 +12,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors public class MultiplePropertyTypeParameterEditor : DataEditor { public MultiplePropertyTypeParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { // configure DefaultConfiguration.Add("multiple", "1"); diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs index 65ce595852..6085c65219 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyGroupParameterEditor.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Composing; +using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors.ParameterEditors @@ -11,7 +12,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors public class PropertyGroupParameterEditor : DataEditor { public PropertyGroupParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { // configure DefaultConfiguration.Add("multiple", "0"); diff --git a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs index 4ea7c0ebdc..c1fafb961e 100644 --- a/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ParameterEditors/PropertyTypeParameterEditor.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Logging; +using Umbraco.Core.Composing; +using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors.ParameterEditors @@ -11,7 +12,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors public class PropertyTypeParameterEditor : DataEditor { public PropertyTypeParameterEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { // configure DefaultConfiguration.Add("multiple", "0"); diff --git a/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs index 8e86c21493..bf4509fb25 100644 --- a/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RadioButtonsPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -25,7 +26,7 @@ namespace Umbraco.Web.PropertyEditors /// The constructor will setup the property editor based on the attribute if one is found /// public RadioButtonsPropertyEditor(ILogger logger, ILocalizedTextService textService, IIOHelper ioHelper) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _textService = textService; _ioHelper = ioHelper; diff --git a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs index 343ae39fd3..e5664e2d6f 100644 --- a/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Core.Strings; using Umbraco.Examine; using Umbraco.Web.Macros; using Umbraco.Web.Templates; @@ -43,7 +45,8 @@ namespace Umbraco.Web.PropertyEditors IUmbracoContextAccessor umbracoContextAccessor, IDataTypeService dataTypeService, ILocalizationService localizationService, - IIOHelper ioHelper) : base(logger) + IShortStringHelper shortStringHelper, + IIOHelper ioHelper) : base(logger, dataTypeService, localizationService, shortStringHelper) { _mediaService = mediaService; _contentTypeBaseServiceProvider = contentTypeBaseServiceProvider; @@ -75,7 +78,7 @@ namespace Umbraco.Web.PropertyEditors private ILogger _logger; public RichTextPropertyValueEditor(DataEditorAttribute attribute, IMediaService mediaService, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, IUmbracoContextAccessor umbracoContextAccessor, ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { _mediaService = mediaService; _contentTypeBaseServiceProvider = contentTypeBaseServiceProvider; diff --git a/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs index d91ba2041e..d4479b8e3c 100644 --- a/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/SliderPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -21,7 +22,7 @@ namespace Umbraco.Web.PropertyEditors /// Initializes a new instance of the class. /// public SliderPropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs index 2c40f7f50a..732861f86f 100644 --- a/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs @@ -30,7 +30,7 @@ namespace Umbraco.Web.PropertyEditors private readonly ILocalizedTextService _localizedTextService; public TagsPropertyEditor(ManifestValueValidatorCollection validators, ILogger logger, IIOHelper ioHelper, ILocalizedTextService localizedTextService) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { _validators = validators; _ioHelper = ioHelper; @@ -44,7 +44,7 @@ namespace Umbraco.Web.PropertyEditors internal class TagPropertyValueEditor : DataValueEditor { public TagPropertyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { } /// diff --git a/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs index c5a848855c..29e2336c37 100644 --- a/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextAreaPropertyEditor.cs @@ -1,4 +1,5 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -26,7 +27,7 @@ namespace Umbraco.Web.PropertyEditors /// Initializes a new instance of the class. /// public TextAreaPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) - : base(logger) + : base(logger, dataTypeService, localizationService, Current.ShortStringHelper) { _dataTypeService = dataTypeService; _localizationService = localizationService; diff --git a/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs index 782e19e42d..d963f31b1e 100644 --- a/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextOnlyValueEditor.cs @@ -1,4 +1,5 @@ using System; +using Umbraco.Core.Composing; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; @@ -12,7 +13,7 @@ namespace Umbraco.Web.PropertyEditors public class TextOnlyValueEditor : DataValueEditor { public TextOnlyValueEditor(IDataTypeService dataTypeService, ILocalizationService localizationService, DataEditorAttribute attribute) - : base(dataTypeService, localizationService, attribute) + : base(dataTypeService, localizationService, Current.ShortStringHelper, attribute) { } /// diff --git a/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs index 6823c62e9c..e9f2022d4c 100644 --- a/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TextboxPropertyEditor.cs @@ -1,8 +1,10 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -24,8 +26,8 @@ namespace Umbraco.Web.PropertyEditors /// /// Initializes a new instance of the class. /// - public TextboxPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper) - : base(logger) + public TextboxPropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { _dataTypeService = dataTypeService; _localizationService = localizationService; diff --git a/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs index 0313172fac..4fb6b6fbb4 100644 --- a/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/TrueFalsePropertyEditor.cs @@ -1,7 +1,10 @@ using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; +using Umbraco.Core.Services; +using Umbraco.Core.Strings; namespace Umbraco.Web.PropertyEditors { @@ -23,8 +26,8 @@ namespace Umbraco.Web.PropertyEditors /// /// Initializes a new instance of the class. /// - public TrueFalsePropertyEditor(ILogger logger, IIOHelper ioHelper) - : base(logger) + public TrueFalsePropertyEditor(ILogger logger, IDataTypeService dataTypeService, ILocalizationService localizationService, IIOHelper ioHelper, IShortStringHelper shortStringHelper) + : base(logger, dataTypeService, localizationService, shortStringHelper) { _ioHelper = ioHelper; } diff --git a/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs index daf574719a..130ec61270 100644 --- a/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/UserPickerPropertyEditor.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using System.Web.Mvc; using Umbraco.Core; +using Umbraco.Core.Composing; using Umbraco.Core.Logging; using Umbraco.Core.PropertyEditors; @@ -16,7 +17,7 @@ namespace Umbraco.Web.PropertyEditors public class UserPickerPropertyEditor : DataEditor { public UserPickerPropertyEditor(ILogger logger) - : base(logger) + : base(logger, Current.Services.DataTypeService, Current.Services.LocalizationService, Current.ShortStringHelper) { } protected override IConfigurationEditor CreateConfigurationEditor() => new UserPickerConfiguration();