Feature: Configure Data Type conversion (#12374)
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch> Co-authored-by: Elitsa Marinovska <elm@umbraco.dk> Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Runtime.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Configuration;
|
||||
@@ -26,6 +27,7 @@ using Umbraco.Cms.Web.BackOffice.Routing;
|
||||
using Umbraco.Cms.Web.BackOffice.Security;
|
||||
using Umbraco.Cms.Web.BackOffice.Trees;
|
||||
using Umbraco.Cms.Web.Common.Attributes;
|
||||
using Umbraco.Cms.Web.Common.DependencyInjection;
|
||||
using Umbraco.Cms.Web.Common.Models;
|
||||
using Umbraco.Extensions;
|
||||
using Language = Umbraco.Cms.Core.Models.ContentEditing.Language;
|
||||
@@ -40,21 +42,23 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
private readonly LinkGenerator _linkGenerator;
|
||||
private readonly IRuntimeState _runtimeState;
|
||||
private readonly UmbracoFeatures _features;
|
||||
private GlobalSettings _globalSettings;
|
||||
private GlobalSettings _globalSettings;
|
||||
private readonly IUmbracoVersion _umbracoVersion;
|
||||
private ContentSettings _contentSettings;
|
||||
private ContentSettings _contentSettings;
|
||||
private readonly TreeCollection _treeCollection;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private readonly IHostingEnvironment _hostingEnvironment;
|
||||
private RuntimeSettings _runtimeSettings;
|
||||
private SecuritySettings _securitySettings;
|
||||
private RuntimeSettings _runtimeSettings;
|
||||
private SecuritySettings _securitySettings;
|
||||
private readonly IRuntimeMinifier _runtimeMinifier;
|
||||
private readonly IBackOfficeExternalLoginProviders _externalLogins;
|
||||
private readonly IImageUrlGenerator _imageUrlGenerator;
|
||||
private readonly PreviewRoutes _previewRoutes;
|
||||
private readonly IEmailSender _emailSender;
|
||||
private MemberPasswordConfigurationSettings _memberPasswordConfigurationSettings;
|
||||
private DataTypesSettings _dataTypesSettings;
|
||||
|
||||
[Obsolete("Use constructor that takes IOptionsMontior<DataTypeSettings>, scheduled for removal in V12")]
|
||||
public BackOfficeServerVariables(
|
||||
LinkGenerator linkGenerator,
|
||||
IRuntimeState runtimeState,
|
||||
@@ -73,6 +77,47 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
PreviewRoutes previewRoutes,
|
||||
IEmailSender emailSender,
|
||||
IOptionsMonitor<MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings)
|
||||
: this(
|
||||
linkGenerator,
|
||||
runtimeState,
|
||||
features,
|
||||
globalSettings,
|
||||
umbracoVersion,
|
||||
contentSettings,
|
||||
httpContextAccessor,
|
||||
treeCollection,
|
||||
hostingEnvironment,
|
||||
runtimeSettings,
|
||||
securitySettings,
|
||||
runtimeMinifier,
|
||||
externalLogins,
|
||||
imageUrlGenerator,
|
||||
previewRoutes,
|
||||
emailSender,
|
||||
memberPasswordConfigurationSettings,
|
||||
StaticServiceProvider.Instance.GetRequiredService<IOptionsMonitor<DataTypesSettings>>())
|
||||
{
|
||||
}
|
||||
|
||||
public BackOfficeServerVariables(
|
||||
LinkGenerator linkGenerator,
|
||||
IRuntimeState runtimeState,
|
||||
UmbracoFeatures features,
|
||||
IOptionsMonitor<GlobalSettings> globalSettings,
|
||||
IUmbracoVersion umbracoVersion,
|
||||
IOptionsMonitor<ContentSettings> contentSettings,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
TreeCollection treeCollection,
|
||||
IHostingEnvironment hostingEnvironment,
|
||||
IOptionsMonitor<RuntimeSettings> runtimeSettings,
|
||||
IOptionsMonitor<SecuritySettings> securitySettings,
|
||||
IRuntimeMinifier runtimeMinifier,
|
||||
IBackOfficeExternalLoginProviders externalLogins,
|
||||
IImageUrlGenerator imageUrlGenerator,
|
||||
PreviewRoutes previewRoutes,
|
||||
IEmailSender emailSender,
|
||||
IOptionsMonitor<MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings,
|
||||
IOptionsMonitor<DataTypesSettings> dataTypesSettings)
|
||||
{
|
||||
_linkGenerator = linkGenerator;
|
||||
_runtimeState = runtimeState;
|
||||
@@ -91,11 +136,13 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
_previewRoutes = previewRoutes;
|
||||
_emailSender = emailSender;
|
||||
_memberPasswordConfigurationSettings = memberPasswordConfigurationSettings.CurrentValue;
|
||||
_dataTypesSettings = dataTypesSettings.CurrentValue;
|
||||
|
||||
globalSettings.OnChange(x => _globalSettings = x);
|
||||
contentSettings.OnChange(x => _contentSettings = x);
|
||||
runtimeSettings.OnChange(x => _runtimeSettings = x);
|
||||
securitySettings.OnChange(x => _securitySettings = x);
|
||||
dataTypesSettings.OnChange(x => _dataTypesSettings = x);
|
||||
memberPasswordConfigurationSettings.OnChange(x => _memberPasswordConfigurationSettings = x);
|
||||
}
|
||||
|
||||
@@ -399,6 +446,10 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
"analyticsApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl<AnalyticsController>(
|
||||
controller => controller.GetConsentLevel())
|
||||
},
|
||||
{
|
||||
"propertyTypeApiBaseUrl", _linkGenerator.GetUmbracoApiServiceBaseUrl<PropertyTypeController>(
|
||||
controller => controller.HasValues(string.Empty))
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -437,7 +488,8 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
{"showAllowSegmentationForDocumentTypes", false},
|
||||
{"minimumPasswordLength", _memberPasswordConfigurationSettings.RequiredLength},
|
||||
{"minimumPasswordNonAlphaNum", _memberPasswordConfigurationSettings.GetMinNonAlphaNumericChars()},
|
||||
{"sanitizeTinyMce", _globalSettings.SanitizeTinyMce}
|
||||
{"sanitizeTinyMce", _globalSettings.SanitizeTinyMce},
|
||||
{"dataTypesCanBeChanged", _dataTypesSettings.CanBeChanged.ToString()}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user