Skip to content

Commit

Permalink
Remove form tag from range limit component so that it doesn't create …
Browse files Browse the repository at this point in the history
…a form in another form

Co-authored-by: Jane Sandberg <[email protected]>
  • Loading branch information
christinach and sandbergja committed Feb 5, 2025
1 parent 7215758 commit 1ecb426
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,5 @@
<div class="submit-buttons float-end mb-3">
<%= submit_tag t('blacklight.advanced_search.form.search_btn_html'), class: 'btn btn-primary advanced-search-submit', id: "advanced-search-submit" %>
</div>

</div>
<% end %>
8 changes: 3 additions & 5 deletions app/components/range_form_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<%= form_tag search_action_path, method: :get, class: [@classes[:form], "range_#{@facet_field.key} d-flex justify-content-center"].join(' ') do %>
<%= render hidden_search_state %>
<%= render hidden_search_state %>

<div class="range-limit-input-group">
<div class="range-limit-input-group">
<div class="d-flex justify-content-between align-items-end">
<div class="d-flex flex-column mr-1 me-1">
<%= label_tag(begin_input_name, t("blacklight.range_limit.range_begin_short"), class: 'text-muted small mb-1') %>
Expand All @@ -23,5 +22,4 @@
%>
</div>
</div>
</div>
<% end %>
</div>
2 changes: 1 addition & 1 deletion spec/components/numismatics_search_form_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
expected_fields = [
'Object Type', 'Denomination', 'Metal', 'City', 'State',
'Region', 'Ruler', 'Artist', 'Find Place', 'Year',
'date range (starting year)', 'date range (ending year)',
'Begin', 'End',
'Keyword'
]
expect(rendered.all('label').map(&:text)).to match_array(expected_fields)
Expand Down
5 changes: 3 additions & 2 deletions spec/features/advanced_searching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
expect(page).to have_selector('label', exact_text: 'Advanced search terms - second parameter')
expect(page).to have_selector('label', exact_text: 'Options for advanced search - third parameter')
expect(page).to have_selector('label', exact_text: 'Advanced search terms - third parameter')
expect(page).to have_selector('label', exact_text: 'Publication date range (starting year)')
expect(page).to have_selector('label', exact_text: 'Publication date range (ending year)')
expect(page).to have_selector('label', exact_text: 'Publication year')
expect(page).to have_selector('label', exact_text: 'Begin')
expect(page).to have_selector('label', exact_text: 'End')
end

it 'allows searching by format', js: true do
Expand Down

0 comments on commit 1ecb426

Please sign in to comment.