Fix failing tests by adding property group aliases

This commit is contained in:
Ronald Barendse
2021-07-14 13:54:26 +02:00
parent 94c864f6fc
commit 891bd437db
4 changed files with 25 additions and 23 deletions

View File

@@ -478,6 +478,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 222,
Name = "Group 1",
Alias = "group1",
SortOrder = 1,
Properties = new[]
{
@@ -549,6 +550,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 222,
Name = "Group 1",
Alias = "group1",
SortOrder = 1,
Properties = new[]
{
@@ -961,6 +963,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 987,
Name = "Tab 1",
Alias = "tab1",
SortOrder = 0,
Inherited = false,
Properties = new[]
@@ -1010,6 +1013,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 987,
Name = "Tab 1",
Alias = "tab1",
SortOrder = 0,
Inherited = false,
Properties = new[]
@@ -1062,6 +1066,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 987,
Name = "Tab 1",
Alias = "tab1",
SortOrder = 0,
Inherited = false,
Properties = new[]
@@ -1109,6 +1114,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 987,
Name = "Tab 1",
Alias = "tab1",
SortOrder = 0,
Inherited = false,
Properties = new[]
@@ -1134,6 +1140,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 894,
Name = "Tab 2",
Alias = "tab2",
SortOrder = 0,
Inherited = true,
Properties = new[]
@@ -1189,6 +1196,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 987,
Name = "Tab 1",
Alias = "tab1",
SortOrder = 0,
Inherited = false,
Properties = new[]
@@ -1214,6 +1222,7 @@ namespace Umbraco.Tests.Models.Mapping
{
Id = 894,
Name = "Tab 2",
Alias = "tab2",
SortOrder = 0,
Inherited = true,
Properties = new[]

View File

@@ -434,9 +434,12 @@ namespace Umbraco.Tests.Persistence.Repositories
{
Inherited = x.Inherited,
Id = x.Id,
Properties = x.Properties,
Key = x.Key,
Type = x.Type,
Name = x.Name,
Alias = x.Alias,
SortOrder = x.SortOrder,
Name = x.Name
Properties = x.Properties
}).ToArray()
};
}

View File

@@ -298,9 +298,7 @@ namespace Umbraco.Web.Models.Mapping
// Umbraco.Code.MapAll -CreateDate -UpdateDate -DeleteDate -Key -PropertyTypes
private static void Map(PropertyGroupBasic<PropertyTypeBasic> source, PropertyGroup target, MapperContext context)
{
if (source.Id > 0)
target.Id = source.Id;
target.Id = source.Id;
target.Key = source.Key;
target.Type = source.Type;
target.Name = source.Name;
@@ -311,9 +309,7 @@ namespace Umbraco.Web.Models.Mapping
// Umbraco.Code.MapAll -CreateDate -UpdateDate -DeleteDate -Key -PropertyTypes
private static void Map(PropertyGroupBasic<MemberPropertyTypeBasic> source, PropertyGroup target, MapperContext context)
{
if (source.Id > 0)
target.Id = source.Id;
target.Id = source.Id;
target.Key = source.Key;
target.Type = source.Type;
target.Name = source.Name;
@@ -324,32 +320,26 @@ namespace Umbraco.Web.Models.Mapping
// Umbraco.Code.MapAll -ContentTypeId -ParentTabContentTypes -ParentTabContentTypeNames
private static void Map(PropertyGroupBasic<PropertyTypeBasic> source, PropertyGroupDisplay<PropertyTypeDisplay> target, MapperContext context)
{
if (source.Id > 0)
target.Id = source.Id;
target.Inherited = source.Inherited;
target.Id = source.Id;
target.Key = source.Key;
target.Type = source.Type;
target.Name = source.Name;
target.Alias = source.Alias;
target.SortOrder = source.SortOrder;
target.Inherited = source.Inherited;
target.Properties = context.MapEnumerable<PropertyTypeBasic, PropertyTypeDisplay>(source.Properties);
}
// Umbraco.Code.MapAll -ContentTypeId -ParentTabContentTypes -ParentTabContentTypeNames
private static void Map(PropertyGroupBasic<MemberPropertyTypeBasic> source, PropertyGroupDisplay<MemberPropertyTypeDisplay> target, MapperContext context)
{
if (source.Id > 0)
target.Id = source.Id;
target.Inherited = source.Inherited;
target.Id = source.Id;
target.Key = source.Key;
target.Type = source.Type;
target.Name = source.Name;
target.Alias = source.Alias;
target.SortOrder = source.SortOrder;
target.Inherited = source.Inherited;
target.Properties = context.MapEnumerable<MemberPropertyTypeBasic, MemberPropertyTypeDisplay>(source.Properties);
}

View File

@@ -80,10 +80,10 @@ namespace Umbraco.Web.Models.Mapping
Name = propertyGroup.Name,
Alias = propertyGroup.Alias,
SortOrder = propertyGroup.SortOrder,
Properties = MapProperties(propertyGroup.PropertyTypes, source, propertyGroup.Id, false),
ContentTypeId = source.Id
};
group.Properties = MapProperties(propertyGroup.PropertyTypes, source, propertyGroup.Id, false);
groups.Add(group);
}
@@ -101,19 +101,19 @@ namespace Umbraco.Web.Models.Mapping
var group = new PropertyGroupDisplay<TPropertyType>
{
Inherited = true,
Id = propertyGroup.Id,
Key = propertyGroup.Key,
Type = propertyGroup.Type,
Name = propertyGroup.Name,
Alias = propertyGroup.Alias,
SortOrder = propertyGroup.SortOrder,
Inherited = true,
Properties = MapProperties(propertyGroup.PropertyTypes, definingContentType, propertyGroup.Id, true),
ContentTypeId = definingContentType.Id,
ParentTabContentTypes = new[] { definingContentType.Id },
ParentTabContentTypeNames = new[] { definingContentType.Name }
};
group.Properties = MapProperties(propertyGroup.PropertyTypes, definingContentType, propertyGroup.Id, true);
groups.Add(group);
}
@@ -145,8 +145,8 @@ namespace Umbraco.Web.Models.Mapping
Id = PropertyGroupBasic.GenericPropertiesGroupId,
Name = "Generic properties",
SortOrder = 999,
ContentTypeId = source.Id,
Properties = genericProperties
Properties = genericProperties,
ContentTypeId = source.Id
};
groups.Add(genericGroup);