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:
Shannon
2018-04-17 14:43:17 +10:00
parent 319bd783ff
commit 2872d0b0a2
11 changed files with 117 additions and 110 deletions

View File

@@ -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("/"));
}

View 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; }
}
}

View File

@@ -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" />