Merge branch temp8 into temp8-dirty-tracking-on-variants
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
[DataContract(Name = "ContentDomainsAndCulture")]
|
||||
public class ContentDomainsAndCulture
|
||||
{
|
||||
[DataMember(Name = "domains")]
|
||||
public IEnumerable<DomainDisplay> Domains { get; set; }
|
||||
|
||||
[DataMember(Name = "language")]
|
||||
public string Language { get; internal set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
[DataContract(Name = "DomainDisplay")]
|
||||
public class DomainDisplay
|
||||
{
|
||||
{
|
||||
public DomainDisplay(string name, int lang)
|
||||
{
|
||||
Name = name;
|
||||
Lang = lang;
|
||||
}
|
||||
|
||||
[DataMember(Name = "name")]
|
||||
public string Name { get; }
|
||||
|
||||
[DataMember(Name = "lang")]
|
||||
public int Lang { get; }
|
||||
|
||||
[DataMember(Name = "duplicate")]
|
||||
public bool Duplicate { get; set; }
|
||||
|
||||
[DataMember(Name = "other")]
|
||||
public string Other { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
[DataContract(Name = "DomainSave")]
|
||||
public class DomainSave
|
||||
{
|
||||
[DataMember(Name = "valid")]
|
||||
public bool Valid { get; set; }
|
||||
|
||||
[DataMember(Name = "nodeId")]
|
||||
public int NodeId { get; set; }
|
||||
|
||||
[DataMember(Name = "language")]
|
||||
public int Language { get; set; }
|
||||
|
||||
[DataMember(Name = "domains")]
|
||||
public DomainDisplay[] Domains { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,12 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
[DataMember(Name = "alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The expanded state of the tab
|
||||
/// </summary>
|
||||
[DataMember(Name = "open")]
|
||||
public bool Expanded { get; set; } = true;
|
||||
|
||||
[DataMember(Name = "properties")]
|
||||
public IEnumerable<T> Properties { get; set; }
|
||||
}
|
||||
|
||||
@@ -2,11 +2,34 @@ namespace Umbraco.Web.Models
|
||||
{
|
||||
public enum ImageCropMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Resizes the image to the given dimensions. If the set dimensions do not match the aspect ratio of the original image then the output is cropped to match the new aspect ratio.
|
||||
/// </summary>
|
||||
Crop,
|
||||
|
||||
/// <summary>
|
||||
/// Resizes the image to the given dimensions. If the set dimensions do not match the aspect ratio of the original image then the output is resized to the maximum possible value in each direction while aintaining the original aspect ratio.
|
||||
/// </summary>
|
||||
Max,
|
||||
|
||||
/// <summary>
|
||||
/// Resizes the image to the given dimensions. If the set dimensions do not match the aspect ratio of the original image then the output is stretched to match the new aspect ratio.
|
||||
/// </summary>
|
||||
Stretch,
|
||||
|
||||
/// <summary>
|
||||
/// Passing a single dimension will automatically preserve the aspect ratio of the original image. If the requested aspect ratio is different then the image will be padded to fit.
|
||||
/// </summary>
|
||||
Pad,
|
||||
|
||||
/// <summary>
|
||||
/// When upscaling an image the image pixels themselves are not resized, rather the image is padded to fit the given dimensions.
|
||||
/// </summary>
|
||||
BoxPad,
|
||||
|
||||
/// <summary>
|
||||
/// Resizes the image until the shortest side reaches the set given dimension. This will maintain the aspect ratio of the original image. Upscaling is disabled in this mode and the original image will be returned if attempted.
|
||||
/// </summary>
|
||||
Min
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,8 @@ namespace Umbraco.Web.Models.Mapping
|
||||
.ForMember(tab => tab.Label, expression => expression.MapFrom(@group => @group.Name))
|
||||
.ForMember(tab => tab.IsActive, expression => expression.UseValue(true))
|
||||
.ForMember(tab => tab.Properties, expression => expression.Ignore())
|
||||
.ForMember(tab => tab.Alias, expression => expression.Ignore());
|
||||
.ForMember(tab => tab.Alias, expression => expression.Ignore())
|
||||
.ForMember(tab => tab.Expanded, expression => expression.Ignore());
|
||||
|
||||
//FROM Property TO ContentPropertyBasic
|
||||
CreateMap<Property, ContentPropertyBasic>().ConvertUsing(contentPropertyBasicConverter);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
//FROM MembershipUser TO IMember - used when using a non-umbraco membership provider
|
||||
CreateMap<MembershipUser, IMember>()
|
||||
.ConstructUsing(src => MemberService.CreateGenericMembershipProviderMember(src.UserName, src.Email, src.UserName, ""))
|
||||
//we're giving this entity an ID of 0 - we cannot really map it but it needs an id so the system knows it's not a new entity
|
||||
//we're giving this entity an ID of int.MaxValue - TODO: SD: I can't remember why this mapping is here?
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => int.MaxValue))
|
||||
.ForMember(dest => dest.Comments, opt => opt.MapFrom(src => src.Comment))
|
||||
.ForMember(dest => dest.CreateDate, opt => opt.MapFrom(src => src.CreationDate))
|
||||
@@ -84,6 +84,8 @@ namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
//FROM IMember TO MemberBasic
|
||||
CreateMap<IMember, MemberBasic>()
|
||||
//we're giving this entity an ID of int.MaxValue - this is kind of a hack to force angular to use the Key instead of the Id in list views
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => int.MaxValue))
|
||||
.ForMember(dest => dest.Udi, opt => opt.MapFrom(content => Udi.Create(Constants.UdiEntityType.Member, content.Key)))
|
||||
.ForMember(dest => dest.Owner, opt => opt.ResolveUsing(src => memberOwnerResolver.Resolve(src)))
|
||||
.ForMember(dest => dest.Icon, opt => opt.MapFrom(src => src.ContentType.Icon))
|
||||
@@ -99,7 +101,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
//FROM MembershipUser TO MemberBasic
|
||||
CreateMap<MembershipUser, MemberBasic>()
|
||||
//we're giving this entity an ID of 0 - we cannot really map it but it needs an id so the system knows it's not a new entity
|
||||
//we're giving this entity an ID of int.MaxValue - TODO: SD: I can't remember why this mapping is here?
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => int.MaxValue))
|
||||
.ForMember(dest => dest.Udi, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.CreateDate, opt => opt.MapFrom(src => src.CreationDate))
|
||||
@@ -142,8 +144,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
.ForMember(dest => dest.Icon, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Trashed, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.ParentId, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Alias, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Path, opt => opt.Ignore());
|
||||
.ForMember(dest => dest.Alias, opt => opt.Ignore());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
}
|
||||
else
|
||||
{
|
||||
var umbracoProvider = (IUmbracoMemberTypeMembershipProvider) provider;
|
||||
var umbracoProvider = (IUmbracoMemberTypeMembershipProvider)provider;
|
||||
|
||||
//This is kind of a hack because a developer is supposed to be allowed to set their property editor - would have been much easier
|
||||
// if we just had all of the membeship provider fields on the member table :(
|
||||
@@ -112,11 +112,18 @@ namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
protected override IEnumerable<ContentPropertyDisplay> GetCustomGenericProperties(IContentBase content)
|
||||
{
|
||||
var member = (IMember) content;
|
||||
var member = (IMember)content;
|
||||
var membersProvider = Core.Security.MembershipProviderExtensions.GetMembersMembershipProvider();
|
||||
|
||||
var genericProperties = new List<ContentPropertyDisplay>
|
||||
{
|
||||
new ContentPropertyDisplay
|
||||
{
|
||||
Alias = $"{Constants.PropertyEditors.InternalGenericPropertiesPrefix}id",
|
||||
Label = _localizedTextService.Localize("general/id"),
|
||||
Value = new List<string> {member.Id.ToString(), member.Key.ToString()},
|
||||
View = "idwithguid"
|
||||
},
|
||||
new ContentPropertyDisplay
|
||||
{
|
||||
Alias = $"{Constants.PropertyEditors.InternalGenericPropertiesPrefix}doctype",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the node style to show that it is currently protected publicly
|
||||
/// Sets the node style to show that it is a container type
|
||||
/// </summary>
|
||||
/// <param name="treeNode"></param>
|
||||
public static void SetContainerStyle(this TreeNode treeNode)
|
||||
|
||||
Reference in New Issue
Block a user