Merge branch 'netcore/dev' into feature/7371-short-string-helper

# Conflicts:
#	src/Umbraco.Core/StringExtensions.cs
#	src/Umbraco.Core/TypeExtensions.cs
#	src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
#	src/Umbraco.Infrastructure/Persistence/Factories/DataTypeFactory.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DataTypeRepository.cs
#	src/Umbraco.ModelsBuilder.Embedded/Compose/ModelsBuilderComponent.cs
#	src/Umbraco.ModelsBuilder.Embedded/UmbracoServices.cs
#	src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
#	src/Umbraco.Tests/Persistence/Repositories/DocumentRepositoryTest.cs
#	src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs
#	src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs
#	src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs
#	src/Umbraco.Tests/Strings/StringExtensionsTests.cs
#	src/Umbraco.Tests/Web/Controllers/ContentControllerTests.cs
#	src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs
#	src/Umbraco.Web/Editors/CodeFileController.cs
#	src/Umbraco.Web/Editors/ContentController.cs
#	src/Umbraco.Web/Editors/ContentControllerBase.cs
#	src/Umbraco.Web/Editors/ContentTypeController.cs
#	src/Umbraco.Web/Editors/CurrentUserController.cs
#	src/Umbraco.Web/Editors/DashboardController.cs
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/Editors/MacroRenderingController.cs
#	src/Umbraco.Web/Editors/MacrosController.cs
#	src/Umbraco.Web/Editors/MediaController.cs
#	src/Umbraco.Web/Editors/MemberController.cs
#	src/Umbraco.Web/Editors/RelationTypeController.cs
#	src/Umbraco.Web/Editors/TinyMceController.cs
#	src/Umbraco.Web/Editors/UsersController.cs
#	src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
#	src/Umbraco.Web/Models/Mapping/UserMapDefinition.cs
#	src/Umbraco.Web/Mvc/RenderRouteHandler.cs
#	src/Umbraco.Web/PropertyEditors/RichTextEditorPastedImages.cs
#	src/Umbraco.Web/Runtime/WebInitialComponent.cs
#	src/Umbraco.Web/Templates/TemplateRenderer.cs
This commit is contained in:
Andy Butland
2019-12-24 09:08:47 +01:00
561 changed files with 964 additions and 1126 deletions

View File

@@ -6,6 +6,7 @@ using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models.Membership;
using Umbraco.Web.Models.ContentEditing;
@@ -28,10 +29,11 @@ namespace Umbraco.Web.Models.Mapping
private readonly ActionCollection _actions;
private readonly AppCaches _appCaches;
private readonly IGlobalSettings _globalSettings;
private readonly IMediaFileSystem _mediaFileSystem;
private readonly IShortStringHelper _shortStringHelper;
public UserMapDefinition(ILocalizedTextService textService, IUserService userService, IEntityService entityService, ISectionService sectionService,
AppCaches appCaches, ActionCollection actions, IGlobalSettings globalSettings, IShortStringHelper shortStringHelper)
AppCaches appCaches, ActionCollection actions, IGlobalSettings globalSettings, IMediaFileSystem mediaFileSystem, IShortStringHelper shortStringHelper)
{
_sectionService = sectionService;
_entityService = entityService;
@@ -40,6 +42,7 @@ namespace Umbraco.Web.Models.Mapping
_actions = actions;
_appCaches = appCaches;
_globalSettings = globalSettings;
_mediaFileSystem = mediaFileSystem;
_shortStringHelper = shortStringHelper;
}
@@ -276,7 +279,7 @@ namespace Umbraco.Web.Models.Mapping
private void Map(IUser source, UserDisplay target, MapperContext context)
{
target.AvailableCultures = _textService.GetSupportedCultures().ToDictionary(x => x.Name, x => x.DisplayName);
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache);
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache, _mediaFileSystem);
target.CalculatedStartContentIds = GetStartNodes(source.CalculateContentStartNodeIds(_entityService), UmbracoObjectTypes.Document, "content/contentRoot", context);
target.CalculatedStartMediaIds = GetStartNodes(source.CalculateMediaStartNodeIds(_entityService), UmbracoObjectTypes.Media, "media/mediaRoot", context);
target.CreateDate = source.CreateDate;
@@ -307,7 +310,7 @@ namespace Umbraco.Web.Models.Mapping
//Loading in the user avatar's requires an external request if they don't have a local file avatar, this means that initial load of paging may incur a cost
//Alternatively, if this is annoying the back office UI would need to be updated to request the avatars for the list of users separately so it doesn't look
//like the load time is waiting.
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache);
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache, _mediaFileSystem);
target.Culture = source.GetUserCulture(_textService, _globalSettings).ToString();
target.Email = source.Email;
target.EmailHash = source.Email.ToLowerInvariant().Trim().GenerateHash();
@@ -326,7 +329,7 @@ namespace Umbraco.Web.Models.Mapping
private void Map(IUser source, UserDetail target, MapperContext context)
{
target.AllowedSections = source.AllowedSections;
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache);
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache, _mediaFileSystem);
target.Culture = source.GetUserCulture(_textService, _globalSettings).ToString();
target.Email = source.Email;
target.EmailHash = source.Email.ToLowerInvariant().Trim().GenerateHash();