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

[Backport 8.x] Backport #3507 - Strip out new facet-only request keys #3510

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/blacklight/facet_paginator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FacetPaginator
# and need to make them accessible in a list so we can easily
# strip em out before redirecting to catalog/index.
mattr_accessor :request_keys do
{ sort: :'facet.sort', page: :'facet.page', prefix: :'facet.prefix' }
{ sort: :'facet.sort', page: :'facet.page', prefix: :'facet.prefix', fragment: :query_fragment, only: :only_values }
end

attr_reader :offset, :limit, :sort, :prefix
Expand Down
11 changes: 11 additions & 0 deletions spec/features/facets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@
expect(page).to have_link 'Tibetan language'
expect(page).to have_css 'a.facet-select', count: 1
end

it 'allows the user to filter more than once', :js do
visit '/catalog/facet/subject_ssim'
expect(page).to have_no_link 'Old age' # This is on the second page of facet values
expect(page).to have_css 'a.facet-select', count: 20

fill_in 'facet_suggest_subject_ssim', with: "ag"

expect(page).to have_link 'Old age'
expect(page).to have_link('Old age', href: '/?f%5Bsubject_ssim%5D%5B%5D=Old+age')
end
end
end
end