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

Hide versioning UI when unsupported by adapter #6257

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

marrus-sh
Copy link
Collaborator

  • Modify Hyrax::VersionListPresenter to wrap a Hyrax::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:

  • In an application with versioning enabled (e·g dassie), no change in behaviour is observable
  • In an application with versioning disabled (e·g koppie), the versioning tab is empty and users cannot upload new versions

@marrus-sh marrus-sh added notes-valkyrie Release Notes: Valkyrie specific notes-bugfix Release Notes: Fixed a bug labels Aug 30, 2023
- Modify `Hyrax::VersionListPresenter` to wrap a
  `Hyrax::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.
@marrus-sh marrus-sh force-pushed the hide-unsupported-versioning-ui branch from 396c4f7 to b3e05ae Compare August 30, 2023 17:53
@no-reply no-reply added the notes-major Release Notes: Potentially breaking changes label Aug 31, 2023
@no-reply
Copy link
Contributor

added notes-major since this changes the public API for initializer on the VersionPresenter

@no-reply no-reply merged commit c640b82 into main Aug 31, 2023
@no-reply no-reply deleted the hide-unsupported-versioning-ui branch August 31, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-bugfix Release Notes: Fixed a bug notes-major Release Notes: Potentially breaking changes notes-valkyrie Release Notes: Valkyrie specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants