Skip to content

Commit

Permalink
Implementing the Orangelight::DropdownHelpTextComponent to support help
Browse files Browse the repository at this point in the history
text markup within the algorithm selection dropdown UI component

Co-authored-by: Anna Headley <hackartisan@users.noreply.github.com>
Co-authored-by: Eliot Jordan <eliotjordan@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 13, 2023
1 parent 15b3858 commit 83aebef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions app/components/orangelight/dropdown_help_text_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

class Orangelight::DropdownHelpTextComponent < Blacklight::System::DropdownComponent


end
7 changes: 5 additions & 2 deletions app/views/catalog/_algorithm_select.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<% if Flipflop.multi_algorithm? %>
<%= render(Blacklight::System::DropdownComponent.new(
<%= render(Orangelight::DropdownHelpTextComponent.new(
param: :search_algorithm,
choices: ["default", "engineering"],
choices: [
"default",
"engineering"
],# Have labels displayed from the locales for each value
id: 'search-algorithm-dropdown',
search_state: search_state,
default: 'default',
Expand Down
2 changes: 2 additions & 0 deletions spec/system/search_algorithms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
expect(page).to have_text('1. Огонек : роман')

click_button('Rank by default')
# expect(page).to have_text("move documents about engineering to the top")
click_link('engineering')
expect(page).to have_button('Rank by engineering')
expect(page).to have_text('1. Reconstructing the Vitruvian Scorpio: An Engineering Analysis')
end

end

context 'with the search algorithms feature disabled' do
Expand Down

0 comments on commit 83aebef

Please sign in to comment.