Orders the grouped trees by name (which means the custom trees will be last now)

Displays custom third party group - only if we have items to show in that group
This commit is contained in:
Warren Buckley
2018-10-10 12:25:19 +01:00
parent e2d3cbc8eb
commit f1b20ebbb2

View File

@@ -27,7 +27,6 @@ namespace Umbraco.Web.Trees
Current.Services.ApplicationTreeService.GetAllTypes()
.Select(x => (TreeType: x, TreeGroup: x.GetCustomAttribute<CoreTreeAttribute>(false)?.TreeGroup))
.GroupBy(x => x.TreeGroup)
.OrderByDescending(x => x.Key)
.ToList());
@@ -135,13 +134,16 @@ namespace Umbraco.Web.Trees
treeGroupName = "thirdPartyGroup";
}
var groupRoot = SectionRootNode.CreateMultiTreeSectionRoot(rootId, groupNodeCollection);
groupRoot.Name = Services.TextService.Localize("treeHeaders/" + treeGroupName);
if (groupNodeCollection.Any())
{
var groupRoot = SectionRootNode.CreateMultiTreeSectionRoot(rootId, groupNodeCollection);
groupRoot.Name = Services.TextService.Localize("treeHeaders/" + treeGroupName);
rootNodeGroups.Add(groupRoot);
rootNodeGroups.Add(groupRoot);
}
}
return rootNodeGroups;
return rootNodeGroups.OrderBy(x => x.Name);
}
/// <summary>