-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add "Preview" link beneath bookcover on Search Result Cards #10366
base: master
Are you sure you want to change the base?
Conversation
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.
only show preview if ocaid
@mekarpeles As I mentioned above, I have not added that condition yet because the ocaid data isn't available in the dev environment. To work with it and verify whether the button appears, I have kept it without any conditions for now. Once I address the styling concerns, I will add the condition. |
@ananyakaligal see if the additions I pushed help -- previously, the availability check was being performed before we had the selected edition. Now, I believe the ocaid block should work, even on localhost |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10366 +/- ##
==========================================
+ Coverage 17.44% 17.57% +0.12%
==========================================
Files 89 87 -2
Lines 4792 4775 -17
Branches 848 847 -1
==========================================
+ Hits 836 839 +3
+ Misses 3436 3417 -19
+ Partials 520 519 -1 ☔ View full report in Codecov by Sentry. |
<div class="sri__main"> | ||
<span class="bookcover $blur_cover"> | ||
<div class="sri__main "> | ||
<div class="btn-notice read-options Tools read panel"> |
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.
if possible, I think we want to avoid this line as its bringing a lot of other styles with it. I think a better solution may be to factor out the preview link logic into its own class and use that class both here and on the books page.
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, @mekarpeles. I planned to do the same! I was looking into which classes are affecting the standard preview button styles to understand how to write a new class for it.
bb8f7d5
to
5664b11
Compare
87f98d4
to
c5e9c8f
Compare
b1c3812
to
be8be4f
Compare
for more information, see https://pre-commit.ci
Hello @mekarpeles, I’ve been trying to figure out why the styles for the cta-btn--preview-link class aren’t being applied after setting vanilla=False, and I’ve been working on it for the past two days without success. I’m still unable to figure out what’s going wrong, so I’m reaching out to ask for your help. I’ve attached a screenshot of the inspected button for reference. |
which means, Then here https://github.com/internetarchive/openlibrary/pull/10366/files#diff-1c0a702d7b1bad810adce7c001416b5996968d117077f629ff52ddff4668f56fR64 the code suggests we're sending in
Therefore I'd expect Did I miss something? |
@mekarpeles I can see the |
The styles you're working on should go in a file that are accessible to all buttons, such as this file: |
@mekarpeles so the |
What issue does this PR address?
Addresses #10199
What does this PR achieve?
Feature: Added a preview button on the search result cards.
The button is visible on all the books because it hasn't been fully integrated with the ocaid availability condition yet. This will be added once the rest of the work is completed.
Next Steps:
Note:
This is a Draft pull request to discuss further steps.
Stakeholders:
@mekarpeles
Let me know if this works, so I can go ahead and implement the next steps.