Skip to content

Commit 04d0348

Browse files
Merge branch 'v9/dev' into v9/contrib
2 parents 1c4cab5 + 16b0e85 commit 04d0348

File tree

75 files changed

+3881
-1126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3881
-1126
lines changed

build/templates/UmbracoProject/UmbracoProject.csproj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace>
66
</PropertyGroup>
77

8-
<!-- 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 -->
9-
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
10-
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.6" />
11-
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
12-
</ItemGroup>
138

149
<ItemGroup>
1510
<PackageReference Include="Umbraco.Cms" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
1611
<PackageReference Include="Umbraco.Cms.SqlCe" Version="UMBRACO_VERSION_FROM_TEMPLATE" Condition="'$(UseSqlCe)' == 'true'" />
1712
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" Condition="'$(UseSqlCe)' == 'true'" />
1813
</ItemGroup>
1914

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

2224
<ItemGroup Condition="'$(PackageTestSiteName)' != ''">
2325
<ProjectReference Include="..\PackageTestSiteName\PackageTestSiteName.csproj" />

build/templates/UmbracoProject/appsettings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"CMS": {
1818
//#if (HasNoNodesViewPath || UseHttpsRedirect)
1919
"Global": {
20+
"SanitizeTinyMce": true,
2021
//#if (!HasNoNodesViewPath && UseHttpsRedirect)
2122
"UseHttps": true
2223
//#elseif (UseHttpsRedirect)
@@ -25,10 +26,16 @@
2526
//#if (HasNoNodesViewPath)
2627
"NoNodesViewPath": "NO_NODES_VIEW_PATH_FROM_TEMPLATE"
2728
//#endif
29+
2830
},
2931
//#endif
3032
"Hosting": {
3133
"Debug": false
34+
},
35+
"Content": {
36+
"ContentVersionCleanupPolicy": {
37+
"EnableCleanup": true
38+
}
3239
}
3340
}
3441
}

src/JsonSchema/JsonSchema.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageReference Include="CommandLineParser" Version="2.8.0" />
1111
<PackageReference Include="NJsonSchema" Version="10.5.2" />
1212
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
13-
<PackageReference Include="Umbraco.Forms.Core" Version="9.0.0" />
13+
<PackageReference Include="Umbraco.Forms.Core" Version="9.0.1" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/Umbraco.Core/Configuration/Models/ContentSettings.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ @keyframes umbraco-preview-badge--effect {{
219219
[DefaultValue(StaticLoginLogoImage)]
220220
public string LoginLogoImage { get; set; } = StaticLoginLogoImage;
221221

222-
222+
/// <summary>
223+
/// Get or sets the model representing the global content version cleanup policy
224+
/// </summary>
225+
public ContentVersionCleanupPolicySettings ContentVersionCleanupPolicy { get; set; } = new ContentVersionCleanupPolicySettings();
223226
}
224227
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.ComponentModel;
2+
3+
namespace Umbraco.Cms.Core.Configuration.Models
4+
{
5+
/// <summary>
6+
/// Model representing the global content version cleanup policy
7+
/// </summary>
8+
public class ContentVersionCleanupPolicySettings
9+
{
10+
private const bool StaticEnableCleanup = false;
11+
private const int StaticKeepAllVersionsNewerThanDays = 7;
12+
private const int StaticKeepLatestVersionPerDayForDays = 90;
13+
14+
/// <summary>
15+
/// Gets or sets a value indicating whether or not the cleanup job should be executed.
16+
/// </summary>
17+
[DefaultValue(StaticEnableCleanup)]
18+
public bool EnableCleanup { get; set; } = StaticEnableCleanup;
19+
20+
/// <summary>
21+
/// Gets or sets the number of days where all historical content versions are kept.
22+
/// </summary>
23+
[DefaultValue(StaticKeepAllVersionsNewerThanDays)]
24+
public int KeepAllVersionsNewerThanDays { get; set; } = StaticKeepAllVersionsNewerThanDays;
25+
26+
/// <summary>
27+
/// Gets or sets the number of days where the latest historical content version for that day are kept.
28+
/// </summary>
29+
[DefaultValue(StaticKeepLatestVersionPerDayForDays)]
30+
public int KeepLatestVersionPerDayForDays { get; set; } = StaticKeepLatestVersionPerDayForDays;
31+
32+
}
33+
}

src/Umbraco.Core/Configuration/Models/GlobalSettings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class GlobalSettings
2828
internal const bool StaticDisableElectionForSingleServer = false;
2929
internal const string StaticNoNodesViewPath = "~/umbraco/UmbracoWebsite/NoNodes.cshtml";
3030
internal const string StaticSqlWriteLockTimeOut = "00:00:05";
31+
internal const bool StaticSanitizeTinyMce = false;
3132

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

161+
/// <summary>
162+
/// Gets a value indicating whether TinyMCE scripting sanitization should be applied
163+
/// </summary>
164+
[DefaultValue(StaticSanitizeTinyMce)]
165+
public bool SanitizeTinyMce => StaticSanitizeTinyMce;
166+
160167
/// <summary>
161168
/// An int value representing the time in milliseconds to lock the database for a write operation
162169
/// </summary>

src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ public abstract class BaseHttpHeaderCheck : HealthCheck
2626
private readonly bool _metaTagOptionAvailable;
2727
private static HttpClient s_httpClient;
2828

29+
[Obsolete("Use ctor without value.")]
30+
protected BaseHttpHeaderCheck(
31+
IHostingEnvironment hostingEnvironment,
32+
ILocalizedTextService textService,
33+
string header,
34+
string value,
35+
string localizedTextPrefix,
36+
bool metaTagOptionAvailable) :this(hostingEnvironment, textService, header, localizedTextPrefix, metaTagOptionAvailable)
37+
{
38+
39+
}
40+
41+
[Obsolete("Save ILocalizedTextService in a field on the super class instead of using this")]
42+
protected ILocalizedTextService LocalizedTextService => _textService;
2943
/// <summary>
3044
/// Initializes a new instance of the <see cref="BaseHttpHeaderCheck"/> class.
3145
/// </summary>

src/Umbraco.Core/Models/ContentEditing/ContentTypeSave.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ protected ContentTypeSave()
2929
[DataMember(Name = "allowedContentTypes")]
3030
public IEnumerable<int> AllowedContentTypes { get; set; }
3131

32+
[DataMember(Name = "historyCleanup")]
33+
public HistoryCleanupViewModel HistoryCleanup { get; set; }
34+
3235
/// <summary>
3336
/// Custom validation
3437
/// </summary>

src/Umbraco.Core/Models/ContentEditing/DocumentTypeDisplay.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Runtime.Serialization;
33

44
namespace Umbraco.Cms.Core.Models.ContentEditing
55
{
66
[DataContract(Name = "contentType", Namespace = "")]
77
public class DocumentTypeDisplay : ContentTypeCompositionDisplay<PropertyTypeDisplay>
88
{
9-
public DocumentTypeDisplay()
10-
{
9+
public DocumentTypeDisplay() =>
1110
//initialize collections so at least their never null
1211
AllowedTemplates = new List<EntityBasic>();
13-
}
1412

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

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

3028
[DataMember(Name = "apps")]
3129
public IEnumerable<ContentApp> ContentApps { get; set; }
30+
31+
[DataMember(Name = "historyCleanup")]
32+
public HistoryCleanupViewModel HistoryCleanup { get; set; }
3233
}
3334
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Runtime.Serialization;
2+
3+
namespace Umbraco.Cms.Core.Models.ContentEditing
4+
{
5+
[DataContract(Name = "historyCleanup", Namespace = "")]
6+
public class HistoryCleanup
7+
{
8+
[DataMember(Name = "preventCleanup")]
9+
public bool PreventCleanup { get; set; }
10+
11+
[DataMember(Name = "keepAllVersionsNewerThanDays")]
12+
public int? KeepAllVersionsNewerThanDays { get; set; }
13+
14+
[DataMember(Name = "keepLatestVersionPerDayForDays")]
15+
public int? KeepLatestVersionPerDayForDays { get; set; }
16+
}
17+
}

0 commit comments

Comments
 (0)