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

Correctly set active search facet #1905

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Correctly set active search facet #1905

merged 1 commit into from
Aug 15, 2023

Conversation

keithbauer
Copy link
Contributor

Description

Correctly set the active search facet

Motivation and Context

My previous hacky attempt didn't actually set the @opds:activeFacet in the OPDS feed. I thought the URL would pick up on it and do some background magic, but it didn't look like it did.

This now builds out a facet link by using cls.facet_link to ensure the activeFacet property is correctly set. But this generates a .../feed/... URL and we want a .../search... URL, so then we replace the href with what annotator.search_url builds before adding the facet to the OPDS feed.

How Has This Been Tested?

More manual testing and verifying the search OPDS feed for the active facet is set through +@opds:activeFacet: "true"

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (5c1b5d2) 92.56% compared to head (58bb111) 92.56%.
Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1905      +/-   ##
===========================================
- Coverage    92.56%   92.56%   -0.01%     
===========================================
  Files          216      216              
  Lines        43659    43660       +1     
===========================================
  Hits         40412    40412              
- Misses        3247     3248       +1     
Files Changed Coverage Δ
core/opds.py 94.93% <100.00%> (+<0.01%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mwbenowitz mwbenowitz left a comment

Choose a reason for hiding this comment

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

This does look like a cleaner implementation. I'm not familiar enough with this code to know if this is a permanent fix, but it looks good to deploy and confirm!

@keithbauer keithbauer merged commit 662cc7e into develop Aug 15, 2023
3 of 4 checks passed
@keithbauer keithbauer deleted the OE-927 branch August 15, 2023 11:38
@keithbauer keithbauer mentioned this pull request Aug 15, 2023
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.

2 participants