Few more NRT tweaks (#12323)

* Amended GetAll() on IDataTypeService to return an empty collection rather than null.

* Added a ClearSessionValue method to ISessionManager (given you can no longer set a value to null).

* Allow for null values in a StatefulNotification.

* Removed obsoletion of synchronous messages on TreeControllerBase.

* Fixed further CS8620 warnings in core project.

* Further fix to nullable warning.

* Aligned nullablility of retreiving tree nodes and menus, synchronously or asynchronously (such that we no longer can get null values, always empty collection objects).
This commit is contained in:
Andy Butland
2022-05-01 08:18:09 +02:00
committed by GitHub
parent d47ae6868b
commit 96d33201aa
31 changed files with 102 additions and 77 deletions

View File

@@ -17,24 +17,28 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
[CoreTree]
public class LogViewerTreeController : TreeController
{
private readonly IMenuItemCollectionFactory _menuItemCollectionFactory;
public LogViewerTreeController(
ILocalizedTextService localizedTextService,
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
IEventAggregator eventAggregator)
IEventAggregator eventAggregator,
IMenuItemCollectionFactory menuItemCollectionFactory)
: base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
{
_menuItemCollectionFactory = menuItemCollectionFactory;
}
protected override ActionResult<TreeNodeCollection?> GetTreeNodes(string id, FormCollection queryStrings)
protected override ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)
{
//We don't have any child nodes & only use the root node to load a custom UI
return new TreeNodeCollection();
}
protected override ActionResult<MenuItemCollection>? GetMenuForNode(string id, FormCollection queryStrings)
protected override ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings)
{
//We don't have any menu item options (such as create/delete/reload) & only use the root node to load a custom UI
return null;
return _menuItemCollectionFactory.Create();
}
/// <summary>