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

Fixes CTA + lending v2 fields #6303

Merged
merged 3 commits into from
Mar 18, 2022
Merged

Fixes CTA + lending v2 fields #6303

merged 3 commits into from
Mar 18, 2022

Conversation

mekarpeles
Copy link
Member

Closes #6302

  1. Before, Preview was not showing up on mek's account (because it uses print-disabled access for testing)
  2. The update_availability_schema_to_v2 adapter had an incorrect/incomplete definition for is_lendable which did not consider the borrow_unavailable cases, which resulted in us not showing the Checked Out
  3. The changes to Bulk Availability API haven't been pi'd and so some books were returning error because Bulk Availability didn't have access to printdisabled scope and thus returned error status, causing Ground Truth API to be called. On testing, we used the deploy app from archive.org to confirm that values are now correct

Technical

Testing

Screenshot

ol-dev1 us archive org_1337_works_OL14933414W_The_Fellowship_of_the_Ring_edition=ia%3Amojiezhihuanwang0001tolk debug=true

Stakeholders

@mekarpeles
Copy link
Member Author

2nd commit fixes editions table where status is checked out, we also in this edge case now show the Preview btn. The styling needs to be fixed on this, however, it's been patch deployed and the cta issues should now be resolved.

openlibrary org_works_OL14933414W_The_Fellowship_of_the_Ring_edition=ia%3Amojiezhihuanwang0001tolk

@mekarpeles mekarpeles added Priority: 0 Fix now: Issue prevents users from using the site or active data corruption. [managed] Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle. On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing labels Mar 16, 2022
data-iframe-src="https://archive.org/details/$ocaid?view=theater&wrapper=false"
data-iframe-link="https://archive.org/details/$ocaid"
data-ol-link-track="CTAClick|Preview" href="#bookPreview">$_('Preview')</a>
<div class="cta-button-group">
Copy link
Member Author

Choose a reason for hiding this comment

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

just adds outer div to fix the width of preview btn

@@ -103,6 +115,8 @@
<a href="$work_key" class="cta-btn cta-btn--missing" title="$_('This book is currently checked out, please check back later.')"
data-ol-link-track="CTAClick|CheckedOut">$_('Checked Out')</a>
</div>
$if not secondary_action:
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 shows editions table preview button if checked out

Copy link
Collaborator

Choose a reason for hiding this comment

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

These 2 lines and the next 2 lines are now very confusing. It's meant to show one button by default. secondary_action means show a second button with a less favourable option. This is like using it to do the exact opposite :P

v1_resp['identifier'] = ocaid
v1_resp['is_restricted'] = v1_resp['status'] != 'open'
v1_resp['is_printdisabled'] = v1_resp.get('is_printdisabled', False)
v1_resp['is_lendable'] = v1_resp['status'] == 'borrow_available'
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 line is flat out wrong -- borrow_unavailable can also imply is_lendable. And besides, the value is already coming from the Bulk Availability API now (w/ latest schema) so this adapter is no longer necessary. Same for most the removed fields.

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Tested around and things look good. I think we're showing "Borrow" in some places we should be showing "Special Access", but small regression. Blocker: we're now showing two buttons in carousels when things are checked out:
image

I think we want to roll back the commented bit and only show the "checked out" button.

@@ -103,6 +115,8 @@
<a href="$work_key" class="cta-btn cta-btn--missing" title="$_('This book is currently checked out, please check back later.')"
data-ol-link-track="CTAClick|CheckedOut">$_('Checked Out')</a>
</div>
$if not secondary_action:
Copy link
Collaborator

Choose a reason for hiding this comment

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

These 2 lines and the next 2 lines are now very confusing. It's meant to show one button by default. secondary_action means show a second button with a less favourable option. This is like using it to do the exact opposite :P

@mekarpeles mekarpeles merged commit 715fb7d into master Mar 18, 2022
@mekarpeles mekarpeles deleted the hotfix/cta-lending branch March 18, 2022 00:49
@jimchamp jimchamp removed the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle. Priority: 0 Fix now: Issue prevents users from using the site or active data corruption. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing "Preview" & "Checked Out" btns
3 participants