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

IIIF viewer for related records #2776

Merged
merged 4 commits into from
Oct 21, 2021
Merged

IIIF viewer for related records #2776

merged 4 commits into from
Oct 21, 2021

Conversation

hectorcorrea
Copy link
Member

@hectorcorrea hectorcorrea commented Oct 20, 2021

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_ID 9956630863506421

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.

Screen Shot 2021-10-20 at 5 37 15 PM

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.

… 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>
Copy link
Member Author

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.

Copy link
Member Author

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

@hectorcorrea hectorcorrea marked this pull request as draft October 21, 2021 13:36
@hectorcorrea hectorcorrea marked this pull request as ready for review October 21, 2021 14:38
@coveralls
Copy link

coveralls commented Oct 21, 2021

Coverage Status

Coverage decreased (-0.03%) to 96.785% when pulling 174b2f7 on issue_1659 into f387756 on main.

@christinach christinach self-requested a review October 21, 2021 14:52
…his fill will work even before we reindex our records to update to the new Alma IDs
Comment on lines 126 to 128
def ensure_alma_id(id)
return id if id.length > 7 && id.start_with?("99")
"99#{id}3506421"
Copy link
Member

@christinach christinach Oct 21, 2021

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method has been renamed.

@christinach christinach merged commit a2a0d04 into main Oct 21, 2021
@christinach christinach deleted the issue_1659 branch October 21, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figgy ARKs are not converting to manifest URLs during indexing.
3 participants