Remove relations for the RelationType overview

This commit is contained in:
Warren Buckley
2019-11-11 15:16:19 +00:00
parent f553868503
commit 8dcec429d3
2 changed files with 0 additions and 29 deletions

View File

@@ -47,13 +47,6 @@ namespace Umbraco.Web.Models.ContentEditing
[ReadOnly(true)]
public string ChildObjectTypeName { get; set; }
/// <summary>
/// Gets or sets the relations associated with this relation type.
/// </summary>
[DataMember(Name = "relations")]
[ReadOnly(true)]
public IEnumerable<RelationDisplay> Relations { get; set; }
/// <summary>
/// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes.
/// </summary>

View File

@@ -51,28 +51,6 @@ namespace Umbraco.Web.Models.Mapping
var objType = ObjectTypes.GetUmbracoObjectType(source.ChildObjectType.Value);
target.ChildObjectTypeName = objType.GetFriendlyName();
}
// Load the relations
var relations = _relationService.GetByRelationTypeId(source.Id);
var displayRelations = context.MapEnumerable<IRelation, RelationDisplay>(relations);
// Load the entities
var entities = _relationService.GetEntitiesFromRelations(relations)
.ToDictionary(x => (x.Item1.Id, x.Item2.Id), x => x);
foreach(var r in displayRelations)
{
var pair = entities[(r.ParentId, r.ChildId)];
var parent = pair.Item1;
var child = pair.Item2;
r.ChildName = child.Name;
r.ParentName = parent.Name;
}
target.Relations = displayRelations;
}
// Umbraco.Code.MapAll -ParentName -ChildName