* 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> # 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 <pmj@umbraco.com>
Umbraco Acceptance Tests
Prerequisites
- NodeJS 12+
- A running installed Umbraco on url: https://localhost:44331 (Default development port)
- Install using a
SqlServer/LocalDbas the tests execute too fast forSqlCEto handle.
- Install using a
Getting started
The tests are located in the project/folder as Umbraco.Tests.AcceptanceTests. Make sure you run npm install in that folder, or let your IDE do that.
The script will ask you to enter the username and password for a superadmin user of your Umbraco CMS.
Executing tests
There are two npm scripts that can be used to execute the test:
npm run test- Executes the tests headless.
npm run ui- Executes the tests in a browser handled by a cypress application.
In case of errors it is recommended to use the UI to debug.
Enviroment Configuration
The enviroment configuration is begin setup by the npm installation script.
This results in the creation of this file: cypress.env.json.
This file is already added to .gitignore and can contain values that are different for each developer machine.
The file has the following content:
{
"username": "<email for superadmin>",
"password": "<password for superadmin>"
}
You can change this if you like or run the config script to reset the values, type "npm run config" in your terminal.