Fixes tree init logic when user isn't logged in, moves sequential promise chaining to a helper funciton, updates the route promise chaining to actual chain.
This commit is contained in:
@@ -38,17 +38,6 @@ using JArray = Newtonsoft.Json.Linq.JArray;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
{
|
||||
public class BackOfficeModel
|
||||
{
|
||||
public BackOfficeModel(string path, UmbracoFeatures features)
|
||||
{
|
||||
Path = path;
|
||||
Features = features;
|
||||
}
|
||||
|
||||
public string Path { get; }
|
||||
public UmbracoFeatures Features { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a controller user to render out the default back office view and JS results.
|
||||
@@ -85,8 +74,8 @@ namespace Umbraco.Web.Editors
|
||||
public async Task<ActionResult> Default()
|
||||
{
|
||||
return await RenderDefaultOrProcessExternalLoginAsync(
|
||||
() => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/Default.cshtml", new BackOfficeModel(GlobalSettings.Path, _features)),
|
||||
() => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/Default.cshtml", new BackOfficeModel(GlobalSettings.Path, _features)));
|
||||
() => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/Default.cshtml", new BackOfficeModel(_features, GlobalSettings)),
|
||||
() => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/Default.cshtml", new BackOfficeModel(_features, GlobalSettings)));
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
@@ -159,7 +148,7 @@ namespace Umbraco.Web.Editors
|
||||
{
|
||||
return await RenderDefaultOrProcessExternalLoginAsync(
|
||||
//The default view to render when there is no external login info or errors
|
||||
() => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/AuthorizeUpgrade.cshtml", new BackOfficeModel(GlobalSettings.Path, _features)),
|
||||
() => View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/AuthorizeUpgrade.cshtml", new BackOfficeModel(_features, GlobalSettings)),
|
||||
//The ActionResult to perform if external login is successful
|
||||
() => Redirect("/"));
|
||||
}
|
||||
|
||||
17
src/Umbraco.Web/Editors/BackOfficeModel.cs
Normal file
17
src/Umbraco.Web/Editors/BackOfficeModel.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Web.Features;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
{
|
||||
public class BackOfficeModel
|
||||
{
|
||||
public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings)
|
||||
{
|
||||
Features = features;
|
||||
GlobalSettings = globalSettings;
|
||||
}
|
||||
|
||||
public UmbracoFeatures Features { get; }
|
||||
public IGlobalSettings GlobalSettings { get; }
|
||||
}
|
||||
}
|
||||
@@ -123,6 +123,7 @@
|
||||
<Compile Include="CompositionExtensions.cs" />
|
||||
<Compile Include="Composing\Current.cs" />
|
||||
<Compile Include="Editors\BackOfficeAssetsController.cs" />
|
||||
<Compile Include="Editors\BackOfficeModel.cs" />
|
||||
<Compile Include="Editors\BackOfficeServerVariables.cs" />
|
||||
<Compile Include="Editors\CodeFileController.cs" />
|
||||
<Compile Include="Editors\DashboardHelper.cs" />
|
||||
|
||||
Reference in New Issue
Block a user