Fixes tests and issue with member list view not passing the GUID along in the route

This commit is contained in:
Shannon
2018-10-23 22:10:27 +11:00
parent fa64f4a6a8
commit dfd3e8f4c4
3 changed files with 9 additions and 7 deletions

View File

@@ -243,7 +243,7 @@ namespace Umbraco.Core.Migrations.Install
private void CreateDataTypeData()
{
void InsertDataTypeDto(int id, string dbType, string editorAlias, string configuration = null)
void InsertDataTypeDto(int id, string editorAlias, string dbType, string configuration = null)
{
var dataTypeDto = new DataTypeDto
{

View File

@@ -77,10 +77,10 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
}
else {
//so, we usually refernce all editors with the Int ID, but with members we have
//a different pattern, adding a route-redirect here to handle this:
//isNumber doesnt work here since its seen as a string
//TODO: Why is this here - I don't understand why this would ever be an integer? This will not work when we support non-umbraco membership providers.
//a different pattern, adding a route-redirect here to handle this just in case.
//(isNumber doesnt work here since its seen as a string)
//The reason this might be an INT is due to the routing used for the member list view
//but this is now configured to use the key, so this is just a fail safe
if ($routeParams.id && $routeParams.id.length < 9) {

View File

@@ -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))