Port 7.7 - WIP

This commit is contained in:
Stephan
2017-09-14 11:41:46 +02:00
parent 37171d96bc
commit 4634eb28e7
45 changed files with 312 additions and 359 deletions

View File

@@ -136,7 +136,7 @@ namespace Umbraco.Web.Models.Mapping
Label = localizedText.Localize("content/releaseDate"),
Value = display.ReleaseDate?.ToIsoString(),
//Not editible for people without publish permission (U4-287)
View = display.AllowedActions.Contains(ActionPublish.Instance.Letter) ? "datepicker" : Current.PropertyEditors[Constants.PropertyEditors.NoEditAlias].ValueEditor.View,
View = display.AllowedActions.Contains(ActionPublish.Instance.Letter.ToString(CultureInfo.InvariantCulture)) ? "datepicker" : Current.PropertyEditors[Constants.PropertyEditors.NoEditAlias].ValueEditor.View,
Config = new Dictionary<string, object>
{
{"offsetTime", "1"}
@@ -149,7 +149,7 @@ namespace Umbraco.Web.Models.Mapping
Label = localizedText.Localize("content/unpublishDate"),
Value = display.ExpireDate.HasValue ? display.ExpireDate.Value.ToIsoString() : null,
//Not editible for people without publish permission (U4-287)
View = display.AllowedActions.Contains(ActionPublish.Instance.Letter) ? "datepicker" : Current.PropertyEditors[Constants.PropertyEditors.NoEditAlias].ValueEditor.View,
View = display.AllowedActions.Contains(ActionPublish.Instance.Letter.ToString(CultureInfo.InvariantCulture)) ? "datepicker" : Current.PropertyEditors[Constants.PropertyEditors.NoEditAlias].ValueEditor.View,
Config = new Dictionary<string, object>
{
{"offsetTime", "1"}

View File

@@ -78,16 +78,16 @@ namespace Umbraco.Web.Models.Mapping
CreateMap<MemberTypeSave, IMemberType>()
//do the base mapping
.MapBaseContentTypeSaveToEntity<MemberTypeSave, MemberPropertyTypeBasic, IMemberType>()
.ConstructUsing((source) => new MemberType(source.ParentId))
.ConstructUsing(source => new MemberType(source.ParentId))
.AfterMap((source, dest) =>
{
ContentTypeProfileExtensions.AfterMapContentTypeSaveToEntity(source, dest, _contentTypeService);
//map the MemberCanEditProperty,MemberCanViewProperty
foreach (var propertyType in source.Groups.SelectMany(dest => dest.Properties))
foreach (var propertyType in source.Groups.SelectMany(x => x.Properties))
{
var localCopy = propertyType;
var destProp = dest.PropertyTypes.SingleOrDefault(dest => dest.Alias.InvariantEquals(localCopy.Alias));
var destProp = dest.PropertyTypes.SingleOrDefault(x => x.Alias.InvariantEquals(localCopy.Alias));
if (destProp != null)
{
dest.SetMemberCanEditProperty(localCopy.Alias, localCopy.MemberCanEditProperty);
@@ -216,7 +216,7 @@ namespace Umbraco.Web.Models.Mapping
.AfterMap((source, dest) =>
{
//sync templates
var destAllowedTemplateAliases = dest.AllowedTemplates.Select(dest => dest.Alias);
var destAllowedTemplateAliases = dest.AllowedTemplates.Select(x => x.Alias);
//if the dest is set and it's the same as the source, then don't change
if (destAllowedTemplateAliases.SequenceEqual(source.AllowedTemplates) == false)
{

View File

@@ -13,7 +13,6 @@ using System.Linq;
using Umbraco.Core.Security;
using Umbraco.Web.Composing;
using Umbraco.Web.Trees;
using UserProfile = Umbraco.Web.Models.ContentEditing.UserProfile;
namespace Umbraco.Web.Models.Mapping
{
@@ -111,7 +110,7 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.CreateDate, opt => opt.MapFrom(src => src.CreationDate))
.ForMember(dest => dest.UpdateDate, opt => opt.MapFrom(src => src.LastActivityDate))
.ForMember(dest => dest.Key, opt => opt.MapFrom(src => src.ProviderUserKey.TryConvertTo<Guid>().Result.ToString("N")))
.ForMember(dest => dest.Owner, opt => opt.UseValue(new UserProfile {Name = "Admin", UserId = 0}))
.ForMember(dest => dest.Owner, opt => opt.UseValue(new ContentEditing.UserProfile {Name = "Admin", UserId = 0}))
.ForMember(dest => dest.Icon, opt => opt.UseValue("icon-user"))
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.UserName))
.ForMember(dest => dest.Email, opt => opt.MapFrom(src => src.Email))

View File

@@ -345,7 +345,7 @@ namespace Umbraco.Web.Models.Mapping
});
CreateMap<IProfile, UserProfile>()
CreateMap<IProfile, ContentEditing.UserProfile>()
.ForMember(dest => dest.UserId, opt => opt.MapFrom(profile => GetIntId(profile.Id)));
CreateMap<IUser, UserData>()