Hide versioning UI when unsupported by adapter #6257
Merged
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.
Modify
Hyrax::VersionListPresenter
to wrap aHyrax::VersioningService
, instead directly wrapping an array of version presenters. This enables querying whether multiple versions are supported directly on the version list presenter by delegating it to the wrapped service. I also think this is a bit simpler from a code perspective.Suppress the UI for manually creating a new version of a file when the storage adapter does not support multiple versions. Note: Currently dassie supports multiple versions, but koppie does not.
Suppress the UI for restoring a previous versions when the version list is empty. The fallback behaviour for the version list (i·e when versioning is unsupported) is an empty list, so this is effectively the same as the previous check, but the semantics are slightly different.
The end result of these changes is that the “Versions” tab is entirely empty in koppie (currently, with no versioning supported). We may want to either hide the tab in its entirety or else put a message there stating that versioning is not supported.
Related to #6211 in the sense that it prevents the confusing behaviour of users appearing able to upload new versions when versions are not actually supported. Probably we also want some work to prevent logging of new versions that aren’t actually being created (step №8 in that issue), but this PR handles the user‐facing side of things.
Guidance for testing, such as acceptance criteria or new user interface behaviors: