Skip to content

Commit

Permalink
Merge v9/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nul800sebastiaan committed Oct 29, 2021
2 parents f5fa1ee + e9ae567 commit 687670c
Show file tree
Hide file tree
Showing 289 changed files with 13,195 additions and 44,920 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
with:
config-file: ./.github/workflows/codeql-config.yml
config-file: ./.github/config/codeql-config.yml

# This job is to prevent the workflow status from showing as failed when all other jobs are skipped - See https://github.community/t/workflow-is-failing-if-no-job-can-be-ran-due-to-condition/16873
always_job:
Expand Down
45 changes: 45 additions & 0 deletions build/NuSpecs/buildTransitive/Umbraco.Cms.StaticAssets.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
<UmbracoWwwrootName Condition="'$(UmbracoWwwrootName)' == ''">umbraco</UmbracoWwwrootName>
</PropertyGroup>

<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins\**;</DefaultItemExcludes>

<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Data\**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Logs\**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\mediacache\**;</DefaultItemExcludes>

<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\media\**;</DefaultItemExcludes>
</PropertyGroup>

<Target Name="CopyUmbracoAssets" BeforeTargets="BeforeBuild">
<ItemGroup>
<ContentFiles Include="$(ContentFilesPath)" />
Expand All @@ -21,7 +31,42 @@
SourceFiles="@(ContentWwwrootFiles)"
DestinationFiles="@(ContentWwwrootFiles->'$(MSBuildProjectDirectory)\wwwroot\$(UmbracoWwwrootName)\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true" />
</Target>

<Target Name="IncludeAppPluginsContent" BeforeTargets="GetCopyToOutputDirectoryItems">
<ItemGroup>
<_AppPluginsFiles Include="App_Plugins\**" />

<ContentWithTargetPath
Include="@(_AppPluginsFiles)"
TargetPath="%(Identity)"
CopyToOutputDirectory="Always" />
</ItemGroup>
</Target>

<!--
The set of files to publish is generated really early and doesn't currently account for files added by targets e.g. BeforeBuild.
A fix was put in place in Web SDK to update for wwwwroot in case someone runs npm build etc in a target, we're borrowing their trick.
https://github.com/dotnet/sdk/blob/e2b2b1a4ac56c955b84d62fe71cda3b6f258b42b/src/WebSdk/Publish/Targets/ComputeTargets/Microsoft.NET.Sdk.Publish.ComputeFiles.targets
-->
<Target Name="IncludeUmbracoFolderContent" BeforeTargets="GetCopyToOutputDirectoryItems">
<ItemGroup>
<_UmbracoFolderFiles Include="umbraco\config\**" />
<_UmbracoFolderFiles Include="umbraco\PartialViewMacros\**" />
<_UmbracoFolderFiles Include="umbraco\UmbracoBackOffice\**" />
<_UmbracoFolderFiles Include="umbraco\UmbracoInstall\**" />
<_UmbracoFolderFiles Include="umbraco\UmbracoWebsite\**" />
<_UmbracoFolderFiles Include="umbraco\UmbracoWebsite\**" />
<_UmbracoFolderFiles Include="umbraco\Licenses\**" />

<!-- This could be handled in deploy if it's not already -->
<_UmbracoFolderFiles Include="umbraco\Deploy\**" />

<ContentWithTargetPath
Include="@(_UmbracoFolderFiles)"
TargetPath="%(Identity)"
CopyToOutputDirectory="Always" />
</ItemGroup>
</Target>

<Target Name="ClearUmbracoAssets" BeforeTargets="Clean">
Expand Down
16 changes: 8 additions & 8 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ stages:
inputs:
command: ci
workingDir: 'tests\Umbraco.Tests.AcceptanceTest'
- task: Npm@1
- task: PowerShell@2
displayName: Run Cypress (Desktop)
condition: always()
continueOnError: true
inputs:
workingDir: tests\Umbraco.Tests.AcceptanceTest
command: 'custom'
customCommand: 'run test -- --reporter junit --reporter-options "mochaFile=results/test-output-D-[hash].xml,toConsole=true" --config="viewportHeight=1600,viewportWidth=2560,screenshotsFolder=cypress/artifacts/desktop/screenshots,videosFolder=cypress/artifacts/desktop/videos,videoUploadOnPasses=false"'
targetType: inline
workingDirectory: tests\Umbraco.Tests.AcceptanceTest
script: 'npm run test -- --reporter junit --reporter-options "mochaFile=results/test-output-D-[hash].xml,toConsole=true" --config="viewportHeight=1600,viewportWidth=2560,screenshotsFolder=cypress/artifacts/desktop/screenshots,videosFolder=cypress/artifacts/desktop/videos,videoUploadOnPasses=false"'

- task: PublishTestResults@2
condition: always()
Expand Down Expand Up @@ -329,14 +329,14 @@ stages:
inputs:
command: ci
workingDir: 'tests/Umbraco.Tests.AcceptanceTest'
- task: Npm@1
- task: Bash@3
displayName: Run Cypress (Desktop)
condition: always()
continueOnError: true
inputs:
workingDir: tests/Umbraco.Tests.AcceptanceTest
command: 'custom'
customCommand: 'run test -- --reporter junit --reporter-options "mochaFile=results/test-output-D-[hash].xml,toConsole=true" --config="viewportHeight=1600,viewportWidth=2560,screenshotsFolder=cypress/artifacts/desktop/screenshots,videosFolder=cypress/artifacts/desktop/videos,videoUploadOnPasses=false"'
targetType: inline
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
script: 'npm run test -- --reporter junit --reporter-options "mochaFile=results/test-output-D-[hash].xml,toConsole=true" --config="viewportHeight=1600,viewportWidth=2560,screenshotsFolder=cypress/artifacts/desktop/screenshots,videosFolder=cypress/artifacts/desktop/videos,videoUploadOnPasses=false"'
- task: PublishTestResults@2
condition: always()
inputs:
Expand Down
13 changes: 0 additions & 13 deletions build/templates/UmbracoProject/UmbracoProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace>
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins/**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot/media/**;</DefaultItemExcludes>
</PropertyGroup>

<!-- Force windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older windows 10 and most if not all winodws servers will run NLS -->
Expand All @@ -26,16 +23,6 @@
<ProjectReference Include="..\PackageTestSiteName\PackageTestSiteName.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="App_Plugins/**" CopyToOutputDirectory="Always" />
<Content Include="umbraco/**" CopyToOutputDirectory="Always" />
<Content Remove="umbraco/Data/**" />
<Content Remove="umbraco/Logs/**" />
<Content Remove="umbraco/mediacache/**" />
<Content Remove="umbraco/models/**" />
<Compile Include="umbraco/models/**" Exclude="**/*.flag" />
</ItemGroup>

<PropertyGroup>
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
</PropertyGroup>
Expand Down
56 changes: 47 additions & 9 deletions src/JsonSchema/AppSettings.cs
Original file line number Diff line number Diff line change
@@ -1,82 +1,120 @@
using Umbraco.Cms.Core.Configuration.Models;
// Copyright (c) Umbraco.
// See LICENSE for more details.

using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Forms.Core.Configuration;
using SecuritySettings = Umbraco.Cms.Core.Configuration.Models.SecuritySettings;

namespace JsonSchema
{
public class AppSettings
internal class AppSettings
{
/// <summary>
/// Gets or sets the Umbraco
/// </summary>
public UmbracoDefinition Umbraco { get; set; }

/// <summary>
/// Configuration of Umbraco CMS and packages
/// Configuration of Umbraco CMS and packages
/// </summary>
public class UmbracoDefinition
internal class UmbracoDefinition
{
// ReSharper disable once InconsistentNaming
public CmsDefinition CMS { get; set; }

public FormsDefinition Forms { get; set; }

public DeployDefinition Deploy { get; set; }

/// <summary>
/// Configurations for the Umbraco CMS
/// Configurations for the Umbraco CMS
/// </summary>
public class CmsDefinition
{
public ActiveDirectorySettings ActiveDirectory { get; set; }

public ContentSettings Content { get; set; }

public ExceptionFilterSettings ExceptionFilter { get; set; }

public ModelsBuilderSettings ModelsBuilder { get; set; }

public GlobalSettings Global { get; set; }

public HealthChecksSettings HealthChecks { get; set; }

public HostingSettings Hosting { get; set; }

public ImagingSettings Imaging { get; set; }

public IndexCreatorSettings Examine { get; set; }

public KeepAliveSettings KeepAlive { get; set; }

public LoggingSettings Logging { get; set; }

public MemberPasswordConfigurationSettings MemberPassword { get; set; }

public NuCacheSettings NuCache { get; set; }

public RequestHandlerSettings RequestHandler { get; set; }

public RuntimeSettings Runtime { get; set; }

public SecuritySettings Security { get; set; }

public TourSettings Tours { get; set; }

public TypeFinderSettings TypeFinder { get; set; }

public UserPasswordConfigurationSettings UserPassword { get; set; }

public WebRoutingSettings WebRouting { get; set; }

public UmbracoPluginSettings Plugins { get; set; }

public UnattendedSettings Unattended { get; set; }

public RichTextEditorSettings RichTextEditor { get; set; }

public RuntimeMinificationSettings RuntimeMinification { get; set; }

public BasicAuthSettings BasicAuth { get; set; }

public PackageMigrationSettings PackageMigration { get; set; }
}

/// <summary>
/// Configurations for the Umbraco Forms package to Umbraco CMS
/// Configurations for the Umbraco Forms package to Umbraco CMS
/// </summary>
public class FormsDefinition
{
public FormDesignSettings FormDesign { get; set; }

public PackageOptionSettings Options { get; set; }

public Umbraco.Forms.Core.Configuration.SecuritySettings Security { get; set; }

public FieldTypesDefinition FieldTypes { get; set; }

/// <summary>
/// Configurations for the Umbraco Forms Field Types
/// Configurations for the Umbraco Forms Field Types
/// </summary>
public class FieldTypesDefinition
{
public DatePickerSettings DatePicker { get; set; }

public Recaptcha2Settings Recaptcha2 { get; set; }

public Recaptcha3Settings Recaptcha3 { get; set; }
}
}

/// <summary>
/// Configurations for the Umbraco Deploy package to Umbraco CMS
/// Configurations for the Umbraco Deploy package to Umbraco CMS
/// </summary>
public class DeployDefinition
{

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/JsonSchema/JsonSchema.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="NJsonSchema" Version="10.5.2" />
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.0.0-preview20210624.66481" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions src/JsonSchema/NamespacePrefixedSchemaNameGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System;
using NJsonSchema.Generation;

namespace JsonSchema
{
public class NamespacePrefixedSchemaNameGenerator : DefaultSchemaNameGenerator
internal class NamespacePrefixedSchemaNameGenerator : DefaultSchemaNameGenerator
{
public override string Generate(Type type)
{
return type.Namespace.Replace(".", String.Empty) + base.Generate(type);
}
public override string Generate(Type type) => type.Namespace.Replace(".", string.Empty) + base.Generate(type);
}
}
13 changes: 13 additions & 0 deletions src/JsonSchema/Options.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using CommandLine;

namespace JsonSchema
{
internal class Options
{
[Option('o', "outputFile", Required = false, HelpText = "Set path of the output file.", Default = "../../../../Umbraco.Web.UI/umbraco/config/appsettings-schema.json")]
public string OutputFile { get; set; }
}
}
14 changes: 5 additions & 9 deletions src/JsonSchema/Program.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

using System;
using System.IO;
using System.Threading.Tasks;
using CommandLine;

namespace JsonSchema
{
class Program
internal class Program
{
private class Options
{
[Option('o', "outputFile", Required = false, HelpText = "Set path of the output file.", Default = "../../../../Umbraco.Web.UI/umbraco/config/appsettings-schema.json")]
public string OutputFile { get; set; }
}

public static async Task Main(string[] args)
{
try
Expand All @@ -25,7 +22,6 @@ await Parser.Default.ParseArguments<Options>(args)
Console.WriteLine(e);
throw;
}

}

private static async Task Execute(Options options)
Expand All @@ -34,7 +30,7 @@ private static async Task Execute(Options options)
var schema = await generator.Generate();

var path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, options.OutputFile));
Console.WriteLine("Path to use {0}",path);
Console.WriteLine("Path to use {0}", path);
Directory.CreateDirectory(Path.GetDirectoryName(path));
Console.WriteLine("Ensured directory exists");
await File.WriteAllTextAsync(path, schema);
Expand Down
Loading

0 comments on commit 687670c

Please sign in to comment.