-
Notifications
You must be signed in to change notification settings - Fork 7
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
IIIF viewer for related records #2776
Conversation
… we only have a manifestd for the related MMS_ID and not the current MMS_ID
|
||
<!-- Viewer for related MMS_IDs --> | ||
<% @document.related_bibs_iiif_manifest.each_with_index do |related_bib, ix| %> | ||
<div id="view_<%= ix+1 %>" class="document-viewers" data-bib-id="<%= related_bib %>"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new viewer will be picked up by Javascript in https://github.com/pulibrary/orangelight/blob/main/app/javascript/orangelight/orangelight_ui_loader.es6#L37-L43 because it has the document-viewers
CSS class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that these additional viewers reference the related bibs via the data-bib-id
property
…his fill will work even before we reindex our records to update to the new Alma IDs
3bdad1b
to
34ecec6
Compare
app/models/solr_document.rb
Outdated
def ensure_alma_id(id) | ||
return id if id.length > 7 && id.start_with?("99") | ||
"99#{id}3506421" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you checking id to be > 7 ? Do you consider a potential id of 99106421?
I don't think we need this method since we have in the controller
alma_id = "99#{params[:id]}3506421" |
Also if we keep it can you rename it to: ensure_voyager_to_alma_id . per @mzelesky An alma id can also end to 06421 if it was created in Alma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we do need this method. The IDs processed in this code will not go through the code in the controller that you pointed. The IDs processed here need to be transformed because we want to make sure that we pass new Alma IDs in the GraphQL query to Figgy to retrieve the manifest.
I am hard-coding "3506421" because I can confidently assume that these IDs were created in Voyager, not in Alma.
As far as the length > 7
condition, I just took a guess. This is not a perfect logic but it should catch most legacy Voyager IDs. And we should be able to remove this logic once we take care of pulibrary/bibdata#1720
I'll rename the method as you suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method has been renamed.
Adds a separate viewer for a related MMS_ID to handle instances where we only have a manifest in Figgy for a related MMS_ID but not for the current MMS_ID
In the case of the original issue reported the current MMS_ID is
9956597633506421
but in Figgy we only have a manifest for the related MMS_ID9956630863506421
The code in this PR will detect the presence of the related MMS_ID in the
electronic_access_1display
field and use that to add an extra viewer for this related MMS_ID.The attached screenshot show how the problematic record now renders the viewer as soon as the record is loaded.
This PR fixes pulibrary/bibdata#1659 for records with the correct Alma ID in the related records URL, but not for records with Voyager IDs in the URL. For records with Voyager IDs we need to take care of pulibrary/bibdata#1720.Code has been updated to handle new Alma IDs and legacy Voyager IDs so that this PR fixes the issue even without reindexing our records.