diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index fce15eb487..6e00e02bbe 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -2,60 +2,97 @@ UmbracoCms.Core - 8.0.0 + 9.0.0 Umbraco Cms Core Binaries Umbraco HQ Umbraco HQ - http://opensource.org/licenses/MIT - http://umbraco.com/ + MIT + https://umbraco.com/ https://umbraco.com/dist/nuget/logo-small.png false - Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET project. + Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET Core project. Contains the core assemblies needed to run Umbraco Cms en-US umbraco - + - + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + - + - + - + + - - - + + + + + + + + + + + - + + + + + + - + + + + + + - + + + + + + diff --git a/build/NuSpecs/UmbracoCms.SqlCe.nuspec b/build/NuSpecs/UmbracoCms.SqlCe.nuspec new file mode 100644 index 0000000000..184928f127 --- /dev/null +++ b/build/NuSpecs/UmbracoCms.SqlCe.nuspec @@ -0,0 +1,44 @@ + + + + UmbracoCms.SqlCe + 9.0.0 + Umbraco Cms Sql Ce Add-on + Umbraco HQ + Umbraco HQ + MIT + https://umbraco.com/ + https://umbraco.com/dist/nuget/logo-small.png + false + Contains the SQL CE assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET Core project. + Contains the SQL CE assemblies needed to run Umbraco Cms + en-US + umbraco + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/NuSpecs/UmbracoCms.Web.nuspec b/build/NuSpecs/UmbracoCms.Web.nuspec index cfab130f0c..dcbc547b6d 100644 --- a/build/NuSpecs/UmbracoCms.Web.nuspec +++ b/build/NuSpecs/UmbracoCms.Web.nuspec @@ -2,66 +2,59 @@ UmbracoCms.Web - 8.0.0 + 9.0.0 Umbraco Cms Core Binaries Umbraco HQ Umbraco HQ - http://opensource.org/licenses/MIT - http://umbraco.com/ + MIT + https://umbraco.com/ https://umbraco.com/dist/nuget/logo-small.png false - Contains the web assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET project. + Contains the web assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET Core project. Contains the core assemblies needed to run Umbraco Cms en-US umbraco - - + - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - + + + + - - - + + + + diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index a6b06d9964..5db3a439d9 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -2,67 +2,41 @@ UmbracoCms - 8.0.0 + 9.0.0 Umbraco Cms Umbraco HQ Umbraco HQ - http://opensource.org/licenses/MIT - http://umbraco.com/ + MIT + https://umbraco.com/ https://umbraco.com/dist/nuget/logo-small.png false - Installs Umbraco Cms in your Visual Studio ASP.NET project - Installs Umbraco Cms in your Visual Studio ASP.NET project + Installs Umbraco Cms in your Visual Studio ASP.NET Core project + Installs Umbraco Cms in your Visual Studio ASP.NET Core project en-US umbraco - - - - - - - - - - + + - - + + - - - - - - + + + + - - - - + + + - - - - - - - - - - - - - - - - + + diff --git a/build/NuSpecs/build/UmbracoCms.props b/build/NuSpecs/build/UmbracoCms.props index 1422a4cd76..371b0aa5ab 100644 --- a/build/NuSpecs/build/UmbracoCms.props +++ b/build/NuSpecs/build/UmbracoCms.props @@ -1,13 +1,7 @@ - - - - - AddUmbracoFilesToOutput; - $(CopyAllFilesToSingleFolderForPackageDependsOn); - - - AddUmbracoFilesToOutput; - $(CopyAllFilesToSingleFolderForPackageDependsOn); - - - \ No newline at end of file + + + + $(DefaultItemExcludes);wwwroot\is-cache\**;wwwroot\ms-cache\** + + + diff --git a/build/NuSpecs/build/UmbracoCms.targets b/build/NuSpecs/build/UmbracoCms.targets index ac0e9e976d..29d972d480 100644 --- a/build/NuSpecs/build/UmbracoCms.targets +++ b/build/NuSpecs/build/UmbracoCms.targets @@ -1,58 +1,20 @@ - - - + + - $(MSBuildThisFileDirectory)..\UmbracoFiles\ + $(MSBuildThisFileDirectory)..\content\**\*.* - - - - - - - - - - $(MSBuildThisFileDirectory)..\UmbracoFiles\ - - - - - - - - - - - App_Browsers - - - App_Code - - - App_Plugins - - - bin\amd64 - - - bin\x86 - - - Config\Splashes - - - data - - - umbraco - - - . - - - %(CustomFilesToInclude.Dir)\%(RecursiveDir)%(Filename)%(Extension) - - - + + + + + + + + + + + diff --git a/build/build-bootstrap.ps1 b/build/build-bootstrap.ps1 index 82c789ff22..645f6c7d41 100644 --- a/build/build-bootstrap.ps1 +++ b/build/build-bootstrap.ps1 @@ -34,6 +34,7 @@ if (-not (test-path $nuget)) { Write-Host "Download NuGet..." + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Invoke-WebRequest $source -OutFile $nuget if (-not $?) { throw "Failed to download NuGet." } } diff --git a/build/build.ps1 b/build/build.ps1 index c2c5bdd232..aa8b93bf64 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -152,7 +152,7 @@ $buildConfiguration = "Release" $src = "$($this.SolutionRoot)\src" - $log = "$($this.BuildTemp)\msbuild.umbraco.log" + $log = "$($this.BuildTemp)\build.umbraco.log" if ($this.BuildEnv.VisualStudio -eq $null) { @@ -162,23 +162,33 @@ 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" ` - /p:WarningLevel=0 ` - /p:Configuration=$buildConfiguration ` - /p:Platform=AnyCPU ` - /p:UseWPP_CopyWebApplication=True ` - /p:PipelineDependsOnBuild=False ` - /p:OutDir="$($this.BuildTemp)\bin\\" ` - /p:WebProjectOutputDir="$($this.BuildTemp)\WebApp\\" ` - /p:Verbosity=minimal ` - /t:Clean`;Rebuild ` - /tv:"$($this.BuildEnv.VisualStudio.ToolsVersion)" ` - /p:UmbracoBuild=True ` + & dotnet build "$src\Umbraco.Web.UI.NetCore\Umbraco.Web.UI.NetCore.csproj" ` + --configuration $buildConfiguration ` + --output "$($this.BuildTemp)\bin\\" ` > $log - if (-not $?) { throw "Failed to compile Umbraco.Web.UI." } + # get files into WebApp\bin + & dotnet publish "$src\Umbraco.Web.UI.NetCore\Umbraco.Web.UI.NetCore.csproj" ` + --output "$($this.BuildTemp)\WebApp\bin\\" ` + > $log + + # remove extra files + $webAppBin = "$($this.BuildTemp)\WebApp\bin" + $excludeDirs = @("$($webAppBin)\Config","$($webAppBin)\refs","$($webAppBin)\runtimes","$($webAppBin)\Umbraco","$($webAppBin)\wwwroot") + $excludeFiles = @("$($webAppBin)\appsettings.*","$($webAppBin)\*.deps.json","$($webAppBin)\*.exe","$($webAppBin)\*.config","$($webAppBin)\*.runtimeconfig.json") + $this.RemoveDirectory($excludeDirs) + $this.RemoveFile($excludeFiles) + + # copy rest of the files into WebApp + $this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\Config", "*", "$($this.BuildTemp)\WebApp\config") + $this.RemoveFile("$($this.BuildTemp)\WebApp\Config\*.Release.*") + $this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\Umbraco", "*", "$($this.BuildTemp)\WebApp\umbraco") + $excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\config","$($this.BuildTemp)\WebApp\umbraco\lib") + $this.RemoveDirectory($excludeUmbracoDirs) + $this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\Views", "*", "$($this.BuildTemp)\WebApp\Views") + Copy-Item "$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\appsettings.json" "$($this.BuildTemp)\WebApp" + + if (-not $?) { throw "Failed to compile Umbraco.Web.UI.NetCore." } # /p:UmbracoBuild tells the csproj that we are building from PS, not VS }) @@ -237,6 +247,9 @@ /p:UmbracoBuild=True ` > $log + # copy Umbraco.Persistance.SqlCe files into WebApp + Copy-Item "$($this.BuildTemp)\tests\Umbraco.Persistance.SqlCe.*" "$($this.BuildTemp)\WebApp\bin" + if (-not $?) { throw "Failed to compile tests." } # /p:UmbracoBuild tells the csproj that we are building from PS @@ -253,7 +266,7 @@ $buildConfiguration = "Release" # restore web.config - $this.TempRestoreFile("$src\Umbraco.Web.UI\web.config") + #$this.TempRestoreFile("$src\Umbraco.Web.UI\web.config") # cleanup build Write-Host "Clean build" @@ -282,10 +295,10 @@ { -not $_.RelativeName.StartsWith("imageprocessor") }) $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") + #$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") + # 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. @@ -302,17 +315,17 @@ { $nugetPackages = [System.Environment]::ExpandEnvironmentVariables("%userprofile%\.nuget\packages") } - $this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\bin\x86") - $this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\bin\amd64") - $this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\WebApp\bin\x86") - $this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\WebApp\bin\amd64") + #$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\bin\x86") + #$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\bin\amd64") + #$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\WebApp\bin\x86") + #$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\WebApp\bin\amd64") # 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.NetCore\wwwroot\umbraco\assets", "*", "$tmp\WebApp\wwwroot\umbraco\assets") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\wwwroot\umbraco\js", "*", "$tmp\WebApp\wwwroot\umbraco\js") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\wwwroot\umbraco\lib", "*", "$tmp\WebApp\wwwroot\umbraco\lib") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\wwwroot\umbraco\views", "*", "$tmp\WebApp\wwwroot\umbraco\views") }) $ubuild.DefineMethod("PackageZip", @@ -365,16 +378,6 @@ } }) - $ubuild.DefineMethod("PrepareNuGet", - { - Write-Host "Prepare NuGet" - - # add Web.config transform files to the NuGet package - Write-Host "Add web.config transforms to NuGet package" - mv "$($this.BuildTemp)\WebApp\Views\Web.config" "$($this.BuildTemp)\WebApp\Views\Web.config.transform" - - }) - $nugetsourceUmbraco = "https://api.nuget.org/v3/index.json" $ubuild.DefineMethod("RestoreNuGet", @@ -410,6 +413,12 @@ -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cms.log" if (-not $?) { throw "Failed to pack NuGet UmbracoCms." } + &$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.SqlCe.nuspec" ` + -Properties BuildTmp="$($this.BuildTemp)" ` + -Version "$($this.Version.Semver.ToString())" ` + -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmssqlce.log" + if (-not $?) { throw "Failed to pack NuGet UmbracoCms.SqlCe." } + # run hook if ($this.HasMethod("PostPackageNuGet")) { @@ -460,7 +469,7 @@ $src = "$($this.SolutionRoot)\src" $out = $this.BuildOutput - # Check if the solution has been built + # Check if the solution has been built if (!(Test-Path "$src\Umbraco.Web.UI.Client\node_modules")) {throw "Umbraco needs to be built before generating the Angular Docs"} "Moving to Umbraco.Web.UI.Docs folder" @@ -471,7 +480,7 @@ & npx gulp docs Pop-Location - + # change baseUrl $BaseUrl = "https://our.umbraco.com/apidocs/v8/ui/" $IndexPath = "./api/index.html" @@ -504,8 +513,6 @@ if ($this.OnError()) { return } $this.VerifyNuGet() if ($this.OnError()) { return } - $this.PrepareNuGet() - if ($this.OnError()) { return } $this.PackageNuGet() if ($this.OnError()) { return } $this.PrepareAzureGallery() diff --git a/src/Umbraco.Configuration/Models/ContentSettings.cs b/src/Umbraco.Configuration/Models/ContentSettings.cs index bf046a1376..6c9b986dd1 100644 --- a/src/Umbraco.Configuration/Models/ContentSettings.cs +++ b/src/Umbraco.Configuration/Models/ContentSettings.cs @@ -73,7 +73,7 @@ namespace Umbraco.Configuration.Models _configuration.GetValue(Prefix+"ShowDeprecatedPropertyEditors", false); public string LoginBackgroundImage => - _configuration.GetValue(Prefix+"LoginBackgroundImage", string.Empty); + _configuration.GetValue(Prefix+"LoginBackgroundImage", "assets/img/login.jpg"); private class ContentErrorPage : IContentErrorPage { diff --git a/src/Umbraco.Configuration/Umbraco.Configuration.csproj b/src/Umbraco.Configuration/Umbraco.Configuration.csproj index 2337ea24f8..9111a713ad 100644 --- a/src/Umbraco.Configuration/Umbraco.Configuration.csproj +++ b/src/Umbraco.Configuration/Umbraco.Configuration.csproj @@ -5,6 +5,10 @@ 8 + + bin\Release\Umbraco.Configuration.xml + + diff --git a/src/Umbraco.Core/Composing/ReferenceResolver.cs b/src/Umbraco.Core/Composing/ReferenceResolver.cs index c0334674a3..b6bd121be7 100644 --- a/src/Umbraco.Core/Composing/ReferenceResolver.cs +++ b/src/Umbraco.Core/Composing/ReferenceResolver.cs @@ -62,7 +62,7 @@ namespace Umbraco.Core.Composing // don't include this item if it's Umbraco // TODO: We should maybe pass an explicit list of these names in? - if (assemblyName.FullName.StartsWith("Umbraco.")) + if (assemblyName.FullName.StartsWith("Umbraco.") || assemblyName.Name.EndsWith(".Views")) continue; var assembly = Assembly.Load(assemblyName); diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 53e6fe3fbc..69ca2e5f18 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -10,6 +10,10 @@ Umbraco CMS + + bin\Release\Umbraco.Core.xml + + diff --git a/src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/NotificationMethodBase.cs b/src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/NotificationMethodBase.cs index 9c3516e712..3e6606e965 100644 --- a/src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/NotificationMethodBase.cs +++ b/src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/NotificationMethodBase.cs @@ -19,8 +19,7 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods } var notificationMethods = healthCheckSettingsConfig.NotificationSettings.NotificationMethods; - var notificationMethod = notificationMethods[attribute.Alias]; - if (notificationMethod == null) + if(!notificationMethods.TryGetValue(attribute.Alias, out var notificationMethod)) { Enabled = false; return; diff --git a/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs b/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs index 3a68d83fff..a9fff229f2 100644 --- a/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs +++ b/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs @@ -103,7 +103,7 @@ namespace Umbraco.Web.Scheduling /// Initializes a new instance of the class. /// /// A logger. - /// The hosting environment + /// The application shutdown registry /// An optional main domain hook. public BackgroundTaskRunner(ILogger logger, IApplicationShutdownRegistry applicationShutdownRegistry, MainDomHook hook = null) : this(typeof(T).FullName, new BackgroundTaskRunnerOptions(), logger, applicationShutdownRegistry, hook) @@ -114,7 +114,7 @@ namespace Umbraco.Web.Scheduling /// /// The name of the runner. /// A logger. - /// The hosting environment + /// The application shutdown registry /// An optional main domain hook. public BackgroundTaskRunner(string name, ILogger logger, IApplicationShutdownRegistry applicationShutdownRegistry, MainDomHook hook = null) : this(name, new BackgroundTaskRunnerOptions(), logger, applicationShutdownRegistry, hook) @@ -125,7 +125,7 @@ namespace Umbraco.Web.Scheduling /// /// The set of options. /// A logger. - /// The hosting environment + /// The application shutdown registry /// An optional main domain hook. public BackgroundTaskRunner(BackgroundTaskRunnerOptions options, ILogger logger, IApplicationShutdownRegistry applicationShutdownRegistry, MainDomHook hook = null) : this(typeof(T).FullName, options, logger, applicationShutdownRegistry, hook) @@ -137,7 +137,7 @@ namespace Umbraco.Web.Scheduling /// The name of the runner. /// The set of options. /// A logger. - /// The hosting environment + /// The application shutdown registry /// An optional main domain hook. public BackgroundTaskRunner(string name, BackgroundTaskRunnerOptions options, ILogger logger, IApplicationShutdownRegistry applicationShutdownRegistry, MainDomHook hook = null) { diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj index 1af8ce9119..acda3adceb 100644 --- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj +++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj @@ -1,10 +1,14 @@ - + netstandard2.0 8 + + bin\Release\Umbraco.Infrastructure.xml + + diff --git a/src/Umbraco.Persistance.SqlCe/Umbraco.Persistance.SqlCe.csproj b/src/Umbraco.Persistance.SqlCe/Umbraco.Persistance.SqlCe.csproj index 8b4ac02a5c..ff6ef95806 100644 --- a/src/Umbraco.Persistance.SqlCe/Umbraco.Persistance.SqlCe.csproj +++ b/src/Umbraco.Persistance.SqlCe/Umbraco.Persistance.SqlCe.csproj @@ -5,6 +5,10 @@ net472 + + bin\Release\Umbraco.Persistance.SqlCe.xml + + diff --git a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj index 75eeca268b..4a7733a810 100644 --- a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj +++ b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj @@ -6,6 +6,10 @@ 8 + + bin\Release\Umbraco.PublishedCache.NuCache.xml + + diff --git a/src/Umbraco.Tests.Integration/Mapping/ContentTypeModelMappingTests.cs b/src/Umbraco.Tests.Integration/Mapping/ContentTypeModelMappingTests.cs index 05ab23a370..d982d4b291 100644 --- a/src/Umbraco.Tests.Integration/Mapping/ContentTypeModelMappingTests.cs +++ b/src/Umbraco.Tests.Integration/Mapping/ContentTypeModelMappingTests.cs @@ -667,7 +667,7 @@ namespace Umbraco.Tests.Models.Mapping public void IMediaTypeComposition_To_MediaTypeDisplay() { //Arrange - var ctMain = CreateSimpleMediaType("parent", "Parent"); + var ctMain = MockedContentTypes.CreateSimpleMediaType("parent", "Parent"); //not assigned to tab ctMain.AddPropertyType(new PropertyType(ShortStringHelper, Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { @@ -679,7 +679,7 @@ namespace Umbraco.Tests.Models.Mapping DataTypeId = -88 }); MockedContentTypes.EnsureAllIds(ctMain, 8888); - var ctChild1 = CreateSimpleMediaType("child1", "Child 1", ctMain, true); + var ctChild1 = MockedContentTypes.CreateSimpleMediaType("child1", "Child 1", ctMain, true); ctChild1.AddPropertyType(new PropertyType(ShortStringHelper, Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = "someProperty", @@ -690,7 +690,7 @@ namespace Umbraco.Tests.Models.Mapping DataTypeId = -88 }, "Another tab"); MockedContentTypes.EnsureAllIds(ctChild1, 7777); - var contentType = CreateSimpleMediaType("child2", "Child 2", ctChild1, true, "CustomGroup"); + var contentType = MockedContentTypes.CreateSimpleMediaType("child2", "Child 2", ctChild1, true, "CustomGroup"); //not assigned to tab contentType.AddPropertyType(new PropertyType(ShortStringHelper, Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { @@ -748,43 +748,6 @@ namespace Umbraco.Tests.Models.Mapping } - public MediaType CreateSimpleMediaType(string alias, string name, IMediaType parent = null, bool randomizeAliases = false, string propertyGroupName = "Content") - { - var shortStringHelper = Services.GetRequiredService(); - var contentType = parent == null ? new MediaType(shortStringHelper, -1) : new MediaType(shortStringHelper, parent, alias); - - contentType.Alias = alias; - contentType.Name = name; - contentType.Description = "ContentType used for simple text pages"; - contentType.Icon = ".sprTreeDoc3"; - contentType.Thumbnail = "doc2.png"; - contentType.SortOrder = 1; - contentType.CreatorId = 0; - contentType.Trashed = false; - - var contentCollection = new PropertyTypeCollection(false); - contentCollection.Add(new PropertyType(shortStringHelper, Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = RandomAlias("title", randomizeAliases), Name = "Title", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 }); - contentCollection.Add(new PropertyType(shortStringHelper, Constants.PropertyEditors.Aliases.TinyMce, ValueStorageType.Ntext) { Alias = RandomAlias("bodyText", randomizeAliases), Name = "Body Text", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -87 }); - contentCollection.Add(new PropertyType(shortStringHelper, Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext) { Alias = RandomAlias("author", randomizeAliases), Name = "Author", Description = "Name of the author", Mandatory = false, SortOrder = 3, DataTypeId = -88 }); - - var pg = new PropertyGroup(contentCollection) { Name = propertyGroupName, SortOrder = 1 }; - contentType.PropertyGroups.Add(pg); - - //ensure that nothing is marked as dirty - contentType.ResetDirtyProperties(false); - - return contentType; - } - - private static string RandomAlias(string alias, bool randomizeAliases) - { - if (randomizeAliases) - { - return string.Concat(alias, Guid.NewGuid().ToString("N")); - } - - return alias; - } [Test] public void IContentTypeComposition_To_ContentTypeDisplay() diff --git a/src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs b/src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs index e3de162969..adec2ac95a 100644 --- a/src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs +++ b/src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs @@ -15,6 +15,11 @@ namespace Umbraco.Tests.Common.AutoFixture [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor)] public class AutoMoqDataAttribute : AutoDataAttribute { + /// + /// Uses AutoFixture to automatically mock (using Moq) the injected types. E.g when injecting interfaces. + /// AutoFixture is used to generate concrete types. If the concrete type required some types injected, the + /// [Frozen] can be used to ensure the same variable is injected and available as parameter for the test + /// public AutoMoqDataAttribute() : base(() => AutoMockCustomizations.Default) { } @@ -35,6 +40,7 @@ namespace Umbraco.Tests.Common.AutoFixture .Customize(new ConstructorCustomization(typeof(BackOfficeUserManager), new GreedyConstructorQuery())) .Customize(new AutoMoqCustomization()); + // When requesting an IUserStore ensure we actually uses a IUserLockoutStore fixture.Customize>(cc => cc.FromFactory(() => Mock.Of>())); diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index d3e50a987a..f66405b48f 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -250,7 +250,6 @@ - diff --git a/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs b/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs deleted file mode 100644 index 58718a4064..0000000000 --- a/src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs +++ /dev/null @@ -1,526 +0,0 @@ -// using System; -// using System.Collections.Concurrent; -// using System.Collections.Generic; -// using System.Globalization; -// using System.Linq; -// using System.Net; -// using System.Net.Http; -// using System.Net.Http.Formatting; -// using System.Reflection; -// using System.Security.Cryptography; -// using System.Threading.Tasks; -// using System.Web.Http; -// using System.Web.Http.Controllers; -// using System.Web.Http.Hosting; -// using Microsoft.AspNetCore.Identity; -// using Microsoft.Owin; -// using Moq; -// using Newtonsoft.Json; -// using NUnit.Framework; -// using Umbraco.Core; -// using Umbraco.Core.Cache; -// using Umbraco.Web.Composing; -// using Umbraco.Core.Configuration; -// using Umbraco.Core.IO; -// using Umbraco.Core.Logging; -// using Umbraco.Core.Models; -// using Umbraco.Core.Models.Membership; -// using Umbraco.Core.Persistence; -// using Umbraco.Core.Persistence.Mappers; -// using Umbraco.Core.Persistence.Querying; -// using Umbraco.Core.Services; -// using Umbraco.Tests.TestHelpers; -// using Umbraco.Tests.TestHelpers.ControllerTesting; -// using Umbraco.Tests.TestHelpers.Entities; -// using Umbraco.Tests.Testing; -// using Umbraco.Web; -// using Umbraco.Web.Editors; -// using Umbraco.Web.Features; -// using Umbraco.Web.Models.ContentEditing; -// using IUser = Umbraco.Core.Models.Membership.IUser; -// using Umbraco.Core.Mapping; -// using Umbraco.Core.Configuration.UmbracoSettings; -// using Umbraco.Core.Hosting; -// using Umbraco.Web.Routing; -// using Umbraco.Core.Media; -// using Umbraco.Net; -// using Umbraco.Persistance.SqlCe; -// using Umbraco.Web.Security; -// using BackOfficeIdentityUser = Umbraco.Core.BackOffice.BackOfficeIdentityUser; -// -// namespace Umbraco.Tests.Web.Controllers -// { -// [TestFixture] -// [UmbracoTest(Database = UmbracoTestOptions.Database.None)] -// public class UsersControllerTests : TestWithDatabaseBase -// { -// protected override void ComposeApplication(bool withApplication) -// { -// base.ComposeApplication(withApplication); -// //if (!withApplication) return; -// -// // replace the true IUserService implementation with a mock -// // so that each test can configure the service to their liking -// Composition.RegisterUnique(f => Mock.Of()); -// -// // kill the true IEntityService too -// Composition.RegisterUnique(f => Mock.Of()); -// -// Composition.RegisterUnique(); -// } -// -// [Test] -// public async Task Save_User() -// { -// ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor) -// { -// var userServiceMock = Mock.Get(ServiceContext.UserService); -// -// userServiceMock.Setup(service => service.Save(It.IsAny(), It.IsAny())) -// .Callback((IUser u, bool raiseEvents) => -// { -// u.Id = 1234; -// }); -// userServiceMock.Setup(service => service.GetAllUserGroups(It.IsAny())) -// .Returns(new[] { Mock.Of(group => group.Id == 123 && group.Alias == "writers" && group.Name == "Writers") }); -// userServiceMock.Setup(service => service.GetUserGroupsByAlias(It.IsAny())) -// .Returns(new[] { Mock.Of(group => group.Id == 123 && group.Alias == "writers" && group.Name == "Writers") }); -// userServiceMock.Setup(service => service.GetUserById(It.IsAny())) -// .Returns((int id) => id == 1234 ? new User(TestObjects.GetGlobalSettings(), 1234, "Test", "test@test.com", "test@test.com", "", null, new List(), new int[0], new int[0]) : null); -// -// var usersController = new UsersController( -// Factory.GetInstance(), -// umbracoContextAccessor, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// ShortStringHelper, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance() -// -// ); -// return usersController; -// } -// -// var userSave = new UserSave -// { -// Id = 1234, -// Email = "test@test.com", -// Username = "test@test.com", -// Culture = "en", -// Name = "Test", -// UserGroups = new[] { "writers" } -// }; -// -// var runner = new TestRunner(CtrlFactory); -// var response = await runner.Execute("Users", "PostSaveUser", HttpMethod.Post, -// new ObjectContent(userSave, new JsonMediaTypeFormatter())); -// var obj = JsonConvert.DeserializeObject(response.Item2); -// -// Assert.AreEqual(userSave.Name, obj.Name); -// Assert.AreEqual(1234, obj.Id); -// Assert.AreEqual(userSave.Email, obj.Email); -// var userGroupAliases = obj.UserGroups.Select(x => x.Alias).ToArray(); -// foreach (var group in userSave.UserGroups) -// { -// Assert.IsTrue(userGroupAliases.Contains(group)); -// } -// } -// -// private void MockForGetPagedUsers() -// { -// Mock.Get(Current.SqlContext) -// .Setup(x => x.Query()) -// .Returns(new Query(Current.SqlContext)); -// -// var syntax = new SqlCeSyntaxProvider(); -// -// Mock.Get(Current.SqlContext) -// .Setup(x => x.SqlSyntax) -// .Returns(syntax); -// -// var mappers = new MapperCollection(new [] -// { -// new UserMapper(new Lazy(() => Current.SqlContext), new ConcurrentDictionary>()) -// }); -// -// Mock.Get(Current.SqlContext) -// .Setup(x => x.Mappers) -// .Returns(mappers); -// } -// -// [Test] -// public async Task GetPagedUsers_Empty() -// { -// ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor) -// { -// var usersController = new UsersController( -// Factory.GetInstance(), -// umbracoContextAccessor, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// ShortStringHelper, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance() -// ); -// return usersController; -// } -// -// MockForGetPagedUsers(); -// -// var runner = new TestRunner(CtrlFactory); -// var response = await runner.Execute("Users", "GetPagedUsers", HttpMethod.Get); -// -// var obj = JsonConvert.DeserializeObject>(response.Item2); -// Assert.AreEqual(0, obj.TotalItems); -// } -// -// [Test] -// public async Task GetPagedUsers_10() -// { -// ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor) -// { -// //setup some mocks -// var userServiceMock = Mock.Get(ServiceContext.UserService); -// var users = MockedUser.CreateMulipleUsers(10); -// long outVal = 10; -// userServiceMock.Setup(service => service.GetAll( -// It.IsAny(), It.IsAny(), out outVal, It.IsAny(), It.IsAny(), -// It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())) -// .Returns(() => users); -// -// var usersController = new UsersController( -// Factory.GetInstance(), -// umbracoContextAccessor, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// ShortStringHelper, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance() -// ); -// return usersController; -// } -// -// MockForGetPagedUsers(); -// -// var runner = new TestRunner(CtrlFactory); -// var response = await runner.Execute("Users", "GetPagedUsers", HttpMethod.Get); -// -// var obj = JsonConvert.DeserializeObject>(response.Item2); -// Assert.AreEqual(10, obj.TotalItems); -// Assert.AreEqual(10, obj.Items.Count()); -// } -// -// [Test] -// public async Task GetPagedUsers_Fips() -// { -// await RunFipsTest("GetPagedUsers", mock => -// { -// var users = MockedUser.CreateMulipleUsers(10); -// long outVal = 10; -// mock.Setup(service => service.GetAll( -// It.IsAny(), It.IsAny(), out outVal, It.IsAny(), It.IsAny(), -// It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>())) -// .Returns(() => users); -// }, response => -// { -// var obj = JsonConvert.DeserializeObject>(response.Item2); -// Assert.AreEqual(10, obj.TotalItems); -// Assert.AreEqual(10, obj.Items.Count()); -// }); -// } -// -// [Test] -// public async Task GetById_Fips() -// { -// const int mockUserId = 1234; -// var user = MockedUser.CreateUser(); -// -// await RunFipsTest("GetById", mock => -// { -// mock.Setup(service => service.GetUserById(1234)) -// .Returns((int i) => i == mockUserId ? user : null); -// }, response => -// { -// var obj = JsonConvert.DeserializeObject(response.Item2); -// Assert.AreEqual(user.Username, obj.Username); -// Assert.AreEqual(user.Email, obj.Email); -// }, new { controller = "Users", action = "GetById" }, $"Users/GetById/{mockUserId}"); -// } -// -// -// private async Task RunFipsTest(string action, Action> userServiceSetup, -// Action> verification, -// object routeDefaults = null, string url = null) -// { -// ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor) -// { -// //setup some mocks -// var userServiceMock = Mock.Get(ServiceContext.UserService); -// userServiceSetup(userServiceMock); -// -// var usersController = new UsersController( -// Factory.GetInstance(), -// umbracoContextAccessor, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// ShortStringHelper, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance() -// ); -// return usersController; -// } -// -// // Testing what happens if the system were configured to only use FIPS-compliant algorithms -// var typ = typeof(CryptoConfig); -// var flds = typ.GetFields(BindingFlags.Static | BindingFlags.NonPublic); -// var haveFld = flds.FirstOrDefault(f => f.Name == "s_haveFipsAlgorithmPolicy"); -// var isFld = flds.FirstOrDefault(f => f.Name == "s_fipsAlgorithmPolicy"); -// var originalFipsValue = CryptoConfig.AllowOnlyFipsAlgorithms; -// -// try -// { -// if (!originalFipsValue) -// { -// haveFld.SetValue(null, true); -// isFld.SetValue(null, true); -// } -// -// MockForGetPagedUsers(); -// -// var runner = new TestRunner(CtrlFactory); -// var response = await runner.Execute("Users", action, HttpMethod.Get, routeDefaults: routeDefaults, url: url); -// verification(response); -// } -// finally -// { -// if (!originalFipsValue) -// { -// haveFld.SetValue(null, false); -// isFld.SetValue(null, false); -// } -// } -// } -// -// [Test] -// public async Task PostUnlockUsers_When_UserIds_Not_Supplied_Expect_Ok_Response() -// { -// var usersController = CreateSut(); -// -// usersController.Request = new HttpRequestMessage(); -// -// var response = await usersController.PostUnlockUsers(new int[0]); -// -// Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); -// } -// -// [Test] -// public void PostUnlockUsers_When_User_Does_Not_Exist_Expect_InvalidOperationException() -// { -// var mockUserManager = CreateMockUserManager(); -// var usersController = CreateSut(mockUserManager); -// -// mockUserManager.Setup(x => x.FindByIdAsync(It.IsAny())) -// .ReturnsAsync((BackOfficeIdentityUser) null); -// -// Assert.ThrowsAsync(async () => await usersController.PostUnlockUsers(new[] {1})); -// } -// -// [Test] -// public async Task PostUnlockUsers_When_User_Lockout_Update_Fails_Expect_Failure_Response() -// { -// var mockUserManager = CreateMockUserManager(); -// var usersController = CreateSut(mockUserManager); -// -// const string expectedMessage = "identity error!"; -// var user = new BackOfficeIdentityUser( -// new Mock().Object, -// 1, -// new List()) -// { -// Name = "bob" -// }; -// -// mockUserManager.Setup(x => x.FindByIdAsync(It.IsAny())) -// .ReturnsAsync(user); -// mockUserManager.Setup(x => x.SetLockoutEndDateAsync(user, It.IsAny())) -// .ReturnsAsync(IdentityResult.Failed(new IdentityError {Description = expectedMessage})); -// -// var response = await usersController.PostUnlockUsers(new[] { 1 }); -// -// Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode); -// Assert.True(response.Headers.TryGetValues("X-Status-Reason", out var values)); -// Assert.True(values.Contains("Validation failed")); -// -// var responseContent = response.Content as ObjectContent; -// var responseValue = responseContent?.Value as HttpError; -// Assert.NotNull(responseValue); -// Assert.True(responseValue.Message.Contains(expectedMessage)); -// Assert.True(responseValue.Message.Contains(user.Id.ToString())); -// } -// -// [Test] -// public async Task PostUnlockUsers_When_One_UserId_Supplied_Expect_User_Locked_Out_With_Correct_Response_Message() -// { -// var mockUserManager = CreateMockUserManager(); -// var usersController = CreateSut(mockUserManager); -// -// var user = new BackOfficeIdentityUser( -// new Mock().Object, -// 1, -// new List()) -// { -// Name = "bob" -// }; -// -// mockUserManager.Setup(x => x.FindByIdAsync(user.Id.ToString())) -// .ReturnsAsync(user); -// mockUserManager.Setup(x => x.SetLockoutEndDateAsync(user, It.IsAny())) -// .ReturnsAsync(IdentityResult.Success) -// .Verifiable(); -// -// var response = await usersController.PostUnlockUsers(new[] { user.Id }); -// -// Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); -// -// var responseContent = response.Content as ObjectContent; -// var notifications = responseContent?.Value as SimpleNotificationModel; -// Assert.NotNull(notifications); -// Assert.AreEqual(user.Name, notifications.Message); -// mockUserManager.Verify(); -// } -// -// [Test] -// public async Task PostUnlockUsers_When_Multiple_UserIds_Supplied_Expect_User_Locked_Out_With_Correct_Response_Message() -// { -// var mockUserManager = CreateMockUserManager(); -// var usersController = CreateSut(mockUserManager); -// -// var user1 = new BackOfficeIdentityUser( -// new Mock().Object, -// 1, -// new List()) -// { -// Name = "bob" -// }; -// var user2 = new BackOfficeIdentityUser( -// new Mock().Object, -// 2, -// new List()) -// { -// Name = "alice" -// }; -// var userIdsToLock = new[] {user1.Id, user2.Id}; -// -// mockUserManager.Setup(x => x.FindByIdAsync(user1.Id.ToString())) -// .ReturnsAsync(user1); -// mockUserManager.Setup(x => x.FindByIdAsync(user2.Id.ToString())) -// .ReturnsAsync(user2); -// mockUserManager.Setup(x => x.SetLockoutEndDateAsync(user1, It.IsAny())) -// .ReturnsAsync(IdentityResult.Success) -// .Verifiable(); -// mockUserManager.Setup(x => x.SetLockoutEndDateAsync(user2, It.IsAny())) -// .ReturnsAsync(IdentityResult.Success) -// .Verifiable(); -// -// var response = await usersController.PostUnlockUsers(userIdsToLock); -// -// Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); -// -// var responseContent = response.Content as ObjectContent; -// var notifications = responseContent?.Value as SimpleNotificationModel; -// Assert.NotNull(notifications); -// Assert.AreEqual(userIdsToLock.Length.ToString(), notifications.Message); -// mockUserManager.Verify(); -// } -// -// private UsersController CreateSut(IMock mockUserManager = null) -// { -// var mockLocalizedTextService = new Mock(); -// mockLocalizedTextService.Setup(x => x.Localize(It.IsAny(), It.IsAny(), It.IsAny>())) -// .Returns((string key, CultureInfo ci, IDictionary tokens) -// => tokens.Aggregate("", (current, next) => current + (current == string.Empty ? "" : ",") + next.Value)); -// -// var usersController = new UsersController( -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// ServiceContext.CreatePartial(localizedTextService: mockLocalizedTextService.Object), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// ShortStringHelper, -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance(), -// Factory.GetInstance()); -// -// var mockOwinContext = new Mock(); -// var mockUserManagerMarker = new Mock(); -// -// mockOwinContext.Setup(x => x.Get(It.IsAny())) -// .Returns(mockUserManagerMarker.Object); -// mockUserManagerMarker.Setup(x => x.GetManager(It.IsAny())) -// .Returns(mockUserManager?.Object ?? CreateMockUserManager().Object); -// -// usersController.Request = new HttpRequestMessage(); -// usersController.Request.Properties["MS_OwinContext"] = mockOwinContext.Object; -// usersController.Request.Properties[HttpPropertyKeys.RequestContextKey] = new HttpRequestContext {Configuration = new HttpConfiguration()}; -// -// return usersController; -// } -// -// private static Mock CreateMockUserManager() -// { -// return new Mock( -// new Mock().Object, -// new Mock().Object, -// new Mock>().Object, -// null, null, null, null, null, null, null); -// } -// } -// } diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index 081f05fbce..c17e977951 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -67,9 +68,10 @@ namespace Umbraco.Web.BackOffice.Controllers [HttpGet] public async Task Default() { + var viewPath = Path.Combine(_globalSettings.UmbracoPath , Umbraco.Core.Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml"); return await RenderDefaultOrProcessExternalLoginAsync( - () => View(), - () => View()); + () => View(viewPath), + () => View(viewPath)); } /// diff --git a/src/Umbraco.Web.BackOffice/Filters/UserGroupValidateAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/UserGroupValidateAttribute.cs index 4786ae09c5..2767af4ba2 100644 --- a/src/Umbraco.Web.BackOffice/Filters/UserGroupValidateAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/UserGroupValidateAttribute.cs @@ -20,82 +20,79 @@ namespace Umbraco.Web.BackOffice.Filters private class UserGroupValidateFilter : IActionFilter { - private readonly IUserService _userService; - private readonly UmbracoMapper _umbracoMapper; + private readonly UmbracoMapper _umbracoMapper; + private readonly IUserService _userService; - public UserGroupValidateFilter( - IUserService userService, - UmbracoMapper umbracoMapper) - { - _userService = userService ?? throw new ArgumentNullException(nameof(userService)); - _umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper)); - } - - public void OnActionExecuting(ActionExecutingContext context) - { - var userGroupSave = (UserGroupSave) context.ActionArguments["userGroupSave"]; - - userGroupSave.Name = userGroupSave.Name.CleanForXss('[', ']', '(', ')', ':'); - userGroupSave.Alias = userGroupSave.Alias.CleanForXss('[', ']', '(', ')', ':'); - - //Validate the usergroup exists or create one if required - IUserGroup persisted; - switch (userGroupSave.Action) + public UserGroupValidateFilter( + IUserService userService, + UmbracoMapper umbracoMapper) { - case ContentSaveAction.Save: - persisted = _userService.GetUserGroupById(Convert.ToInt32(userGroupSave.Id)); - if (persisted == null) - { - var message = $"User group with id: {userGroupSave.Id} was not found"; - context.Result = new UmbracoErrorResult(HttpStatusCode.NotFound, message); + _userService = userService ?? throw new ArgumentNullException(nameof(userService)); + _umbracoMapper = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper)); + } + + public void OnActionExecuting(ActionExecutingContext context) + { + var userGroupSave = (UserGroupSave) context.ActionArguments["userGroupSave"]; + + userGroupSave.Name = userGroupSave.Name.CleanForXss('[', ']', '(', ')', ':'); + userGroupSave.Alias = userGroupSave.Alias.CleanForXss('[', ']', '(', ')', ':'); + + //Validate the usergroup exists or create one if required + IUserGroup persisted; + switch (userGroupSave.Action) + { + case ContentSaveAction.Save: + persisted = _userService.GetUserGroupById(Convert.ToInt32(userGroupSave.Id)); + if (persisted == null) + { + var message = $"User group with id: {userGroupSave.Id} was not found"; + context.Result = new UmbracoErrorResult(HttpStatusCode.NotFound, message); + return; + } + + if (persisted.Alias != userGroupSave.Alias && persisted.IsSystemUserGroup()) + { + var message = $"User group with alias: {persisted.Alias} cannot be changed"; + context.Result = new UmbracoErrorResult(HttpStatusCode.BadRequest, message); + return; + } + + //map the model to the persisted instance + _umbracoMapper.Map(userGroupSave, persisted); + break; + case ContentSaveAction.SaveNew: + //create the persisted model from mapping the saved model + persisted = _umbracoMapper.Map(userGroupSave); + ((UserGroup) persisted).ResetIdentity(); + break; + default: + context.Result = + new UmbracoErrorResult(HttpStatusCode.NotFound, new ArgumentOutOfRangeException()); return; - } + } - if (persisted.Alias != userGroupSave.Alias && persisted.IsSystemUserGroup()) - { - var message = $"User group with alias: {persisted.Alias} cannot be changed"; - context.Result = new UmbracoErrorResult(HttpStatusCode.BadRequest, message); - return; - } + //now assign the persisted entity to the model so we can use it in the action + userGroupSave.PersistedUserGroup = persisted; - //map the model to the persisted instance - _umbracoMapper.Map(userGroupSave, persisted); - break; - case ContentSaveAction.SaveNew: - //create the persisted model from mapping the saved model - persisted = _umbracoMapper.Map(userGroupSave); - ((UserGroup)persisted).ResetIdentity(); - break; - default: - context.Result = new UmbracoErrorResult(HttpStatusCode.NotFound, new ArgumentOutOfRangeException()); - return; + var existing = _userService.GetUserGroupByAlias(userGroupSave.Alias); + if (existing != null && existing.Id != userGroupSave.PersistedUserGroup.Id) + { + context.ModelState.AddModelError("Alias", "A user group with this alias already exists"); + } + + // TODO: Validate the name is unique? + + if (context.ModelState.IsValid == false) + { + //if it is not valid, do not continue and return the model state + throw HttpResponseException.CreateValidationErrorResponse(context.ModelState); + } } - //now assign the persisted entity to the model so we can use it in the action - userGroupSave.PersistedUserGroup = persisted; - - var existing = _userService.GetUserGroupByAlias(userGroupSave.Alias); - if (existing != null && existing.Id != userGroupSave.PersistedUserGroup.Id) + public void OnActionExecuted(ActionExecutedContext context) { - context.ModelState.AddModelError("Alias", "A user group with this alias already exists"); - } - - // TODO: Validate the name is unique? - - if (context.ModelState.IsValid == false) - { - //if it is not valid, do not continue and return the model state - throw HttpResponseException.CreateValidationErrorResponse(context.ModelState); } } - - public void OnActionExecuted(ActionExecutedContext context) - { - - } - - } - - } } diff --git a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj index 911a157223..3a37c59859 100644 --- a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj +++ b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj @@ -6,6 +6,10 @@ 8 + + bin\Release\Umbraco.Web.BackOffice.xml + + diff --git a/src/Umbraco.Web.Common/Install/InstallController.cs b/src/Umbraco.Web.Common/Install/InstallController.cs index 8ba88a423a..2b9f716516 100644 --- a/src/Umbraco.Web.Common/Install/InstallController.cs +++ b/src/Umbraco.Web.Common/Install/InstallController.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Http.Extensions; +using System.IO; +using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; using System.Threading.Tasks; @@ -83,13 +84,14 @@ namespace Umbraco.Web.Common.Install ViewData.SetInstallApiBaseUrl(Url.GetInstallerApiUrl()); // get the base umbraco folder - ViewData.SetUmbracoBaseFolder(_hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath)); + var baseFolder = _hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath); + ViewData.SetUmbracoBaseFolder(baseFolder); ViewData.SetUmbracoVersion(_umbracoVersion.SemanticVersion); await _installHelper.SetInstallStatusAsync(false, ""); - return View(); + return View(Path.Combine(baseFolder , Umbraco.Core.Constants.Web.Mvc.InstallArea, nameof(Index) + ".cshtml")); } /// @@ -100,7 +102,7 @@ namespace Umbraco.Web.Common.Install public ActionResult Redirect() { var uri = HttpContext.Request.GetEncodedUrl(); - + // redirect to install ReportRuntime(_logger, _runtime.Level, "Umbraco must install or upgrade."); diff --git a/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs b/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs index 7a1d907520..959c4c27a2 100644 --- a/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs +++ b/src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs @@ -17,6 +17,7 @@ using Umbraco.Web.Common.Profiler; using Umbraco.Web.Common.Install; using Umbraco.Extensions; using System.Linq; +using Umbraco.Core.Configuration; using Umbraco.Web.Common.Controllers; using Umbraco.Web.Common.Middleware; using Umbraco.Web.Common.ModelBinding; @@ -95,6 +96,7 @@ namespace Umbraco.Web.Common.Runtime composition.RegisterUnique(); composition.RegisterUnique(); + composition.RegisterUnique(factory => new LegacyPasswordSecurity(factory.GetInstance())); } diff --git a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj index 9f6509cd82..447681c4ff 100644 --- a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj +++ b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj @@ -6,6 +6,10 @@ 8 + + bin\Release\Umbraco.Web.Common.xml + + diff --git a/src/Umbraco.Web.UI/config/Lang/cs-CZ.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/cs-CZ.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/cs-CZ.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/cs-CZ.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/da-DK.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/da-DK.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/da-DK.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/da-DK.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/de-DE.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/de-DE.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/de-DE.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/de-DE.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/en-GB.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/en-GB.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/en-GB.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/en-GB.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/en-US.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/en-US.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/en-US.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/en-US.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/es-ES.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/es-ES.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/es-ES.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/es-ES.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/fr-FR.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/fr-FR.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/fr-FR.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/fr-FR.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/he-IL.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/he-IL.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/he-IL.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/he-IL.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/it-IT.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/it-IT.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/it-IT.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/it-IT.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/ja-JP.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/ja-JP.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/ja-JP.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/ja-JP.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/ko-KR.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/ko-KR.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/ko-KR.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/ko-KR.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/nb-NO.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/nb-NO.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/nb-NO.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/nb-NO.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/nl-NL.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/nl-NL.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/nl-NL.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/nl-NL.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/pl-PL.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/pl-PL.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/pl-PL.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/pl-PL.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/pt-BR.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/pt-BR.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/pt-BR.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/pt-BR.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/ru-RU.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/ru-RU.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/ru-RU.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/ru-RU.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/sv-SE.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/sv-SE.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/sv-SE.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/sv-SE.user.xml diff --git a/src/Umbraco.Web.UI/config/Lang/zh-CN.user.xml b/src/Umbraco.Web.UI.NetCore/Config/lang/zh-CN.user.xml similarity index 100% rename from src/Umbraco.Web.UI/config/Lang/zh-CN.user.xml rename to src/Umbraco.Web.UI.NetCore/Config/lang/zh-CN.user.xml diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj index f467ae28a1..ac7d01fd74 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj +++ b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj @@ -4,6 +4,11 @@ netcoreapp3.1 Umbraco.Web.UI.NetCore + + + bin\Release\Umbraco.Web.UI.NetCore.xml + + @@ -87,42 +92,4 @@ - - - - - - - - - - - - - - - - - Designer - serilog.config - - - Designer - serilog.user.config - - - - - - Designer - - - Designer - - - - - - - diff --git a/src/Umbraco.Web.UI.NetCore/Areas/UmbracoBackOffice/Views/BackOffice/Default.cshtml b/src/Umbraco.Web.UI.NetCore/Umbraco/UmbracoBackOffice/Default.cshtml similarity index 98% rename from src/Umbraco.Web.UI.NetCore/Areas/UmbracoBackOffice/Views/BackOffice/Default.cshtml rename to src/Umbraco.Web.UI.NetCore/Umbraco/UmbracoBackOffice/Default.cshtml index 5bf833dedd..3c17e89485 100644 --- a/src/Umbraco.Web.UI.NetCore/Areas/UmbracoBackOffice/Views/BackOffice/Default.cshtml +++ b/src/Umbraco.Web.UI.NetCore/Umbraco/UmbracoBackOffice/Default.cshtml @@ -1,6 +1,4 @@ @using Umbraco.Core -@using Umbraco.Web.Composing -@using Umbraco.Web @using Umbraco.Web.WebAssets @using Umbraco.Web.Common.Security @using Umbraco.Core.WebAssets diff --git a/src/Umbraco.Web.UI.NetCore/Areas/UmbracoInstall/Views/Install/Index.cshtml b/src/Umbraco.Web.UI.NetCore/Umbraco/UmbracoInstall/Index.cshtml similarity index 100% rename from src/Umbraco.Web.UI.NetCore/Areas/UmbracoInstall/Views/Install/Index.cshtml rename to src/Umbraco.Web.UI.NetCore/Umbraco/UmbracoInstall/Index.cshtml diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index f2e37bdc3f..2e05df3b29 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -80,7 +80,6 @@ - @@ -139,24 +138,6 @@ True Settings.settings - - - - - - - - - - - - - - - - - - @@ -201,6 +182,74 @@ Designer + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml similarity index 97% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml index 5c32331d36..576541ea4a 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml @@ -2,7 +2,7 @@ @using Umbraco.Web @using Umbraco.Web.Composing @using Umbraco.Web.Controllers -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var profileModel = Current.MembershipHelper.GetCurrentMemberProfileModel(); diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Gallery.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml similarity index 96% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Gallery.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml index 3cc018f6d2..8388c7a90d 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Gallery.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Gallery.cshtml @@ -3,7 +3,7 @@ @using Umbraco.Core @using Umbraco.Core.Media @using Umbraco.Web.Composing -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* Macro to display a gallery of images from the Media section. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml similarity index 93% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml index 62700f96a7..070f67ff23 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml @@ -1,6 +1,6 @@ @using Umbraco.Core @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet makes a list of links to the of parents of the current page using an unordered HTML list. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml similarity index 94% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml index 6d341609be..ec41d45c0c 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml @@ -1,6 +1,6 @@ @using Umbraco.Web @using Umbraco.Web.Composing -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* Macro to list all child pages under a specific page in the content tree. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml similarity index 90% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml index 9362da2ee2..e6606d6204 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml @@ -1,5 +1,5 @@ @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet makes a list of links to the of children of the current page using an unordered HTML list. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml similarity index 92% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml index ca104da99d..2c2cc4422b 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml @@ -1,5 +1,5 @@ @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet makes a list of links to the of children of the current page using an unordered HTML list. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml similarity index 91% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml index c6d824dea4..d0398e7272 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml @@ -1,5 +1,5 @@ @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet makes a list of links to the of children of the current page using an unordered HTML list. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml similarity index 94% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml index d80fe016f6..1bffae04c4 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml @@ -1,5 +1,5 @@ @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* Macro to list all child pages with a specific property, sorted by the value of that property. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml similarity index 91% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml index 658d4883c2..c90e419903 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml @@ -1,6 +1,6 @@ @using Umbraco.Core.Models.PublishedContent @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet shows how simple it is to fetch only children of a certain Document Type. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml similarity index 97% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml index 14d74aa64d..7ae917b41d 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml @@ -1,6 +1,6 @@ @using Umbraco.Core.Models.PublishedContent @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet creates links for every single page (no matter how deep) below diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml similarity index 94% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml index 0910f76ed7..386bc824df 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml @@ -1,6 +1,6 @@ @using Umbraco.Web @using Umbraco.Web.Composing -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* Macro to display a series of images from a media folder. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Login.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Login.cshtml similarity index 95% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Login.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Login.cshtml index fbb7627120..b50d1ac806 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Login.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Login.cshtml @@ -3,7 +3,7 @@ @using Umbraco.Web.Composing @using Umbraco.Web.Models @using Umbraco.Web.Controllers -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var loginModel = new LoginModel(); diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml similarity index 93% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml index e3dc5d3c7f..78b06151af 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml @@ -3,7 +3,7 @@ @using Umbraco.Web.Composing @using Umbraco.Web.Models @using Umbraco.Web.Controllers -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var loginStatusModel = Current.MembershipHelper.GetCurrentLoginStatus(); diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml similarity index 92% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml index 2cf1da9cec..d845e699e0 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml @@ -1,6 +1,6 @@ @using Umbraco.Core.Models.PublishedContent @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet lists the items from a Multinode tree picker, using the picker's default settings. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Navigation.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml similarity index 92% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Navigation.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml index 499e4bfca7..15427f4b3c 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/Navigation.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/Navigation.cshtml @@ -1,6 +1,6 @@ @using Umbraco.Core @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet displays a list of links of the pages immediately under the top-most page in the content tree. diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml similarity index 98% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml index 895719f693..5e6230a294 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml @@ -2,7 +2,7 @@ @using Umbraco.Web @using Umbraco.Web.Composing @using Umbraco.Web.Controllers -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ @* diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml similarity index 95% rename from src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml rename to src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml index 15fda02b58..a4127a9636 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml @@ -1,7 +1,7 @@ @using Umbraco.Core @using Umbraco.Core.Models.PublishedContent @using Umbraco.Web -@inherits Umbraco.Web.Common.Macros.PartialViewMacroPage +@inherits Umbraco.Web.Macros.PartialViewMacroPage @* This snippet makes a list of links of all visible pages of the site, as nested unordered HTML lists. diff --git a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj index d2ef3b58f6..70355f51e8 100644 --- a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj +++ b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj @@ -4,6 +4,14 @@ netcoreapp3.1 Library + + + bin\Release\Umbraco.Web.Website.xml + + + + bin\Release\Umbraco.Web.Website.xml +