ContentVersion cleanup backoffice UI (#11637)

* init rollback ui prototype

* add busy state to button, deselect version, add pagination status

* add localisation

* style current version

* disable rollback button when nothing is selected

* stop click event

* Endpoints for paginated content versions.
Light on tests, tight on time.

* Endpoints to "pin" content versions

* camel case json output.
Not sure why json formatter not set for controller, bit risky to add it now

* wire up paging

* wire up pin/unpin

* rename getPagedRollbackVersions to getPagedContentVersions

* prevent selection of current version and current draft

* add current draft and current version to UI

* remove pointer if the row is not selectable

* Improve warning for globally disabled cleanup feature.

* Fix current loses prevent cleanup state on publish.

* Added umbracoLog audit entries for "pin" / "unpin"

* Match v9 defaults for keepVersions settings

* Fix - losing preventCleanup on save current with content changes

* update pin/unpin button labels

* fix pagination bug

* add missing "

* always send culture when a doc type can vary

Co-authored-by: Mads Rasmussen <madsr@hey.com>
This commit is contained in:
Paul Johnson
2021-11-16 07:24:12 +00:00
committed by GitHub
parent 1fbf02d61e
commit d89725bd48
28 changed files with 801 additions and 171 deletions

View File

@@ -113,6 +113,16 @@
/// <summary>
/// Custom audit message.
/// </summary>
Custom
Custom,
/// <summary>
/// Content version preventCleanup set to true
/// </summary>
ContentVersionPreventCleanup,
/// <summary>
/// Content version preventCleanup set to false
/// </summary>
ContentVersionEnableCleanup
}
}

View File

@@ -0,0 +1,45 @@
using System;
namespace Umbraco.Core.Models
{
public class ContentVersionMeta
{
public int ContentId { get; }
public int ContentTypeId { get; }
public int VersionId { get; }
public int UserId { get; }
public DateTime VersionDate { get; }
public bool CurrentPublishedVersion { get; }
public bool CurrentDraftVersion { get; }
public bool PreventCleanup { get; }
public string Username { get; }
public ContentVersionMeta() { }
public ContentVersionMeta(
int versionId,
int contentId,
int contentTypeId,
int userId,
DateTime versionDate,
bool currentPublishedVersion,
bool currentDraftVersion,
bool preventCleanup,
string username)
{
VersionId = versionId;
ContentId = contentId;
ContentTypeId = contentTypeId;
UserId = userId;
VersionDate = versionDate;
CurrentPublishedVersion = currentPublishedVersion;
CurrentDraftVersion = currentDraftVersion;
PreventCleanup = preventCleanup;
Username = username;
}
public override string ToString() => $"ContentVersionMeta(versionId: {VersionId}, versionDate: {VersionDate:s}";
}
}

View File

@@ -1,24 +0,0 @@
using System;
namespace Umbraco.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}";
}
}