Fixes: U4-7021 "Actions" dropdown not available to children in listview nodes
This commit is contained in:
@@ -51,11 +51,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
.ForMember(
|
||||
dto => dto.IsContainer,
|
||||
expression => expression.MapFrom(content => content.ContentType.IsContainer))
|
||||
.ForMember(
|
||||
dto => dto.IsChildOfListView,
|
||||
//TODO: Fix this shorthand .Parent() lookup, at least have an overload to use the current
|
||||
// application context so it's testable!
|
||||
expression => expression.MapFrom(content => content.Parent().ContentType.IsContainer))
|
||||
.ForMember(display => display.IsChildOfListView, expression => expression.Ignore())
|
||||
.ForMember(
|
||||
dto => dto.Trashed,
|
||||
expression => expression.MapFrom(content => content.Trashed))
|
||||
@@ -121,6 +117,11 @@ namespace Umbraco.Web.Models.Mapping
|
||||
/// <param name="localizedText"></param>
|
||||
private static void AfterMap(IContent content, ContentItemDisplay display, IDataTypeService dataTypeService, ILocalizedTextService localizedText)
|
||||
{
|
||||
//map the IsChildOfListView (this is actually if it is a descendant of a list view!)
|
||||
//TODO: Fix this shorthand .Ancestors() lookup, at least have an overload to use the current
|
||||
var ancesctorListView = content.Ancestors().FirstOrDefault(x => x.ContentType.IsContainer);
|
||||
display.IsChildOfListView = ancesctorListView != null;
|
||||
|
||||
//map the tree node url
|
||||
if (HttpContext.Current != null)
|
||||
{
|
||||
|
||||
@@ -35,11 +35,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
.ForMember(
|
||||
dto => dto.ContentTypeAlias,
|
||||
expression => expression.MapFrom(content => content.ContentType.Alias))
|
||||
.ForMember(
|
||||
dto => dto.IsChildOfListView,
|
||||
//TODO: Fix this shorthand .Parent() lookup, at least have an overload to use the current
|
||||
// application context so it's testable!
|
||||
expression => expression.MapFrom(content => content.Parent().ContentType.IsContainer))
|
||||
.ForMember(display => display.IsChildOfListView, expression => expression.Ignore())
|
||||
.ForMember(
|
||||
dto => dto.Trashed,
|
||||
expression => expression.MapFrom(content => content.Trashed))
|
||||
|
||||
Reference in New Issue
Block a user