forked from umbraco/Umbraco-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/v8/feature/version-history-clean…
…up-ui' into v9/dev # Conflicts: # src/Umbraco.Core/Composing/CompositionExtensions/Repositories.cs # src/Umbraco.Core/Composing/CompositionExtensions/Services.cs # src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs # src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs # src/Umbraco.Core/ContentEditing/HistoryCleanup.cs # src/Umbraco.Core/Models/ContentEditing/DocumentTypeDisplay.cs # src/Umbraco.Core/Models/ContentType.cs # src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs # src/Umbraco.Core/Persistence/Repositories/DocumentVersionRepository.cs # src/Umbraco.Core/Scheduling/ContentVersionCleanup.cs # src/Umbraco.Core/Services/DefaultContentVersionCleanupPolicy.cs # src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs # src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs # src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeCommonRepository.cs # src/Umbraco.Infrastructure/Services/Implement/ContentService.cs # src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config # src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs # src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs # src/Umbraco.Tests/Umbraco.Tests.csproj # src/Umbraco.Web.UI.Client/package-lock.json # src/Umbraco.Web.UI/config/umbracoSettings.Release.config # src/Umbraco.Web.UI/umbraco/config/lang/en.xml # src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml # src/Umbraco.Web/Scheduling/SchedulerComponent.cs # src/Umbraco.Web/Umbraco.Web.csproj # tests/Umbraco.Tests.Common/Extensions/AutoMoqDataAttribute.cs # tests/Umbraco.Tests.UnitTests/Umbraco.Core/Persistence/Repositories/DocumentVersionRepository_Tests_Integration.cs # tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scheduling/ContentVersionCleanup_Tests_UnitTests.cs # tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupService_Tests_Integration.cs # tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupService_Tests_UnitTests.cs # tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/DefaultContentVersionCleanupPolicy_Tests_UnitTests.cs
- Loading branch information
Showing
44 changed files
with
3,339 additions
and
1,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/Umbraco.Core/Configuration/Models/ContentVersionCleanupPolicySettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = 2; | ||
private const int StaticKeepLatestVersionPerDayForDays = 30; | ||
|
||
/// <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; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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; } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Umbraco.Core/Models/ContentEditing/HistoryCleanupViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 HistoryCleanupViewModel : HistoryCleanup | ||
{ | ||
[DataMember(Name = "globalKeepAllVersionsNewerThanDays")] | ||
public int? GlobalKeepAllVersionsNewerThanDays { get;set; } | ||
|
||
[DataMember(Name = "globalKeepLatestVersionPerDayForDays")] | ||
public int? GlobalKeepLatestVersionPerDayForDays { get; set;} | ||
|
||
[DataMember(Name = "globalEnableCleanup")] | ||
public bool GlobalEnableCleanup { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Umbraco.Core/Models/ContentVersionCleanupPolicySettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
|
||
namespace Umbraco.Core.Models | ||
{ | ||
public class ContentVersionCleanupPolicySettings | ||
{ | ||
public int ContentTypeId { get; set; } | ||
public int? KeepAllVersionsNewerThanDays { get; set; } | ||
public int? KeepLatestVersionPerDayForDays { get; set; } | ||
public bool PreventCleanup { get; set; } | ||
public DateTime Updated { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
|
||
namespace Umbraco.Cms.Core.Models | ||
{ | ||
public class HistoricContentVersionMeta | ||
{ | ||
public int ContentId { get; } | ||
public int ContentTypeId { get; } | ||
public int VersionId { get; } | ||
public DateTime VersionDate { get; } | ||
|
||
public HistoricContentVersionMeta() { } | ||
|
||
public HistoricContentVersionMeta(int contentId, int contentTypeId, int versionId, DateTime versionDate) | ||
{ | ||
ContentId = contentId; | ||
ContentTypeId = contentTypeId; | ||
VersionId = versionId; | ||
VersionDate = versionDate; | ||
} | ||
|
||
public override string ToString() => $"HistoricContentVersionMeta(versionId: {VersionId}, versionDate: {VersionDate:s}"; | ||
} | ||
} |
Oops, something went wrong.