Merge remote-tracking branch 'origin/v8/feature/version-history-cleanup-ui' into v9/feature/merge_and_clean_history_cleanup
# Conflicts: # src/Umbraco.Core/Models/ContentType.cs # src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs # src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs # src/Umbraco.Web.UI/umbraco/config/lang/en.xml # src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml # src/Umbraco.Web/Models/ContentEditing/HistoryCleanup.cs # tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs # tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs
This commit is contained in:
@@ -32,8 +32,11 @@ namespace Umbraco.Cms.Core.Models
|
||||
/// </summary>
|
||||
/// <remarks>Only use this for creating ContentTypes at the root (with ParentId -1).</remarks>
|
||||
/// <param name="parentId"></param>
|
||||
public ContentType(IShortStringHelper shortStringHelper, int parentId) : base(shortStringHelper, parentId) =>
|
||||
public ContentType(IShortStringHelper shortStringHelper, int parentId) : base(shortStringHelper, parentId)
|
||||
{
|
||||
_allowedTemplates = new List<ITemplate>();
|
||||
HistoryCleanup = new HistoryCleanup();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -43,8 +46,11 @@ namespace Umbraco.Cms.Core.Models
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="alias"></param>
|
||||
public ContentType(IShortStringHelper shortStringHelper, IContentType parent, string alias)
|
||||
: base(shortStringHelper, parent, alias) =>
|
||||
: base(shortStringHelper, parent, alias)
|
||||
{
|
||||
_allowedTemplates = new List<ITemplate>();
|
||||
HistoryCleanup = new HistoryCleanup();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool SupportsPublishing => SupportsPublishingConst;
|
||||
|
||||
@@ -183,7 +183,8 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
KeepAllVersionsNewerThanDays = source.HistoryCleanup.KeepAllVersionsNewerThanDays,
|
||||
KeepLatestVersionPerDayForDays = source.HistoryCleanup.KeepLatestVersionPerDayForDays,
|
||||
GlobalKeepAllVersionsNewerThanDays = _contentSettings.ContentVersionCleanupPolicy.KeepAllVersionsNewerThanDays,
|
||||
GlobalKeepLatestVersionPerDayForDays = _contentSettings.ContentVersionCleanupPolicy.KeepLatestVersionPerDayForDays
|
||||
GlobalKeepLatestVersionPerDayForDays = _contentSettings.ContentVersionCleanupPolicy.KeepLatestVersionPerDayForDays,
|
||||
GlobalEnableCleanup = _contentSettings.ContentVersionCleanupPolicy.EnableCleanup
|
||||
};
|
||||
|
||||
target.AllowCultureVariant = source.VariesByCulture();
|
||||
|
||||
@@ -102,6 +102,12 @@
|
||||
|
||||
<div class="sub-view-column-right">
|
||||
<umb-box-content>
|
||||
<p ></p>
|
||||
|
||||
<div class="umb-panel-group__details-status-text" ng-if="model.historyCleanup.globalEnableCleanup">
|
||||
<p class="umb-panel-group__details-status-action"><localize key="contentTypeEditor_historyCleanupGloballyDisabled"></localize></p>
|
||||
</div>
|
||||
|
||||
<umb-control-group label="@contentTypeEditor_historyCleanupPreventCleanup">
|
||||
<umb-toggle checked="model.historyCleanup.preventCleanup" on-click="vm.toggleHistoryCleanupPreventCleanup()"></umb-toggle>
|
||||
</umb-control-group>
|
||||
|
||||
@@ -1829,6 +1829,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
|
||||
<key alias="historyCleanupKeepAllVersionsNewerThanDays">Keep all versions newer than days</key>
|
||||
<key alias="historyCleanupKeepLatestVersionPerDayForDays">Keep latest version per day for days</key>
|
||||
<key alias="historyCleanupPreventCleanup">Prevent cleanup</key>
|
||||
<key alias="historyCleanupGloballyDisabled">NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.</key>
|
||||
</area>
|
||||
<area alias="languages">
|
||||
<key alias="addLanguage">Add language</key>
|
||||
|
||||
@@ -1886,6 +1886,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
|
||||
<key alias="historyCleanupKeepAllVersionsNewerThanDays">Keep all versions newer than days</key>
|
||||
<key alias="historyCleanupKeepLatestVersionPerDayForDays">Keep latest version per day for days</key>
|
||||
<key alias="historyCleanupPreventCleanup">Prevent cleanup</key>
|
||||
<key alias="historyCleanupGloballyDisabled">NOTE! The cleanup of historically content versions are disabled globally. These settings will not take effect before it is enabled.</key>
|
||||
</area>
|
||||
<area alias="languages">
|
||||
<key alias="addLanguage">Add language</key>
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos
|
||||
Assert.AreNotEqual(propertyType.Key, Guid.Empty);
|
||||
}
|
||||
|
||||
TestHelper.AssertPropertyValuesAreEqual(fetched, contentType, ignoreProperties: new[] { "DefaultTemplate", "AllowedTemplates", "UpdateDate" });
|
||||
TestHelper.AssertPropertyValuesAreEqual(fetched, contentType, ignoreProperties: new[] { "DefaultTemplate", "AllowedTemplates", "UpdateDate", "HistoryCleanup" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,6 +378,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos
|
||||
//// Alias = display.Alias,
|
||||
Path = display.Path,
|
||||
//// AdditionalData = display.AdditionalData,
|
||||
HistoryCleanup = display.HistoryCleanup,
|
||||
|
||||
// ContentTypeBasic
|
||||
Alias = display.Alias,
|
||||
|
||||
@@ -3,27 +3,26 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using NPoco;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
using Umbraco.Cms.Core.DependencyInjection;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.Scoping;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Sync;
|
||||
using Umbraco.Cms.Infrastructure.Persistence;
|
||||
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
|
||||
using Umbraco.Cms.Infrastructure.PublishedCache;
|
||||
using Umbraco.Cms.Infrastructure.PublishedCache.DataSource;
|
||||
using Umbraco.Cms.Tests.Common.Builders;
|
||||
using Umbraco.Cms.Tests.Common.Testing;
|
||||
using Umbraco.Cms.Tests.Integration.Testing;
|
||||
using Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping;
|
||||
using Umbraco.Extensions;
|
||||
using Language = Umbraco.Cms.Core.Models.Language;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
|
||||
{
|
||||
@@ -1338,7 +1337,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
|
||||
{
|
||||
Alias = alias,
|
||||
Name = alias,
|
||||
Variations = variance
|
||||
Variations = variance,
|
||||
};
|
||||
|
||||
private PropertyTypeCollection CreatePropertyCollection(params (string alias, ContentVariation variance)[] props)
|
||||
|
||||
Reference in New Issue
Block a user