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

"Previews available in:" sometimes displayed without any preview languages #6408

Closed
jimchamp opened this issue Apr 11, 2022 · 0 comments · Fixed by #6410
Closed

"Previews available in:" sometimes displayed without any preview languages #6408

jimchamp opened this issue Apr 11, 2022 · 0 comments · Fixed by #6410
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Module: Books Page Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]

Comments

@jimchamp
Copy link
Collaborator

Sometimes the "Previews available in:" copy is rendered without any preview languages.

Evidence / Screenshot (if possible)

no_previews

Relevant url?

https://openlibrary.org/works/OL4472450W/Shad?edition=ia%3Ashad0000corr

Steps to Reproduce

  1. Go to the page listed above.
  2. Observe the "Previews available in:" section in the overview.
  • Actual: No languages are listed.
  • Expected: Links to previews in specific languages should be displayed.

Details

  • Logged in (Y/N)? N
  • Browser type/version? N/A
  • Operating system? N/A
  • Environment (prod/dev/local)? prod

Proposal & Constraints

Do not display "Previews available in:" if there are no previews.

Related files

Code related to this is found here:

$ seen = set()
$if previews:
<p class="preview-languages">
Previews available in:
$for e in previews:
$if e.languages[0].name not in seen:
$ seen.add(e.languages[0].name)
<a href="$work.key?edition=$(e.ocaid)">$e.languages[0].name</a>
</p>

Stakeholders

@jimchamp jimchamp added Type: Bug Something isn't working. [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Needs: Lead Priority: 3 Issues that we can consider at our leisure. [managed] Module: Books Page Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] and removed Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Needs: Lead labels Apr 11, 2022
jimchamp added a commit that referenced this issue Apr 14, 2022
Fix "Previews available in:" sometimes displayed without any preview languages #6408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Module: Books Page Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]
Projects
None yet
1 participant