diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index 516093ec11..c0fa5368cc 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -40,6 +40,7 @@ + diff --git a/build/build.ps1 b/build/build.ps1 index ccaac8efb5..b549ef281f 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -25,7 +25,7 @@ # create and boot the buildsystem $ubuild = &"$PSScriptRoot\build-bootstrap.ps1" if (-not $?) { return } - $ubuild.Boot($PSScriptRoot, + $ubuild.Boot($PSScriptRoot, @{ Local = $local; }, @{ Continue = $continue }) if ($ubuild.OnError()) { return } @@ -36,21 +36,21 @@ # ################################################################ # TASKS # ################################################################ - + $ubuild.DefineMethod("SetMoreUmbracoVersion", { param ( $semver ) $release = "" + $semver.Major + "." + $semver.Minor + "." + $semver.Patch - + Write-Host "Update UmbracoVersion.cs" $this.ReplaceFileText("$($this.SolutionRoot)\src\Umbraco.Core\Configuration\UmbracoVersion.cs", ` "(\d+)\.(\d+)\.(\d+)(.(\d+))?", ` - "$release") + "$release") $this.ReplaceFileText("$($this.SolutionRoot)\src\Umbraco.Core\Configuration\UmbracoVersion.cs", ` "CurrentComment => `"(.+)`"", ` "CurrentComment => `"$($semver.PreRelease)`"") - + Write-Host "Update IIS Express port in csproj" $updater = New-Object "Umbraco.Build.ExpressPortUpdater" $csproj = "$($this.SolutionRoot)\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" @@ -61,7 +61,7 @@ { $global:node_path = $env:path $nodePath = $this.BuildEnv.NodePath - $gitExe = (Get-Command git).Source + $gitExe = (Get-Command git).Source $gitPath = [System.IO.Path]::GetDirectoryName($gitExe) $env:path = "$nodePath;$gitPath" @@ -73,7 +73,7 @@ $ubuild.DefineMethod("RestoreNode", { $env:path = $node_path - + $this.SetEnvVar("NODEPATH", $node_nodepath) $this.SetEnvVar("NPM_CONFIG_CACHE", $node_npmcache) $this.SetEnvVar("NPM_CONFIG_PREFIX", $node_npmprefix) @@ -83,9 +83,9 @@ { $src = "$($this.SolutionRoot)\src" $log = "$($this.BuildTemp)\belle.log" - + Write-Host "Compile Belle" - Write-Host "Logging to $log" + Write-Host "Logging to $log" # get a temp clean node env (will restore) $this.SandboxNode() @@ -96,7 +96,7 @@ Push-Location "$($this.SolutionRoot)\src\Umbraco.Web.UI.Client" Write-Output "" > $log - + Write-Output "### node version is:" > $log &node -v >> $log 2>&1 if (-not $?) { throw "Failed to report node version." } @@ -116,7 +116,7 @@ Write-Output "### install bower" >> $log 2>&1 &npm install -g bower >> $log 2>&1 $error.Clear() # that one fails 'cos bower is deprecated - ignore - + Write-Output "### install gulp" >> $log 2>&1 &npm install -g gulp >> $log 2>&1 $error.Clear() # that one fails 'cos deprecated stuff - ignore @@ -127,25 +127,16 @@ Write-Output "### gulp build for version $($this.Version.Release)" >> $log 2>&1 &gulp build --buildversion=$this.Version.Release >> $log 2>&1 - #if (-not $?) { throw "Failed to build" } # that one is expected to work - if (-not $?) - { - # fixme - obviously temp! - Write-Output "#################################" - Write-Output "FIXME - BELLE BUILD FAILS - FIXME" - Write-Output "some phantomJS tests fail, etc..." - Write-Output "#################################" - $error.Clear() - } + if (-not $?) { throw "Failed to build" } # that one is expected to work Pop-Location - + # fixme - should we filter the log to find errors? #get-content .\build.tmp\belle.log | %{ if ($_ -match "build") { write $_}} - + # restore $this.RestoreNode() - + # setting node_modules folder to hidden # used to prevent VS13 from crashing on it while loading the websites project # also makes sure aspnet compiler does not try to handle rogue files and chokes @@ -163,15 +154,15 @@ $src = "$($this.SolutionRoot)\src" $log = "$($this.BuildTemp)\msbuild.umbraco.log" $log7 = "$($this.BuildTemp)\msbuild.compat7.log" - + if ($this.BuildEnv.VisualStudio -eq $null) { throw "Build environment does not provide VisualStudio." } - + Write-Host "Compile Umbraco" Write-Host "Logging to $log" - + # beware of the weird double \\ at the end of paths # see http://edgylogic.com/blog/powershell-and-external-commands-done-right/ &$this.BuildEnv.VisualStudio.MsBuild "$src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" ` @@ -189,7 +180,7 @@ > $log if (-not $?) { throw "Failed to compile Umbraco.Web.UI." } - + Write-Host "Logging to $log7" &$this.BuildEnv.VisualStudio.MsBuild "$src\Umbraco.Compat7\Umbraco.Compat7.csproj" ` @@ -207,19 +198,19 @@ > $log7 if (-not $?) { throw "Failed to compile Umbraco.Compat7." } - + # /p:UmbracoBuild tells the csproj that we are building from PS, not VS }) $ubuild.DefineMethod("PrepareTests", { Write-Host "Prepare Tests" - + # fixme - idea is to avoid rebuilding everything for tests # but because of our weird assembly versioning (with .* stuff) # everything gets rebuilt all the time... #Copy-Files "$tmp\bin" "." "$tmp\tests" - + # data Write-Host "Copy data files" if (-not (Test-Path -Path "$($this.BuildTemp)\tests\Packaging" )) @@ -228,8 +219,8 @@ mkdir "$($this.BuildTemp)\tests\Packaging" > $null } $this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Tests\Packaging\Packages", "*", "$($this.BuildTemp)\tests\Packaging\Packages") - - # required for package install tests + + # required for package install tests if (-not (Test-Path -Path "$($this.BuildTemp)\tests\bin" )) { Write-Host "Create bin directory" @@ -246,10 +237,10 @@ { throw "Build environment does not provide VisualStudio." } - + Write-Host "Compile Tests" Write-Host "Logging to $log" - + # beware of the weird double \\ at the end of paths # see http://edgylogic.com/blog/powershell-and-external-commands-done-right/ &$this.BuildEnv.VisualStudio.MsBuild "$($this.SolutionRoot)\src\Umbraco.Tests\Umbraco.Tests.csproj" ` @@ -273,26 +264,26 @@ $ubuild.DefineMethod("PreparePackages", { - Write-Host "Prepare Packages" - + Write-Host "Prepare Packages" + $src = "$($this.SolutionRoot)\src" $tmp = "$($this.BuildTemp)" $out = "$($this.BuildOutput)" - + $buildConfiguration = "Release" - + # restore web.config $this.TempRestoreFile("$src\Umbraco.Web.UI\web.config") - + # cleanup build Write-Host "Clean build" $this.RemoveFile("$tmp\bin\*.dll.config") $this.RemoveFile("$tmp\WebApp\bin\*.dll.config") - + # cleanup presentation Write-Host "Cleanup presentation" $this.RemoveDirectory("$tmp\WebApp\umbraco.presentation") - + # create directories Write-Host "Create directories" mkdir "$tmp\Configs" > $null @@ -300,11 +291,11 @@ mkdir "$tmp\WebApp\App_Data" > $null #mkdir "$tmp\WebApp\Media" > $null #mkdir "$tmp\WebApp\Views" > $null - + # copy various files Write-Host "Copy xml documentation" Copy-Item -force "$tmp\bin\*.xml" "$tmp\WebApp\bin" - + Write-Host "Copy transformed configs and langs" # note: exclude imageprocessor/*.config as imageprocessor pkg installs them $this.CopyFiles("$tmp\WebApp\config", "*.config", "$tmp\Configs", ` @@ -312,10 +303,10 @@ $this.CopyFiles("$tmp\WebApp\config", "*.js", "$tmp\Configs") $this.CopyFiles("$tmp\WebApp\config\lang", "*.xml", "$tmp\Configs\Lang") $this.CopyFile("$tmp\WebApp\web.config", "$tmp\Configs\web.config.transform") - + Write-Host "Copy transformed web.config" $this.CopyFile("$src\Umbraco.Web.UI\web.$buildConfiguration.Config.transformed", "$tmp\WebApp\web.config") - + # offset the modified timestamps on all umbraco dlls, as WebResources # break if date is in the future, which, due to timezone offsets can happen. Write-Host "Offset dlls timestamps" @@ -323,49 +314,48 @@ $_.CreationTime = $_.CreationTime.AddHours(-11) $_.LastWriteTime = $_.LastWriteTime.AddHours(-11) } - + # copy libs Write-Host "Copy SqlCE libraries" $this.CopyFiles("$src\packages\SqlServerCE.4.0.0.1", "*.*", "$tmp\bin", ` { -not $_.Extension.StartsWith(".nu") -and -not $_.RelativeName.StartsWith("lib\") }) $this.CopyFiles("$src\packages\SqlServerCE.4.0.0.1", "*.*", "$tmp\WebApp\bin", ` { -not $_.Extension.StartsWith(".nu") -and -not $_.RelativeName.StartsWith("lib\") }) - + # copy Belle Write-Host "Copy Belle" $this.CopyFiles("$src\Umbraco.Web.UI\umbraco\assets", "*", "$tmp\WebApp\umbraco\assets") $this.CopyFiles("$src\Umbraco.Web.UI\umbraco\js", "*", "$tmp\WebApp\umbraco\js") $this.CopyFiles("$src\Umbraco.Web.UI\umbraco\lib", "*", "$tmp\WebApp\umbraco\lib") $this.CopyFiles("$src\Umbraco.Web.UI\umbraco\views", "*", "$tmp\WebApp\umbraco\views") - $this.CopyFiles("$src\Umbraco.Web.UI\umbraco\preview", "*", "$tmp\WebApp\umbraco\preview") }) $ubuild.DefineMethod("PackageZip", { - Write-Host "Create Zip packages" + Write-Host "Create Zip packages" $src = "$($this.SolutionRoot)\src" $tmp = $this.BuildTemp $out = $this.BuildOutput - - Write-Host "Zip all binaries" + + Write-Host "Zip all binaries" &$this.BuildEnv.Zip a -r "$out\UmbracoCms.AllBinaries.$($this.Version.Semver).zip" ` "$tmp\bin\*" ` "-x!dotless.Core.*" "-x!Umbraco.Compat7.*" ` > $null - if (-not $?) { throw "Failed to zip UmbracoCms.AllBinaries." } + if (-not $?) { throw "Failed to zip UmbracoCms.AllBinaries." } - Write-Host "Zip cms" + Write-Host "Zip cms" &$this.BuildEnv.Zip a -r "$out\UmbracoCms.$($this.Version.Semver).zip" ` "$tmp\WebApp\*" ` "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb" "-x!Umbraco.Compat7.*" ` > $null - if (-not $?) { throw "Failed to zip UmbracoCms." } + if (-not $?) { throw "Failed to zip UmbracoCms." } }) $ubuild.DefineMethod("PrepareBuild", { - Write-Host "Clear folders and files" + Write-Host "Clear folders and files" $this.RemoveDirectory("$($this.SolutionRoot)\src\Umbraco.Web.UI.Client\bower_components") $this.TempStoreFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config") @@ -390,7 +380,7 @@ Write-Host "Restore NuGet" Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log" &$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" -ConfigFile $this.BuildEnv.NuGetConfig > "$($this.BuildTemp)\nuget.restore.log" - if (-not $?) { throw "Failed to restore NuGet packages." } + if (-not $?) { throw "Failed to restore NuGet packages." } }) $ubuild.DefineMethod("PackageNuGet", @@ -482,9 +472,9 @@ $ubuild.ReleaseBranches = @( "master" ) # run - if (-not $get) + if (-not $get) { - $ubuild.Build() + $ubuild.Build() if ($ubuild.OnError()) { return } } Write-Host "Done" diff --git a/src/Umbraco.Core/IO/FileSystems.cs b/src/Umbraco.Core/IO/FileSystems.cs index 4d3ef4a605..39e7fa30fc 100644 --- a/src/Umbraco.Core/IO/FileSystems.cs +++ b/src/Umbraco.Core/IO/FileSystems.cs @@ -29,6 +29,7 @@ namespace Umbraco.Core.IO private ShadowWrapper _xsltFileSystem; private ShadowWrapper _masterPagesFileSystem; private ShadowWrapper _mvcViewsFileSystem; + private ShadowWrapper _javaScriptLibraryFileSystem; // well-known file systems lazy initialization private object _wkfsLock = new object(); @@ -165,7 +166,7 @@ namespace Umbraco.Core.IO var xsltFileSystem = new PhysicalFileSystem(SystemDirectories.Xslt); var masterPagesFileSystem = new PhysicalFileSystem(SystemDirectories.Masterpages); var mvcViewsFileSystem = new PhysicalFileSystem(SystemDirectories.MvcViews); - + var javaScriptLibraryFileSystem = new PhysicalFileSystem(SystemDirectories.JavaScriptLibrary); _macroPartialFileSystem = new ShadowWrapper(macroPartialFileSystem, "Views/MacroPartials", () => IsScoped()); _partialViewsFileSystem = new ShadowWrapper(partialViewsFileSystem, "Views/Partials", () => IsScoped()); @@ -174,8 +175,7 @@ namespace Umbraco.Core.IO _xsltFileSystem = new ShadowWrapper(xsltFileSystem, "xslt", () => IsScoped()); _masterPagesFileSystem = new ShadowWrapper(masterPagesFileSystem, "masterpages", () => IsScoped()); _mvcViewsFileSystem = new ShadowWrapper(mvcViewsFileSystem, "Views", () => IsScoped()); - - _javascriptLibraryFileSystem = new PhysicalFileSystem(Path.Combine(SystemDirectories.Umbraco, "lib")); + _javascriptLibraryFileSystem = new ShadowWrapper(javaScriptLibraryFileSystem, "Lib", () => IsScoped()); // filesystems obtained from GetFileSystemProvider are already wrapped and do not need to be wrapped again _mediaFileSystem = GetFileSystemProvider(); diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs index 5a2928f795..0a61e8e542 100644 --- a/src/Umbraco.Core/IO/IOHelper.cs +++ b/src/Umbraco.Core/IO/IOHelper.cs @@ -131,9 +131,9 @@ namespace Umbraco.Core.IO //use a tilde character instead of the complete path internal static string ReturnPath(string settingsKey, string standardPath, bool useTilde) { - string retval = ConfigurationManager.AppSettings[settingsKey]; + var retval = ConfigurationManager.AppSettings[settingsKey]; - if (String.IsNullOrEmpty(retval)) + if (string.IsNullOrEmpty(retval)) retval = standardPath; return retval.TrimEnd('/'); diff --git a/src/Umbraco.Core/IO/SystemDirectories.cs b/src/Umbraco.Core/IO/SystemDirectories.cs index f2c9a438db..d9f0eba841 100644 --- a/src/Umbraco.Core/IO/SystemDirectories.cs +++ b/src/Umbraco.Core/IO/SystemDirectories.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Configuration; - -using System.Web; -using System.IO; +using System.Web; namespace Umbraco.Core.IO { @@ -13,179 +6,56 @@ namespace Umbraco.Core.IO public class SystemDirectories { //TODO: Why on earth is this even configurable? You cannot change the /Bin folder in ASP.Net - public static string Bin - { - get - { - return IOHelper.ReturnPath("umbracoBinDirectory", "~/bin"); - } - } + public static string Bin => IOHelper.ReturnPath("umbracoBinDirectory", "~/bin"); - public static string Base - { - get - { - return IOHelper.ReturnPath("umbracoBaseDirectory", "~/base"); - } - } + public static string Base => IOHelper.ReturnPath("umbracoBaseDirectory", "~/base"); - public static string Config - { - get - { - return IOHelper.ReturnPath("umbracoConfigDirectory", "~/config"); - } - } + public static string Config => IOHelper.ReturnPath("umbracoConfigDirectory", "~/config"); - public static string Css - { - get - { - return IOHelper.ReturnPath("umbracoCssDirectory", "~/css"); - } - } + public static string Css => IOHelper.ReturnPath("umbracoCssDirectory", "~/css"); - public static string Data - { - get - { - return IOHelper.ReturnPath("umbracoStorageDirectory", "~/App_Data"); - } - } + public static string Data => IOHelper.ReturnPath("umbracoStorageDirectory", "~/App_Data"); - public static string Install - { - get - { - return IOHelper.ReturnPath("umbracoInstallPath", "~/install"); - } - } + public static string Install => IOHelper.ReturnPath("umbracoInstallPath", "~/install"); - public static string Masterpages - { - get - { - return IOHelper.ReturnPath("umbracoMasterPagesPath", "~/masterpages"); - } - } + public static string Masterpages => IOHelper.ReturnPath("umbracoMasterPagesPath", "~/masterpages"); - public static string AppCode - { - get - { - //NOTE: this is not configurable and shouldn't need to be - return "~/App_Code"; - } - } + //NOTE: this is not configurable and shouldn't need to be + public static string AppCode => "~/App_Code"; - public static string AppPlugins - { - get - { - //NOTE: this is not configurable and shouldn't need to be - return "~/App_Plugins"; - } - } + //NOTE: this is not configurable and shouldn't need to be + public static string AppPlugins => "~/App_Plugins"; - public static string MvcViews - { - get - { - //NOTE: this is not configurable and shouldn't need to be - return "~/Views"; - } - } + //NOTE: this is not configurable and shouldn't need to be + public static string MvcViews => "~/Views"; - public static string PartialViews - { - get - { - return MvcViews + "/Partials/"; - } - } + public static string PartialViews => MvcViews + "/Partials/"; - public static string MacroPartials - { - get - { - return MvcViews + "/MacroPartials/"; + public static string MacroPartials => MvcViews + "/MacroPartials/"; - } - } + public static string Media => IOHelper.ReturnPath("umbracoMediaPath", "~/media"); - public static string Media - { - get - { - return IOHelper.ReturnPath("umbracoMediaPath", "~/media"); - } - } + public static string Scripts => IOHelper.ReturnPath("umbracoScriptsPath", "~/scripts"); - public static string Scripts - { - get - { - return IOHelper.ReturnPath("umbracoScriptsPath", "~/scripts"); - } - } + public static string Umbraco => IOHelper.ReturnPath("umbracoPath", "~/umbraco"); - public static string Umbraco - { - get - { - return IOHelper.ReturnPath("umbracoPath", "~/umbraco"); - } - } + public static string UmbracoClient => IOHelper.ReturnPath("umbracoClientPath", "~/umbraco_client"); - public static string UmbracoClient - { - get - { - return IOHelper.ReturnPath("umbracoClientPath", "~/umbraco_client"); - } - } + public static string UserControls => IOHelper.ReturnPath("umbracoUsercontrolsPath", "~/usercontrols"); - public static string UserControls - { - get - { - return IOHelper.ReturnPath("umbracoUsercontrolsPath", "~/usercontrols"); - } - } + public static string WebServices => IOHelper.ReturnPath("umbracoWebservicesPath", Umbraco.EnsureEndsWith("/") + "webservices"); - public static string WebServices - { - get - { - return IOHelper.ReturnPath("umbracoWebservicesPath", Umbraco.EnsureEndsWith("/") + "webservices"); - } - } + public static string Xslt => IOHelper.ReturnPath("umbracoXsltPath", "~/xslt"); - public static string Xslt - { - get { - return IOHelper.ReturnPath("umbracoXsltPath", "~/xslt"); - } - } + //by default the packages folder should exist in the data folder + public static string Packages => IOHelper.ReturnPath("umbracoPackagesPath", Data + IOHelper.DirSepChar + "packages"); - public static string Packages - { - get - { - //by default the packages folder should exist in the data folder - return IOHelper.ReturnPath("umbracoPackagesPath", Data + IOHelper.DirSepChar + "packages"); - } - } + public static string Preview => IOHelper.ReturnPath("umbracoPreviewPath", Data + IOHelper.DirSepChar + "preview"); + + public static string JavaScriptLibrary => IOHelper.ReturnPath("umbracoJavaScriptLibraryPath", Umbraco + IOHelper.DirSepChar + "lib"); - public static string Preview - { - get - { - return IOHelper.ReturnPath("umbracoPreviewPath", Data + IOHelper.DirSepChar + "preview"); - } - } + private static string _root; - private static string _root; /// /// Gets the root path of the application /// @@ -193,21 +63,16 @@ namespace Umbraco.Core.IO { get { - if (_root == null) - { - string appPath = HttpRuntime.AppDomainAppVirtualPath ?? string.Empty; - if (appPath == "/") - appPath = string.Empty; + if (_root != null) return _root; - _root = appPath; - } + var appPath = HttpRuntime.AppDomainAppVirtualPath; + if (appPath == "/") appPath = string.Empty; + + _root = appPath; return _root; } //Only required for unit tests - internal set { _root = value; } + internal set => _root = value; } } - - - } diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_7_7_0/AddUserGroupTables.cs b/src/Umbraco.Core/Migrations/Upgrade/V_7_7_0/AddUserGroupTables.cs index 1042322dca..35df178672 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_7_7_0/AddUserGroupTables.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_7_7_0/AddUserGroupTables.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Data; using System.Linq; -using NPoco; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Dtos; using Umbraco.Core.Persistence.SqlSyntax; @@ -216,8 +215,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_7_0 var usersWithApps = new Dictionary>(); foreach (var userApps in userAppsData) { - List apps; - if (usersWithApps.TryGetValue(userApps.id, out apps) == false) + if (usersWithApps.TryGetValue(userApps.id, out List apps) == false) { apps = new List {userApps.app}; usersWithApps.Add(userApps.id, apps); diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js index f0fa81faee..5d39fb3bcf 100644 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js +++ b/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js @@ -1,8 +1,6 @@ LazyLoad.js([ '../lib/jquery/jquery.min.js', - //'../lib/jquery-ui/jquery-ui.min.js', - '/Scripts/jquery-1.6.4.min.js', '../lib/angular/1.1.5/angular.min.js', '../lib/underscore/underscore-min.js', '../lib/umbraco/Extensions.js', @@ -13,9 +11,8 @@ LazyLoad.js([ '../ServerVariables', '../lib/spectrum/spectrum.js', '../lib/signalr/jquery.signalR.js', - '/umbraco/signalr/hubs', + '/umbraco/BackOffice/signalr/hubs', '../js/umbraco.canvasdesigner.js' - '../js/canvasdesigner.panel.js' ], function () { jQuery(document).ready(function () { angular.bootstrap(document, ['Umbraco.canvasdesigner']); diff --git a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs index c4688e1afd..8eeb4abcec 100644 --- a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs @@ -42,9 +42,8 @@ namespace Umbraco.Web.Cache public override void Refresh(JsonPayload[] payloads) { if (payloads == null) return; - - bool anythingChanged; - _publishedSnapshotService.Notify(payloads, out anythingChanged); + + _publishedSnapshotService.Notify(payloads, out var anythingChanged); if (anythingChanged) { diff --git a/src/Umbraco.Web/Editors/PreviewController.cs b/src/Umbraco.Web/Editors/PreviewController.cs index 08de0f83ba..954809eeb6 100644 --- a/src/Umbraco.Web/Editors/PreviewController.cs +++ b/src/Umbraco.Web/Editors/PreviewController.cs @@ -11,13 +11,20 @@ namespace Umbraco.Web.Editors [DisableBrowserCache] public class PreviewController : Controller { + private readonly UmbracoFeatures _features; + + public PreviewController(UmbracoFeatures features) + { + _features = features; + } + [UmbracoAuthorize(redirectToUmbracoLogin: true)] public ActionResult Index() { var model = new BackOfficePreview { - DisableDevicePreview = FeaturesResolver.Current.Features.Disabled.DisableDevicePreview, - PreviewExtendedHeaderView = FeaturesResolver.Current.Features.Enabled.PreviewExtendedView + DisableDevicePreview = _features.Disabled.DisableDevicePreview, + PreviewExtendedHeaderView = _features.Enabled.PreviewExtendedView }; if (model.PreviewExtendedHeaderView.IsNullOrWhiteSpace() == false) @@ -34,7 +41,7 @@ namespace Umbraco.Web.Editors public ActionResult Editors(string editor) { - if (string.IsNullOrEmpty(editor)) throw new ArgumentNullException("editor"); + if (string.IsNullOrEmpty(editor)) throw new ArgumentNullException(nameof(editor)); return View(GlobalSettings.Path.EnsureEndsWith('/') + "Views/Preview/" + editor.Replace(".html", string.Empty) + ".cshtml"); } } diff --git a/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs b/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs index 9210472313..e908359f93 100644 --- a/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs +++ b/src/Umbraco.Web/Models/ContentEditing/AuditLog.cs @@ -1,12 +1,8 @@ using System; using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Umbraco.Core.Models; namespace Umbraco.Web.Models.ContentEditing { - [DataContract(Name = "auditLog", Namespace = "")] public class AuditLog { diff --git a/src/Umbraco.Web/Models/ContentEditing/BackOfficePreview.cs b/src/Umbraco.Web/Models/ContentEditing/BackOfficePreview.cs index ed2e623226..f8633acdd0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/BackOfficePreview.cs +++ b/src/Umbraco.Web/Models/ContentEditing/BackOfficePreview.cs @@ -6,6 +6,7 @@ public class BackOfficePreview { public string PreviewExtendedHeaderView { get; set; } + //TODO: We could potentially have a 'footer' view public bool DisableDevicePreview { get; set; } } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 9a8d424708..552702cb28 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -150,6 +150,7 @@ +