Skip to content

Commit

Permalink
Merge branch 'v9/dev' into v9/contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
nul800sebastiaan committed Nov 3, 2021
2 parents 1c4cab5 + 16b0e85 commit 04d0348
Show file tree
Hide file tree
Showing 75 changed files with 3,881 additions and 1,126 deletions.
14 changes: 8 additions & 6 deletions build/templates/UmbracoProject/UmbracoProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace>
</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 -->
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.6" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
<PackageReference Include="Umbraco.Cms.SqlCe" Version="UMBRACO_VERSION_FROM_TEMPLATE" Condition="'$(UseSqlCe)' == 'true'" />
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" Condition="'$(UseSqlCe)' == 'true'" />
</ItemGroup>

<Import Project="..\PackageTestSiteName\build\PackageTestSiteName.targets" Condition="'$(PackageTestSiteName)' != ''" />
<!-- 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 -->
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
</ItemGroup>


<Import Project="..\PackageTestSiteName\build\PackageTestSiteName.targets" Condition="'$(PackageTestSiteName)' != ''" />

<ItemGroup Condition="'$(PackageTestSiteName)' != ''">
<ProjectReference Include="..\PackageTestSiteName\PackageTestSiteName.csproj" />
Expand Down
7 changes: 7 additions & 0 deletions build/templates/UmbracoProject/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"CMS": {
//#if (HasNoNodesViewPath || UseHttpsRedirect)
"Global": {
"SanitizeTinyMce": true,
//#if (!HasNoNodesViewPath && UseHttpsRedirect)
"UseHttps": true
//#elseif (UseHttpsRedirect)
Expand All @@ -25,10 +26,16 @@
//#if (HasNoNodesViewPath)
"NoNodesViewPath": "NO_NODES_VIEW_PATH_FROM_TEMPLATE"
//#endif

},
//#endif
"Hosting": {
"Debug": false
},
"Content": {
"ContentVersionCleanupPolicy": {
"EnableCleanup": true
}
}
}
}
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" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/Umbraco.Core/Configuration/Models/ContentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ @keyframes umbraco-preview-badge--effect {{
[DefaultValue(StaticLoginLogoImage)]
public string LoginLogoImage { get; set; } = StaticLoginLogoImage;


/// <summary>
/// Get or sets the model representing the global content version cleanup policy
/// </summary>
public ContentVersionCleanupPolicySettings ContentVersionCleanupPolicy { get; set; } = new ContentVersionCleanupPolicySettings();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.ComponentModel;

namespace Umbraco.Cms.Core.Configuration.Models
{
/// <summary>
/// Model representing the global content version cleanup policy
/// </summary>
public class ContentVersionCleanupPolicySettings
{
private const bool StaticEnableCleanup = false;
private const int StaticKeepAllVersionsNewerThanDays = 7;
private const int StaticKeepLatestVersionPerDayForDays = 90;

/// <summary>
/// Gets or sets a value indicating whether or not the cleanup job should be executed.
/// </summary>
[DefaultValue(StaticEnableCleanup)]
public bool EnableCleanup { get; set; } = StaticEnableCleanup;

/// <summary>
/// Gets or sets the number of days where all historical content versions are kept.
/// </summary>
[DefaultValue(StaticKeepAllVersionsNewerThanDays)]
public int KeepAllVersionsNewerThanDays { get; set; } = StaticKeepAllVersionsNewerThanDays;

/// <summary>
/// Gets or sets the number of days where the latest historical content version for that day are kept.
/// </summary>
[DefaultValue(StaticKeepLatestVersionPerDayForDays)]
public int KeepLatestVersionPerDayForDays { get; set; } = StaticKeepLatestVersionPerDayForDays;

}
}
7 changes: 7 additions & 0 deletions src/Umbraco.Core/Configuration/Models/GlobalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class GlobalSettings
internal const bool StaticDisableElectionForSingleServer = false;
internal const string StaticNoNodesViewPath = "~/umbraco/UmbracoWebsite/NoNodes.cshtml";
internal const string StaticSqlWriteLockTimeOut = "00:00:05";
internal const bool StaticSanitizeTinyMce = false;

/// <summary>
/// Gets or sets a value for the reserved URLs.
Expand Down Expand Up @@ -157,6 +158,12 @@ public class GlobalSettings
/// </summary>
public bool IsSmtpServerConfigured => !string.IsNullOrWhiteSpace(Smtp?.Host);

/// <summary>
/// Gets a value indicating whether TinyMCE scripting sanitization should be applied
/// </summary>
[DefaultValue(StaticSanitizeTinyMce)]
public bool SanitizeTinyMce => StaticSanitizeTinyMce;

/// <summary>
/// An int value representing the time in milliseconds to lock the database for a write operation
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ public abstract class BaseHttpHeaderCheck : HealthCheck
private readonly bool _metaTagOptionAvailable;
private static HttpClient s_httpClient;

[Obsolete("Use ctor without value.")]
protected BaseHttpHeaderCheck(
IHostingEnvironment hostingEnvironment,
ILocalizedTextService textService,
string header,
string value,
string localizedTextPrefix,
bool metaTagOptionAvailable) :this(hostingEnvironment, textService, header, localizedTextPrefix, metaTagOptionAvailable)
{

}

[Obsolete("Save ILocalizedTextService in a field on the super class instead of using this")]
protected ILocalizedTextService LocalizedTextService => _textService;
/// <summary>
/// Initializes a new instance of the <see cref="BaseHttpHeaderCheck"/> class.
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions src/Umbraco.Core/Models/ContentEditing/ContentTypeSave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ protected ContentTypeSave()
[DataMember(Name = "allowedContentTypes")]
public IEnumerable<int> AllowedContentTypes { get; set; }

[DataMember(Name = "historyCleanup")]
public HistoryCleanupViewModel HistoryCleanup { get; set; }

/// <summary>
/// Custom validation
/// </summary>
Expand Down
9 changes: 5 additions & 4 deletions src/Umbraco.Core/Models/ContentEditing/DocumentTypeDisplay.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Umbraco.Cms.Core.Models.ContentEditing
{
[DataContract(Name = "contentType", Namespace = "")]
public class DocumentTypeDisplay : ContentTypeCompositionDisplay<PropertyTypeDisplay>
{
public DocumentTypeDisplay()
{
public DocumentTypeDisplay() =>
//initialize collections so at least their never null
AllowedTemplates = new List<EntityBasic>();
}

//name, alias, icon, thumb, desc, inherited from the content type

Expand All @@ -29,5 +27,8 @@ public DocumentTypeDisplay()

[DataMember(Name = "apps")]
public IEnumerable<ContentApp> ContentApps { get; set; }

[DataMember(Name = "historyCleanup")]
public HistoryCleanupViewModel HistoryCleanup { get; set; }
}
}
17 changes: 17 additions & 0 deletions src/Umbraco.Core/Models/ContentEditing/HistoryCleanup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Runtime.Serialization;

namespace Umbraco.Cms.Core.Models.ContentEditing
{
[DataContract(Name = "historyCleanup", Namespace = "")]
public class HistoryCleanup
{
[DataMember(Name = "preventCleanup")]
public bool PreventCleanup { get; set; }

[DataMember(Name = "keepAllVersionsNewerThanDays")]
public int? KeepAllVersionsNewerThanDays { get; set; }

[DataMember(Name = "keepLatestVersionPerDayForDays")]
public int? KeepLatestVersionPerDayForDays { get; set; }
}
}
18 changes: 18 additions & 0 deletions src/Umbraco.Core/Models/ContentEditing/HistoryCleanupViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Runtime.Serialization;

namespace Umbraco.Cms.Core.Models.ContentEditing
{
[DataContract(Name = "historyCleanup", Namespace = "")]
public class HistoryCleanupViewModel : HistoryCleanup
{

[DataMember(Name = "globalEnableCleanup")]
public bool GlobalEnableCleanup { get; set; }

[DataMember(Name = "globalKeepAllVersionsNewerThanDays")]
public int? GlobalKeepAllVersionsNewerThanDays { get; set; }

[DataMember(Name = "globalKeepLatestVersionPerDayForDays")]
public int? GlobalKeepLatestVersionPerDayForDays { get; set; }
}
}
Loading

0 comments on commit 04d0348

Please sign in to comment.