V8: Use member type icon in member pickers (#6696)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
6a8d3141c9
commit
b1037786ca
@@ -42,9 +42,6 @@ namespace Umbraco.Web.Models.Mapping
|
||||
target.Trashed = source.Trashed;
|
||||
target.Udi = Udi.Create(ObjectTypes.GetUdiType(source.NodeObjectType), source.Key);
|
||||
|
||||
if (source.NodeObjectType == Constants.ObjectTypes.Member && target.Icon.IsNullOrWhiteSpace())
|
||||
target.Icon = Constants.Icons.Member;
|
||||
|
||||
if (source is IContentEntitySlim contentSlim)
|
||||
{
|
||||
source.AdditionalData["ContentTypeAlias"] = contentSlim.ContentTypeAlias;
|
||||
@@ -226,7 +223,18 @@ namespace Umbraco.Web.Models.Mapping
|
||||
}
|
||||
|
||||
private static string MapContentTypeIcon(IEntitySlim entity)
|
||||
=> entity is ContentEntitySlim contentEntity ? contentEntity.ContentTypeIcon : null;
|
||||
{
|
||||
switch (entity)
|
||||
{
|
||||
case ContentEntitySlim contentEntity:
|
||||
// NOTE: this case covers both content and media entities
|
||||
return contentEntity.ContentTypeIcon;
|
||||
case MemberEntitySlim memberEntity:
|
||||
return memberEntity.ContentTypeIcon.IfNullOrWhiteSpace(Constants.Icons.Member);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string MapName(IEntitySlim source, MapperContext context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user