Use order links in print proposals management

A `<select>` tag here might make more sense than in other similar places
since there are 5 options to choose among, and using links might take
too much screen space.

However, as mentioned in the previous commits, `<select>` tags which
automatically submit a form have many accessibility and usability
issues.

An alternative would be to create a dropdown menu with a button and a
list of links (similar to what Foundation does). I'm keeping the links
for simplicity and because the interface looks a bit more consistent
with the rest of the sections. Before these changes, we had a heading,
then a `<select>` field to choose the filter, and then a button to print
the page. We never use a similar interface, and some people might think
the "Print" button is related to the same form as the `<select>` field.

Now that we don't use the `order_selector` partial anywhere anymore, we
can remove it.
This commit is contained in:
Javi Martín
2021-06-27 20:28:07 +02:00
parent 227a5868b8
commit 14d8bef0d8
6 changed files with 6 additions and 23 deletions

View File

@@ -214,16 +214,16 @@ describe "Proposals" do
login_as_manager
click_link "Print proposals"
expect(page).to have_selector(".js-order-selector[data-order='confidence_score']")
expect(page).to have_link "highest rated", class: "is-active"
within(".proposals-list") do
expect(best_proposal.title).to appear_before(medium_proposal.title)
expect(medium_proposal.title).to appear_before(worst_proposal.title)
end
select "newest", from: "order-selector"
click_link "newest"
expect(page).to have_selector(".js-order-selector[data-order='created_at']")
expect(page).to have_link "newest", class: "is-active"
expect(page).to have_current_path(/order=created_at/)
expect(page).to have_current_path(/page=1/)