Story #13494

Updated by Lucas Di Pentima over 1 year ago

See [[Collection version history]]

When viewing a collection in Workbench, a tab/button should show the history of prior changes. For each prior update, it should be possible to
* view/star/bookmark the selected version of the collection (name, description, files, etc. as they appeared after the update)
* preview/download the files as they appeared in the selected version (if the data blocks still exist)
* copy the selected version into a new collection (if the data blocks still exist)
* release the storage consumed by the data blocks (if the site is configured to allow this)

When searching collections, the user should have an option to include non-current versions in the results.

The site admin should be able to control
* whether collection version history is retained at all
* if so, whether the data blocks for the old version are retained
* if so, whether users are allowed to drop the retained data blocks for old versions of a collection

h3. Implementation

* Backend
** Configurable feature: Past version’s blocks should be retained. This cluster setting should set the default value of the next bullet point on collection snapshot creation.
** Configurable feature: Users should be able to release a collection past version’s blocks. (if block retainability is active)
*** For this feature, a per-collection boolean field may be needed.
*** Once blocks are released, the boolean field cannot be set back to its previous state.
** Keep-balance should be updated to ignore blocks references from collection’s past versions that have their blocks expunged, so that they’re really deleted.
* UI / Workbench2
The version selector is built on the collapsable ‘details’ pane to the right (see attached mockup) instead of the currently unused "Activity" tab. This would allow us to minimize the quantity of UI changes when displaying past versions.
** The versions listing should be ordered by date with the current version at the top.
A version number indicator (with a hint if it’s the current) should appear by the collection’s name. This could be a clickable button/link that would expand the right pane to allow the user to select another version.
* ** Maybe the entire collection pane background color should be changed slightly to indicate that the view is read-only, to avoid the user to think some past version is the current one.
* ** The collection panel would be almost the same for every version being displayed, with the following differences when showing a past version:
** *** The “three dotted” menu should only allow the following options:
*** **** Copy to project
*** **** Add to favorites: As past versions cannot have links, the proposed way to do favorites (check how this is to make a copy of the version should be made, as a new collection, and favorite it. This could be done by showing a dialog explaining no links are permitted on past versions)
**** Release storage (disabled if blocks already were expunged or if
the user what will happen, and ask for confirmation. cluster config doesn’t allow it)
*** **** Advanced (the raw API response dialog)
** *** The tag editor should be in “display only mode"
** *** The files listings should be in “display only mode”:
*** **** File selections should be possible, but no “delete selected” option should be listed/be clickable on the pop-up three-dashes menu
*** **** Single file pop-up three-dots menu should only list options to download and open in new tab. tab (disabled if collection version has been set to expunge its blocks).
** *** The “Upload data” button should be disabled or not displayed
* ** Advanced search dialog should allow searching on past versions using a new keyword like "@includeVersions:true@" on the search bar.