Skip to content

Commit

Permalink
Strip out new facet-only request keys (#3509) (#3510)
Browse files Browse the repository at this point in the history
Connected to #3507
  • Loading branch information
maxkadel authored Feb 6, 2025
1 parent b364e29 commit 03ad726
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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

0 comments on commit 03ad726

Please sign in to comment.