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:
@@ -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/)
|
||||
|
||||
Reference in New Issue
Block a user