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:
@@ -16,18 +16,24 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
|
||||
public class StaticFilesTreeController : TreeController
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly IMenuItemCollectionFactory _menuItemCollectionFactory;
|
||||
|
||||
private const string AppPlugins = "App_Plugins";
|
||||
private const string Webroot = "wwwroot";
|
||||
|
||||
public StaticFilesTreeController(ILocalizedTextService localizedTextService,
|
||||
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IEventAggregator eventAggregator,
|
||||
IPhysicalFileSystem fileSystem) :
|
||||
base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
|
||||
public StaticFilesTreeController(
|
||||
ILocalizedTextService localizedTextService,
|
||||
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
|
||||
IEventAggregator eventAggregator,
|
||||
IPhysicalFileSystem fileSystem,
|
||||
IMenuItemCollectionFactory menuItemCollectionFactory)
|
||||
: base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
_menuItemCollectionFactory = menuItemCollectionFactory;
|
||||
}
|
||||
|
||||
protected override ActionResult<TreeNodeCollection?> GetTreeNodes(string id, FormCollection queryStrings)
|
||||
protected override ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)
|
||||
{
|
||||
var path = string.IsNullOrEmpty(id) == false && id != Constants.System.RootString
|
||||
? WebUtility.UrlDecode(id).TrimStart("/")
|
||||
@@ -73,6 +79,6 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
|
||||
}
|
||||
|
||||
// We don't have any menu item options (such as create/delete/reload) & only use the root node to load a custom UI
|
||||
protected override ActionResult<MenuItemCollection>? GetMenuForNode(string id, FormCollection queryStrings) => null;
|
||||
protected override ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings) => _menuItemCollectionFactory.Create();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user