Learn how versioning works for AllinsonFlex. We will need to port this over into Hyrax.
Acceptance Criteria
[ ] We need to study the current implementation of Allinson Flex to understand how we can extract its versioning functionality. The plan is to contribute this back to Hyrax.
[ ] Create spin off tickets, detailing the work that needs to be done. Add it to the TASKS section below.
TASKS
There is no real work needed specifically for versioning. The basic work is part of implementing AllinsonFlex as a whole.
Bring in required tables: AllinsonFlex::Profile includes the version number. (DynamicSchema, ProfileProperty, and Context also appear to be used in AllinsonFlex methods)
This version number can be auto-generated by incrementing the most recent version.
Current logic is a bit wonky as it tries to use the entered version number and then ensure it is incremented adequately.
There is no need for the version number to be modifiable or enterable.
define method current_version as in app/models/allinson_flex/profile.rb:32: AllinsonFlex::Profile.order("created_at asc").last
use method current_version to get the profile_id for finding the DynamicSchema to use
Be sure to incorporate all views showing the version number
This is roughly a sequential number (most recent version number plus 1), but can be affected by modifying it in the uploaded yml file (and possibly in the UI?).
There appears to be NO reason that version number should ever need to be anything other than an auto-assigned, sequential number.
There appears to be no reason that this needs to have one decimal position.
Method "current_version" returns the most recent profile based on "created_at" date.
Usage on a work
The schema id and profile ids are saved and indexed on each work.
When a work is viewed in edit mode, both the current and newest profile version number is shown.
Saving the work applies the new schema to the work.
Note: Removing a term that is used will result in errors on the affected work. It probably should handle this situation.
Finding the schema to use
requires profile_id of the current_version, the work class name, and the context_id
By default, context id of "default" is used
Views:
Dashboard works and my works show version number
Edit works shows current and upcoming version number that the work will save to.
SOW
Summary
Learn how versioning works for AllinsonFlex. We will need to port this over into Hyrax.
Acceptance Criteria
TASKS
There is no real work needed specifically for versioning. The basic work is part of implementing AllinsonFlex as a whole.
current_version
as inapp/models/allinson_flex/profile.rb:32
:AllinsonFlex::Profile.order("created_at asc").last
current_version
to get theprofile_id
for finding the DynamicSchema to useScreenshots or Video
Testing Instructions
Notes