From c91281c4b80bea1bba6c23b8e697835691d109f3 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 30 Jun 2020 23:02:36 +0200 Subject: [PATCH 01/22] NuGet.org had TLS 1.0 and 1.1 disabled - https://devblogs.microsoft.com/nuget/deprecating-tls-1-0-and-1-1-on-nuget-org/. Therefore we need this line specifying Tls12 --- build/build-bootstrap.ps1 | 1 + 1 file changed, 1 insertion(+) 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." } } From 6490d7dc149a4b2b81a2a166755ff2fae2e53c46 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 30 Jun 2020 23:07:38 +0200 Subject: [PATCH 02/22] Changing nuspec files for .net core projs --- build/NuSpecs/UmbracoCms.Core.nuspec | 88 ++++++++++++++++++++-------- build/NuSpecs/UmbracoCms.Web.nuspec | 61 +++++++++---------- build/NuSpecs/UmbracoCms.nuspec | 40 +++++-------- 3 files changed, 106 insertions(+), 83 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index fce15eb487..8b34a312a3 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -2,60 +2,100 @@ 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.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..7f0b0f9626 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -2,65 +2,55 @@ 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 - + - - - - - - + - - - + + - + - + - + - + + --> From a2c54018a7a5d01f8c2318e2ad4d1d6cf4fd0463 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 30 Jun 2020 23:10:51 +0200 Subject: [PATCH 03/22] modifying CompileUmbraco() and PreparePackages() functions needed before packaging the nuget packages --- build/build.ps1 | 66 ++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/build/build.ps1 b/build/build.ps1 index c2c5bdd232..a59eb2c5ca 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 }) @@ -253,7 +263,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 +292,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 +312,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\umbraco\assets", "*", "$tmp\WebApp\umbraco\assets") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\js", "*", "$tmp\WebApp\umbraco\js") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\lib", "*", "$tmp\WebApp\umbraco\lib") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\views", "*", "$tmp\WebApp\umbraco\views") }) $ubuild.DefineMethod("PackageZip", From c03bff4399c0133b9e86f54ec3658dd11ec47505 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 7 Jul 2020 16:10:06 +0200 Subject: [PATCH 04/22] Nuget package specifications for SQL CE --- build/NuSpecs/UmbracoCms.SqlCe.nuspec | 42 +++++++++++++++++++++++++++ build/build.ps1 | 9 ++++++ 2 files changed, 51 insertions(+) create mode 100644 build/NuSpecs/UmbracoCms.SqlCe.nuspec diff --git a/build/NuSpecs/UmbracoCms.SqlCe.nuspec b/build/NuSpecs/UmbracoCms.SqlCe.nuspec new file mode 100644 index 0000000000..6c2f5584bb --- /dev/null +++ b/build/NuSpecs/UmbracoCms.SqlCe.nuspec @@ -0,0 +1,42 @@ + + + + UmbracoCms.SqlCe + 9.0.0 + Umbraco Cms Core Binaries + 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/build.ps1 b/build/build.ps1 index a59eb2c5ca..5a8219366c 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -247,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 @@ -420,6 +423,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")) { From 6bb33c865f554de29e4dc8fa2164e92b7655c335 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Tue, 7 Jul 2020 20:40:44 +0200 Subject: [PATCH 05/22] Small fixes to build.ps1 and added xml doc generation to projects Signed-off-by: Bjarke Berg --- build/build.ps1 | 24 ++++++------------- .../Umbraco.Configuration.csproj | 4 ++++ src/Umbraco.Core/Umbraco.Core.csproj | 4 ++++ .../Umbraco.Infrastructure.csproj | 4 ++++ .../Umbraco.Persistance.SqlCe.csproj | 4 ++++ .../Umbraco.PublishedCache.NuCache.csproj | 4 ++++ .../Umbraco.Web.BackOffice.csproj | 4 ++++ .../Umbraco.Web.Common.csproj | 4 ++++ .../Umbraco.Web.UI.NetCore.csproj | 4 ++++ .../Umbraco.Web.Website.csproj | 4 ++++ 10 files changed, 43 insertions(+), 17 deletions(-) diff --git a/build/build.ps1 b/build/build.ps1 index a59eb2c5ca..9b1d877e61 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -319,10 +319,10 @@ # copy Belle Write-Host "Copy Belle" - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\assets", "*", "$tmp\WebApp\umbraco\assets") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\js", "*", "$tmp\WebApp\umbraco\js") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\lib", "*", "$tmp\WebApp\umbraco\lib") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\views", "*", "$tmp\WebApp\umbraco\views") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\assets", "*", "$tmp\WebApp\wwwroot\umbraco\assets") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\js", "*", "$tmp\WebApp\wwwroot\umbraco\js") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\lib", "*", "$tmp\WebApp\wwwroot\umbraco\lib") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\views", "*", "$tmp\WebApp\wwwroot\umbraco\views") }) $ubuild.DefineMethod("PackageZip", @@ -375,15 +375,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" @@ -470,7 +461,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" @@ -481,7 +472,7 @@ & npx gulp docs Pop-Location - + # change baseUrl $BaseUrl = "https://our.umbraco.com/apidocs/v8/ui/" $IndexPath = "./api/index.html" @@ -513,8 +504,7 @@ $this.PackageZip() if ($this.OnError()) { return } $this.VerifyNuGet() - if ($this.OnError()) { return } - $this.PrepareNuGet() + $this.VerifyNuGet() if ($this.OnError()) { return } $this.PackageNuGet() if ($this.OnError()) { return } diff --git a/src/Umbraco.Configuration/Umbraco.Configuration.csproj b/src/Umbraco.Configuration/Umbraco.Configuration.csproj index 2337ea24f8..938b089225 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/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 53e6fe3fbc..58f8c840dc 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/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj index 1af8ce9119..e93923a688 100644 --- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj +++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj @@ -5,6 +5,10 @@ 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..b6e81ce2bd 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..f0f7d32835 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.Web.BackOffice/Umbraco.Web.BackOffice.csproj b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj index ed2b2b482c..5842c877fa 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/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj index 9f6509cd82..60c6bcd47f 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.NetCore/Umbraco.Web.UI.NetCore.csproj b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj index 8f7b78b128..dd5ef937da 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,10 @@ netcoreapp3.1 Umbraco.Web.UI.NetCore + + + bin\Release\Umbraco.Web.UI.NetCore.xml + diff --git a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj index d2ef3b58f6..e7d6bdcfac 100644 --- a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj +++ b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj @@ -5,6 +5,10 @@ Library + + bin\Release\Umbraco.Web.Website.xml + + From f7c6d1c68c058280ee56b31af92879f77b0a8be1 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 8 Jul 2020 06:37:14 +0200 Subject: [PATCH 06/22] bugfix Signed-off-by: Bjarke Berg --- build/build.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/build.ps1 b/build/build.ps1 index 9b1d877e61..a390bfd3b4 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -504,7 +504,6 @@ $this.PackageZip() if ($this.OnError()) { return } $this.VerifyNuGet() - $this.VerifyNuGet() if ($this.OnError()) { return } $this.PackageNuGet() if ($this.OnError()) { return } From 8c46eab9396397cc68c1e37d96ecaae21df4cdf4 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 8 Jul 2020 06:45:10 +0200 Subject: [PATCH 07/22] bugfix Signed-off-by: Bjarke Berg --- build/build.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build.ps1 b/build/build.ps1 index a390bfd3b4..9f68d7e811 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -319,10 +319,10 @@ # copy Belle Write-Host "Copy Belle" - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\assets", "*", "$tmp\WebApp\wwwroot\umbraco\assets") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\js", "*", "$tmp\WebApp\wwwroot\umbraco\js") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\lib", "*", "$tmp\WebApp\wwwroot\umbraco\lib") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\wwwroot\views", "*", "$tmp\WebApp\wwwroot\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", From 0a088e4ef43b4a0fe5f870ea11b28305d641f834 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 8 Jul 2020 06:48:41 +0200 Subject: [PATCH 08/22] casing changed Signed-off-by: Bjarke Berg --- build/build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.ps1 b/build/build.ps1 index 9f68d7e811..6468ecf571 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -180,9 +180,9 @@ $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.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") + $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") From 8c38c22648df500742a2cbe0f6638384f3109fe8 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Wed, 8 Jul 2020 08:40:55 +0200 Subject: [PATCH 09/22] Added additional target framework and changed nuget package title --- build/NuSpecs/UmbracoCms.SqlCe.nuspec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.SqlCe.nuspec b/build/NuSpecs/UmbracoCms.SqlCe.nuspec index 6c2f5584bb..184928f127 100644 --- a/build/NuSpecs/UmbracoCms.SqlCe.nuspec +++ b/build/NuSpecs/UmbracoCms.SqlCe.nuspec @@ -3,7 +3,7 @@ UmbracoCms.SqlCe 9.0.0 - Umbraco Cms Core Binaries + Umbraco Cms Sql Ce Add-on Umbraco HQ Umbraco HQ MIT @@ -17,13 +17,15 @@ - + + + From 6282ac4a5b944bc820b7849f8ea51201f067de98 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Wed, 8 Jul 2020 09:07:54 +0200 Subject: [PATCH 10/22] Merged changes from base branch --- build/build.ps1 | 26 +++++-------------- .../Umbraco.Configuration.csproj | 4 +++ src/Umbraco.Core/Umbraco.Core.csproj | 4 +++ .../Umbraco.Infrastructure.csproj | 6 ++++- .../Umbraco.Persistance.SqlCe.csproj | 4 +++ .../Umbraco.PublishedCache.NuCache.csproj | 4 +++ .../Umbraco.Web.BackOffice.csproj | 4 +++ .../Umbraco.Web.Common.csproj | 4 +++ .../Umbraco.Web.UI.NetCore.csproj | 5 ++++ .../Umbraco.Web.Website.csproj | 4 +++ 10 files changed, 45 insertions(+), 20 deletions(-) diff --git a/build/build.ps1 b/build/build.ps1 index 5a8219366c..7b491768dc 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -180,10 +180,10 @@ $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.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.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" @@ -322,10 +322,10 @@ # copy Belle Write-Host "Copy Belle" - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\assets", "*", "$tmp\WebApp\umbraco\assets") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\js", "*", "$tmp\WebApp\umbraco\js") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\umbraco\lib", "*", "$tmp\WebApp\umbraco\lib") - $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\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", @@ -378,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", @@ -523,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/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/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/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.Web.BackOffice/Umbraco.Web.BackOffice.csproj b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj index ed2b2b482c..1c05a56f71 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/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.NetCore/Umbraco.Web.UI.NetCore.csproj b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj index 8f7b78b128..c2b2e2b7c6 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 + + diff --git a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj index d2ef3b58f6..17a0630c83 100644 --- a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj +++ b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj @@ -4,6 +4,10 @@ netcoreapp3.1 Library + + + bin\Release\Umbraco.Web.Website.xml + From 1dcacda03686543942e146873fef9b08edd517eb Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 8 Jul 2020 11:18:23 +0200 Subject: [PATCH 11/22] Moved umbraco cshtml files into the umbraco folder Signed-off-by: Bjarke Berg --- .../Controllers/BackOfficeController.cs | 6 ++++-- src/Umbraco.Web.Common/Install/InstallController.cs | 10 ++++++---- .../Umbraco.Web.UI.NetCore.csproj | 9 +++------ .../UmbracoBackOffice}/Default.cshtml | 2 -- .../Install => Umbraco/UmbracoInstall}/Index.cshtml | 0 5 files changed, 13 insertions(+), 14 deletions(-) rename src/Umbraco.Web.UI.NetCore/{Areas/UmbracoBackOffice/Views/BackOffice => Umbraco/UmbracoBackOffice}/Default.cshtml (98%) rename src/Umbraco.Web.UI.NetCore/{Areas/UmbracoInstall/Views/Install => Umbraco/UmbracoInstall}/Index.cshtml (100%) 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.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.UI.NetCore/Umbraco.Web.UI.NetCore.csproj b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj index dd5ef937da..d9641dc172 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj +++ b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj @@ -17,6 +17,7 @@ + @@ -54,14 +55,10 @@ - - true - PreserveNewest - - + 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 From 819c1ba7aece3788f4a2bbf5d75c287123e71633 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 9 Jul 2020 10:51:56 +0200 Subject: [PATCH 12/22] Format fix --- .../Filters/UserGroupValidateAttribute.cs | 131 +++++++++--------- 1 file changed, 64 insertions(+), 67 deletions(-) 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) - { - - } - - } - - } } From 2fa13e010c45b198a0d4ad6d5dd7546cf9865bb3 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 9 Jul 2020 11:00:29 +0200 Subject: [PATCH 13/22] Added xml doc to AutoMoqDataAttribute --- .../AutoFixture/AutoMoqDataAttribute.cs | 6 + src/Umbraco.Tests/Umbraco.Tests.csproj | 1 - .../Web/Controllers/UsersControllerTests.cs | 526 ------------------ 3 files changed, 6 insertions(+), 527 deletions(-) delete mode 100644 src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs 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); -// } -// } -// } From 1f3d2b13d39222f4660c93941983a5d9fb37e931 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 9 Jul 2020 11:02:28 +0200 Subject: [PATCH 14/22] Cleanup test by reusing MockedContentTypes --- .../Mapping/ContentTypeModelMappingTests.cs | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) 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() From 32893d6adbe7514c2c7fdd0d7f6676d6a6167b66 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 9 Jul 2020 11:06:38 +0200 Subject: [PATCH 15/22] Fix wrong xml doc comment --- .../Scheduling/BackgroundTaskRunner.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) { From a2fa6e521daa35d9bc69c60d8d0f04cf87069478 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 9 Jul 2020 18:02:12 +0200 Subject: [PATCH 16/22] UmbracoCms.nuspec and file copying --- build/NuSpecs/UmbracoCms.nuspec | 44 +++++----------- build/NuSpecs/build/UmbracoCms.props | 20 +++---- build/NuSpecs/build/UmbracoCms.targets | 72 ++++++-------------------- 3 files changed, 38 insertions(+), 98 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index 7f0b0f9626..5db3a439d9 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -16,43 +16,27 @@ 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) - - - + + + + + + + + + + + From 1625cb323d780b30d6e13d2e166a7c3457e09f0c Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 10 Jul 2020 06:44:56 +0200 Subject: [PATCH 17/22] Moved lang-folder Signed-off-by: Bjarke Berg --- .../Config/lang}/cs-CZ.user.xml | 0 .../Config/lang}/da-DK.user.xml | 0 .../Config/lang}/de-DE.user.xml | 0 .../Config/lang}/en-GB.user.xml | 0 .../Config/lang}/en-US.user.xml | 0 .../Config/lang}/es-ES.user.xml | 0 .../Config/lang}/fr-FR.user.xml | 0 .../Config/lang}/he-IL.user.xml | 0 .../Config/lang}/it-IT.user.xml | 0 .../Config/lang}/ja-JP.user.xml | 0 .../Config/lang}/ko-KR.user.xml | 0 .../Config/lang}/nb-NO.user.xml | 0 .../Config/lang}/nl-NL.user.xml | 0 .../Config/lang}/pl-PL.user.xml | 0 .../Config/lang}/pt-BR.user.xml | 0 .../Config/lang}/ru-RU.user.xml | 0 .../Config/lang}/sv-SE.user.xml | 0 .../Config/lang}/zh-CN.user.xml | 0 .../Umbraco.Web.UI.NetCore.csproj | 151 ++++++------------ src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 18 --- 20 files changed, 53 insertions(+), 116 deletions(-) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/cs-CZ.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/da-DK.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/de-DE.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/en-GB.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/en-US.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/es-ES.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/fr-FR.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/he-IL.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/it-IT.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/ja-JP.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/ko-KR.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/nb-NO.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/nl-NL.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/pl-PL.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/pt-BR.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/ru-RU.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/sv-SE.user.xml (100%) rename src/{Umbraco.Web.UI/config/Lang => Umbraco.Web.UI.NetCore/Config/lang}/zh-CN.user.xml (100%) 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 30859c2d71..67f1c56b0f 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj +++ b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj @@ -17,72 +17,6 @@ - - - - - - - - - - - - - - - - - - - - - tinyMceConfig.config - Designer - - - umbracoSettings.config - Designer - - - - - - - - - - - - - - - - Designer - - - Designer - - - - - - - - - - - - - - - - - - - - - @@ -90,41 +24,62 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - Designer - serilog.config - - - Designer - serilog.user.config - - - - - - Designer - - - Designer - - - - - + + + + + + + + + + + + + + + + + + diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 952e8e002f..8d47a7b019 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -143,24 +143,6 @@ True Settings.settings - - - - - - - - - - - - - - - - - - From 498f01fa109b070803fd1b56636f2cd1d21c7a0d Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Date: Fri, 10 Jul 2020 11:24:50 +0200 Subject: [PATCH 18/22] Removing duplicated folder reference which causes the proj to not load in Visual Studio --- src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj | 1 - 1 file changed, 1 deletion(-) 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 0453c692df..51511196de 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj +++ b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj @@ -15,7 +15,6 @@ - From d94ecfe65e7bb6ffb8fe173ca83347a431c7bcb0 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 10 Jul 2020 13:00:54 +0200 Subject: [PATCH 19/22] Fixes for running using nuget package Signed-off-by: Bjarke Berg --- build/NuSpecs/UmbracoCms.Core.nuspec | 15 ++++++--------- .../Models/ContentSettings.cs | 2 +- src/Umbraco.Core/Composing/ReferenceResolver.cs | 2 +- .../NotificationMethods/NotificationMethodBase.cs | 3 +-- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index 8b34a312a3..6e00e02bbe 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -26,7 +26,7 @@ - + @@ -61,19 +61,16 @@ - - - - - - - + + + + @@ -81,7 +78,7 @@ - + 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.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.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; From 1c38b25cfb16a929a0a8c9b0d73d913ed3cd79fe Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 10 Jul 2020 13:04:24 +0200 Subject: [PATCH 20/22] fix for csproj file Signed-off-by: Bjarke Berg --- .../Umbraco.Web.UI.NetCore.csproj | 126 ------------------ 1 file changed, 126 deletions(-) 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 de4c1a24a9..043d72634f 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj +++ b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj @@ -17,136 +17,10 @@ - - - - - - - - - - - - - - - - - - tinyMceConfig.config - Designer - - - umbracoSettings.config - Designer - - - - - - - - - - - - - - - - true - PreserveNewest - - - Designer - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From e0ae0551f81d57a999531d76c8ec82788d894324 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 10 Jul 2020 13:10:56 +0200 Subject: [PATCH 21/22] Moved back invalid templates to legacy UI project Signed-off-by: Bjarke Berg --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 69 ++++++++++++++++++- .../Templates/EditProfile.cshtml | 2 +- .../Templates/Gallery.cshtml | 2 +- .../ListAncestorsFromCurrentPage.cshtml | 2 +- .../ListChildPagesFromChangeableSource.cshtml | 2 +- .../ListChildPagesFromCurrentPage.cshtml | 2 +- .../ListChildPagesOrderedByDate.cshtml | 2 +- .../ListChildPagesOrderedByName.cshtml | 2 +- .../ListChildPagesOrderedByProperty.cshtml | 2 +- .../ListChildPagesWithDoctype.cshtml | 2 +- .../ListDescendantsFromCurrentPage.cshtml | 2 +- .../ListImagesFromMediaFolder.cshtml | 2 +- .../PartialViewMacros/Templates/Login.cshtml | 2 +- .../Templates/LoginStatus.cshtml | 2 +- .../Templates/MultinodeTree-picker.cshtml | 2 +- .../Templates/Navigation.cshtml | 2 +- .../Templates/RegisterMember.cshtml | 2 +- .../Templates/SiteMap.cshtml | 2 +- 18 files changed, 85 insertions(+), 18 deletions(-) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml (97%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/Gallery.cshtml (96%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListAncestorsFromCurrentPage.cshtml (93%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListChildPagesFromChangeableSource.cshtml (94%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListChildPagesFromCurrentPage.cshtml (90%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByDate.cshtml (92%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByName.cshtml (91%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListChildPagesOrderedByProperty.cshtml (94%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListChildPagesWithDoctype.cshtml (91%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListDescendantsFromCurrentPage.cshtml (97%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/ListImagesFromMediaFolder.cshtml (94%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/Login.cshtml (95%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml (93%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/MultinodeTree-picker.cshtml (92%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/Navigation.cshtml (92%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml (98%) rename src/{Umbraco.Web.UI.NetCore => Umbraco.Web.UI}/Umbraco/PartialViewMacros/Templates/SiteMap.cshtml (95%) diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 8d47a7b019..88ba56b9a4 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -80,7 +80,6 @@ - @@ -187,6 +186,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. From 03bb780c1638f4b4a5fd209e3d52283c6d2a83d6 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 10 Jul 2020 14:40:44 +0200 Subject: [PATCH 22/22] Added missing registration Signed-off-by: Bjarke Berg --- src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs | 2 ++ 1 file changed, 2 insertions(+) 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())); }