-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContentVersion cleanup backoffice UI #11637
Merged
bergmania
merged 24 commits into
v8/dev
from
v8/feature/version-history-rollback-ui-with-endpoints
Nov 16, 2021
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f0e7f81
init rollback ui prototype
madsrasmussen 896dcf6
add busy state to button, deselect version, add pagination status
madsrasmussen 77185c7
add localisation
madsrasmussen a0a0ea1
style current version
madsrasmussen 1d874f3
disable rollback button when nothing is selected
madsrasmussen df27ea4
stop click event
madsrasmussen 71fcb39
Endpoints for paginated content versions.
27cf328
Endpoints to "pin" content versions
de5bfe9
camel case json output.
7c14b10
wire up paging
madsrasmussen ec3bef8
wire up pin/unpin
madsrasmussen eb62dd1
rename getPagedRollbackVersions to getPagedContentVersions
madsrasmussen 77fea29
prevent selection of current version and current draft
madsrasmussen 558d1d1
add current draft and current version to UI
madsrasmussen 1dc27fa
remove pointer if the row is not selectable
madsrasmussen e2b221a
Improve warning for globally disabled cleanup feature.
d50adf7
Fix current loses prevent cleanup state on publish.
5f44f87
Added umbracoLog audit entries for "pin" / "unpin"
5944188
Match v9 defaults for keepVersions settings
4a335f5
Fix - losing preventCleanup on save current with content changes
86b3fb6
update pin/unpin button labels
madsrasmussen 87c2e5c
fix pagination bug
madsrasmussen 6346762
add missing "
madsrasmussen 669ecbb
always send culture when a doc type can vary
madsrasmussen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,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}"; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bergmania maybe I am missing something, but shouldn't the second line use
Cms.Core.Constants.DatabaseSchema.Tables.ContentVersionCultureVariation
?https://github.com/umbraco/Umbraco-CMS/blob/v9/contrib/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs#L28
query.Where<ContentVersionCultureVariationDto>(x => x.LanguageId == null);
or
query.Where($"{Cms.Core.Constants.DatabaseSchema.Tables.ContentVersionCultureVariation}.languageId is null");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I missed the
umbraco
table prefix.https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs#L28
Anyway I think it should use either the dto class or the constant.
https://github.com/umbraco/Umbraco-CMS/blob/v9/contrib/src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs#L28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't do
query.Where<ContentVersionCultureVariationDto>(x => x.LanguageId == null);
as LanguageId is int (we are left joining)Using constants sounds smart, applies to the column selection also.
We should probably just create a sql view and create a poco to represent that -- however sql ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh okay, the constants seems a bit nicer then 😁