Skip to content

Commit

Permalink
Merge branch 'v9/dev' into v9/bugfix/dont-reload-page-with-edit-user-…
Browse files Browse the repository at this point in the history
…button

# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.html
  • Loading branch information
Nikolaj Geisle committed Nov 3, 2021
2 parents 4876108 + 3536863 commit a54a76e
Show file tree
Hide file tree
Showing 126 changed files with 8,116 additions and 2,775 deletions.
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
43 changes: 11 additions & 32 deletions src/Umbraco.Core/Collections/StackQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,37 @@
namespace Umbraco.Core.Collections
{
/// <summary>
/// Collection that can be both a queue and a stack.
/// Collection that can be both a queue and a stack.
/// </summary>
/// <typeparam name="T"></typeparam>
public class StackQueue<T>
{
private readonly LinkedList<T> _linkedList = new LinkedList<T>();
private readonly LinkedList<T> _linkedList = new();

public void Clear()
{
_linkedList.Clear();
}
public int Count => _linkedList.Count;

public void Push(T obj)
{
_linkedList.AddFirst(obj);
}
public void Clear() => _linkedList.Clear();

public void Enqueue(T obj)
{
_linkedList.AddFirst(obj);
}
public void Push(T obj) => _linkedList.AddFirst(obj);

public void Enqueue(T obj) => _linkedList.AddFirst(obj);

public T Pop()
{
var obj = _linkedList.First.Value;
T obj = _linkedList.First.Value;
_linkedList.RemoveFirst();
return obj;
}

public T Dequeue()
{
var obj = _linkedList.Last.Value;
T obj = _linkedList.Last.Value;
_linkedList.RemoveLast();
return obj;
}

public T PeekStack()
{
return _linkedList.First.Value;
}
public T PeekStack() => _linkedList.First.Value;

public T PeekQueue()
{
return _linkedList.Last.Value;
}

public int Count
{
get
{
return _linkedList.Count;
}
}
public T PeekQueue() => _linkedList.Last.Value;
}
}
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
18 changes: 18 additions & 0 deletions src/Umbraco.Core/Constants-Sql.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Umbraco.Cms.Core
{
public static partial class Constants
{
public static class Sql
{
/// <summary>
/// The maximum amount of parameters that can be used in a query.
/// </summary>
/// <remarks>
/// The actual limit is 2100
/// (https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server),
/// but we want to ensure there's room for additional parameters if this value is used to create groups/batches.
/// </remarks>
public const int MaxParameterCount = 2000;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected async Task<HealthCheckStatus> CheckForHeader()
var success = false;

// Access the site home page and check for the click-jack protection header or meta tag
Uri url = _hostingEnvironment.ApplicationMainUrl;
var url = _hostingEnvironment.ApplicationMainUrl.GetLeftPart(UriPartial.Authority);

try
{
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 a54a76e

Please sign in to comment.