Revert "Merge IContentTypeWithHistoryCleanup with IContentType.cs"
This reverts commit 94eb49cdb6.
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class ContentType : ContentTypeCompositionBase, IContentType
|
||||
public class ContentType : ContentTypeCompositionBase, IContentTypeWithHistoryCleanup
|
||||
{
|
||||
public const bool SupportsPublishingConst = true;
|
||||
|
||||
|
||||
@@ -4,6 +4,19 @@ using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a content type that contains a history cleanup policy.
|
||||
/// </summary>
|
||||
[Obsolete("This will be merged into IContentType in Umbraco 10.")]
|
||||
public interface IContentTypeWithHistoryCleanup : IContentType
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the history cleanup configuration.
|
||||
/// </summary>
|
||||
/// <value>The history cleanup configuration.</value>
|
||||
HistoryCleanup? HistoryCleanup { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a ContentType, which Content is based on
|
||||
/// </summary>
|
||||
@@ -57,11 +70,5 @@ namespace Umbraco.Cms.Core.Models
|
||||
/// <param name="newAlias"></param>
|
||||
/// <returns></returns>
|
||||
IContentType DeepCloneWithResetIdentities(string newAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the history cleanup configuration.
|
||||
/// </summary>
|
||||
/// <value>The history cleanup configuration.</value>
|
||||
HistoryCleanup? HistoryCleanup { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
MapSaveToTypeBase<DocumentTypeSave, PropertyTypeBasic>(source, target, context);
|
||||
MapComposition(source, target, alias => _contentTypeService.Get(alias));
|
||||
|
||||
if (target is IContentType targetWithHistoryCleanup)
|
||||
if (target is IContentTypeWithHistoryCleanup targetWithHistoryCleanup)
|
||||
{
|
||||
MapHistoryCleanup(source, targetWithHistoryCleanup);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
: _fileService.GetTemplate(source.DefaultTemplate));
|
||||
}
|
||||
|
||||
private static void MapHistoryCleanup(DocumentTypeSave source, IContentType target)
|
||||
private static void MapHistoryCleanup(DocumentTypeSave source, IContentTypeWithHistoryCleanup target)
|
||||
{
|
||||
// If source history cleanup is null we don't have to map all properties
|
||||
if (source.HistoryCleanup is null)
|
||||
@@ -209,7 +209,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
{
|
||||
MapTypeToDisplayBase<DocumentTypeDisplay, PropertyTypeDisplay>(source, target);
|
||||
|
||||
if (source is IContentType sourceWithHistoryCleanup)
|
||||
if (source is IContentTypeWithHistoryCleanup sourceWithHistoryCleanup)
|
||||
{
|
||||
target.HistoryCleanup = new HistoryCleanupViewModel
|
||||
{
|
||||
|
||||
@@ -511,7 +511,7 @@ namespace Umbraco.Cms.Core.Services
|
||||
genericProperties,
|
||||
tabs);
|
||||
|
||||
if (contentType is IContentType withCleanup && withCleanup.HistoryCleanup is not null)
|
||||
if (contentType is IContentTypeWithHistoryCleanup withCleanup && withCleanup.HistoryCleanup is not null)
|
||||
{
|
||||
xml.Add(SerializeCleanupPolicy(withCleanup.HistoryCleanup));
|
||||
}
|
||||
|
||||
@@ -890,7 +890,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging
|
||||
UpdateContentTypesPropertyGroups(contentType, documentType.Element("Tabs"));
|
||||
UpdateContentTypesProperties(contentType, documentType.Element("GenericProperties"));
|
||||
|
||||
if (contentType is IContentType withCleanup)
|
||||
if (contentType is IContentTypeWithHistoryCleanup withCleanup)
|
||||
{
|
||||
UpdateHistoryCleanupPolicy(withCleanup, documentType.Element("HistoryCleanupPolicy"));
|
||||
}
|
||||
@@ -898,7 +898,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging
|
||||
return contentType;
|
||||
}
|
||||
|
||||
private void UpdateHistoryCleanupPolicy(IContentType withCleanup, XElement? element)
|
||||
private void UpdateHistoryCleanupPolicy(IContentTypeWithHistoryCleanup withCleanup, XElement? element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
|
||||
{
|
||||
// historyCleanup property is not mandatory for api endpoint, handle the case where it's not present.
|
||||
// DocumentTypeSave doesn't handle this for us like ContentType constructors do.
|
||||
if (entity is IContentType entityWithHistoryCleanup)
|
||||
if (entity is IContentTypeWithHistoryCleanup entityWithHistoryCleanup)
|
||||
{
|
||||
ContentVersionCleanupPolicyDto dto = new ContentVersionCleanupPolicyDto()
|
||||
{
|
||||
|
||||
@@ -169,6 +169,9 @@ namespace Umbraco.Cms.Infrastructure.Runtime
|
||||
// Acquire the main domain - if this fails then anything that should be registered with MainDom will not operate
|
||||
AcquireMainDom();
|
||||
|
||||
// TODO (V10): Remove this obsoleted notification publish.
|
||||
await _eventAggregator.PublishAsync(new UmbracoApplicationMainDomAcquiredNotification(), cancellationToken);
|
||||
|
||||
// Notify for unattended install
|
||||
await _eventAggregator.PublishAsync(new RuntimeUnattendedInstallNotification(), cancellationToken);
|
||||
DetermineRuntimeLevel();
|
||||
@@ -207,6 +210,9 @@ namespace Umbraco.Cms.Infrastructure.Runtime
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO (V10): Remove this obsoleted notification publish
|
||||
await _eventAggregator.PublishAsync(new UmbracoApplicationComponentsInstallingNotification(State.Level), cancellationToken);
|
||||
|
||||
// Initialize the components
|
||||
_components.Initialize();
|
||||
|
||||
|
||||
@@ -776,7 +776,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging
|
||||
// Act
|
||||
var contentTypes = PackageDataInstallation
|
||||
.ImportDocumentType(withoutCleanupPolicy, 0)
|
||||
.OfType<IContentType>();
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
@@ -795,7 +795,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging
|
||||
// Act
|
||||
var contentTypes = PackageDataInstallation
|
||||
.ImportDocumentType(docTypeElement, 0)
|
||||
.OfType<IContentType>();
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
@@ -817,11 +817,11 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging
|
||||
// Act
|
||||
var contentTypes = PackageDataInstallation
|
||||
.ImportDocumentType(withCleanupPolicy, 0)
|
||||
.OfType<IContentType>();
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
var contentTypesUpdated = PackageDataInstallation
|
||||
.ImportDocumentType(withoutCleanupPolicy, 0)
|
||||
.OfType<IContentType>();
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
|
||||
Reference in New Issue
Block a user