Skip to content
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

Conversation

p-m-j
Copy link
Contributor

@p-m-j p-m-j commented Nov 15, 2021

No description provided.

Copy link
Member

@bergmania bergmania left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💪

@p-m-j
Copy link
Contributor Author

p-m-j commented Nov 16, 2021

🎉☕⏫

@bergmania bergmania merged commit d89725b into v8/dev Nov 16, 2021
@bergmania bergmania deleted the v8/feature/version-history-rollback-ui-with-endpoints branch November 16, 2021 07:24
bergmania pushed a commit that referenced this pull request Nov 16, 2021
* 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 <[email protected]>
# Conflicts:
#	src/Umbraco.Core/ContentEditing/ContentVersionMetaViewModel.cs
#	src/Umbraco.Core/Models/HistoricContentVersionMeta.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.Tests/Persistence/Repositories/DocumentVersionRepository_Tests_Integration.cs
#	src/Umbraco.Tests/Services/ContentVersionCleanupService_Tests_UnitTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	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/Umbraco.Web.csproj
bergmania added a commit that referenced this pull request Nov 16, 2021
* 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 <[email protected]>
# Conflicts:
#	src/Umbraco.Core/ContentEditing/ContentVersionMetaViewModel.cs
#	src/Umbraco.Core/Models/HistoricContentVersionMeta.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.Tests/Persistence/Repositories/DocumentVersionRepository_Tests_Integration.cs
#	src/Umbraco.Tests/Services/ContentVersionCleanupService_Tests_UnitTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	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/Umbraco.Web.csproj

* Added tests

* Misc - missed translation update

* Bugfix - DocumentVersionRepository.Get should not join culture variation

* Bugfix - Missing write lock

* Removed unnecessary view model

* Misc - kill some warnings

* Misc - Kill some more warnings

* Fixed cypress rollback test

* Bugfix - Policy returns items to delete not items to keep.
Switch to inverse behavior.

# Conflicts:
#	src/Umbraco.Tests/Services/DefaultContentVersionCleanupPolicy_Tests_UnitTests.cs

Co-authored-by: Paul Johnson <[email protected]>
// TODO: If there's not a better way to write this then we need a better way to write this.
query = languageId.HasValue
? query.Where<ContentVersionCultureVariationDto>(x => x.LanguageId == languageId.Value)
: query.Where("umbracoContentVersionCultureVariation.languageId is null");
Copy link
Contributor

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");

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@p-m-j p-m-j Nov 16, 2021

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

Copy link
Contributor

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 😁

bergmania added a commit that referenced this pull request Nov 22, 2021
* Changes to GetReducedEventList (#11444)

* Instead of only using first event, we combine events of same type into a single event with multiple arguments

* Added generic method to DRY up grouping logic.

* Renamed method to better reflect new functionality.

Co-authored-by: Andy Butland <[email protected]>

* Merge pull request #11360 from umbraco/v8/bugfix/11057-mandatory-image-not-validating-after-first-time-failure

Fixes 11057: Mandatory Image not validating after first time failure

(cherry picked from commit 5cc70d2)

* Additional optional sanitization of scripting in TinyMCE (#10653)

(cherry picked from commit f68dba7)

* Bump version to 8.17.1

* Hide localization key while loading

* 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 <[email protected]>

* Bugfix - DocumentVersionRepository.Get should not join culture variation

* Bugfix - Missing write lock

* Bugfix - Policy returns items to delete not items to keep.
Switch to inverse behavior.

Co-authored-by: Andy Butland <[email protected]>
Co-authored-by: Nikolaj Geisle <[email protected]>
Co-authored-by: Niels Lyngsø <[email protected]>
Co-authored-by: Sebastiaan Janssen <[email protected]>
Co-authored-by: Ronald Barendse <[email protected]>
Co-authored-by: Paul Johnson <[email protected]>
Co-authored-by: Mads Rasmussen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants