Merge pull request #7356 from umbraco/netcore/feature/AB4227-move-files-to-infrastructure
Netcore/feature/ab4227 move files to infrastructure
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
using System.Runtime.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.ContentEditing;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
@@ -8,11 +12,30 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
[DataContract(Name = "content", Namespace = "")]
|
||||
public class MemberDisplay : ListViewAwareContentItemDisplayBase<ContentPropertyDisplay>
|
||||
{
|
||||
public MemberDisplay()
|
||||
{
|
||||
// MemberProviderFieldMapping = new Dictionary<string, string>();
|
||||
ContentApps = new List<ContentApp>();
|
||||
}
|
||||
|
||||
[DataMember(Name = "username")]
|
||||
public string Username { get; set; }
|
||||
|
||||
[DataMember(Name = "email")]
|
||||
public string Email { get; set; }
|
||||
|
||||
//[DataMember(Name = "membershipScenario")]
|
||||
//public MembershipScenario MembershipScenario { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// This is used to indicate how to map the membership provider properties to the save model, this mapping
|
||||
// /// will change if a developer has opted to have custom member property aliases specified in their membership provider config,
|
||||
// /// or if we are editing a member that is not an Umbraco member (custom provider)
|
||||
// /// </summary>
|
||||
// [DataMember(Name = "fieldConfig")]
|
||||
// public IDictionary<string, string> MemberProviderFieldMapping { get; set; }
|
||||
|
||||
[DataMember(Name = "apps")]
|
||||
public IEnumerable<ContentApp> ContentApps { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Umbraco.Core.Dictionary;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Mapping;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
using Umbraco.Web.Trees;
|
||||
@@ -20,15 +21,17 @@ namespace Umbraco.Web.Models.Mapping
|
||||
private readonly ILogger _logger;
|
||||
private readonly IMediaService _mediaService;
|
||||
private readonly IMediaTypeService _mediaTypeService;
|
||||
private readonly PropertyEditorCollection _propertyEditorCollection;
|
||||
private readonly TabsAndPropertiesMapper<IMedia> _tabsAndPropertiesMapper;
|
||||
|
||||
public MediaMapDefinition(ICultureDictionary cultureDictionary, ILogger logger, CommonMapper commonMapper, IMediaService mediaService, IMediaTypeService mediaTypeService,
|
||||
ILocalizedTextService localizedTextService)
|
||||
ILocalizedTextService localizedTextService, PropertyEditorCollection propertyEditorCollection)
|
||||
{
|
||||
_logger = logger;
|
||||
_commonMapper = commonMapper;
|
||||
_mediaService = mediaService;
|
||||
_mediaTypeService = mediaTypeService;
|
||||
_propertyEditorCollection = propertyEditorCollection;
|
||||
|
||||
_tabsAndPropertiesMapper = new TabsAndPropertiesMapper<IMedia>(cultureDictionary, localizedTextService);
|
||||
}
|
||||
@@ -59,7 +62,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
target.Id = source.Id;
|
||||
target.IsChildOfListView = DermineIsChildOfListView(source);
|
||||
target.Key = source.Key;
|
||||
target.MediaLink = string.Join(",", source.GetUrls(Current.Configs.Settings().Content, _logger));
|
||||
target.MediaLink = string.Join(",", source.GetUrls(Current.Configs.Settings().Content, _logger, _propertyEditorCollection));
|
||||
target.Name = source.Name;
|
||||
target.Owner = _commonMapper.GetOwner(source, context);
|
||||
target.ParentId = source.ParentId;
|
||||
|
||||
@@ -26,12 +26,13 @@ namespace Umbraco.Web.Models.Mapping
|
||||
mapper.Define<IMember, MemberBasic>((source, context) => new MemberBasic(), Map);
|
||||
mapper.Define<IMemberGroup, MemberGroupDisplay>((source, context) => new MemberGroupDisplay(), Map);
|
||||
mapper.Define<IMember, ContentPropertyCollectionDto>((source, context) => new ContentPropertyCollectionDto(), Map);
|
||||
}
|
||||
}
|
||||
|
||||
// Umbraco.Code.MapAll -Properties -Errors -Edited -Updater -Alias -IsChildOfListView
|
||||
// Umbraco.Code.MapAll -Trashed -IsContainer -VariesByCulture
|
||||
private void Map(IMember source, MemberDisplay target, MapperContext context)
|
||||
{
|
||||
target.ContentApps = _commonMapper.GetContentApps(source);
|
||||
target.ContentTypeId = source.ContentType.Id;
|
||||
target.ContentTypeAlias = source.ContentType.Alias;
|
||||
target.ContentTypeName = source.ContentType.Name;
|
||||
|
||||
Reference in New Issue
Block a user