From 48db31cd6b5d8461751173a084e51edc6daa5f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 6 Jul 2020 20:45:48 +0200 Subject: [PATCH] Remove redundant links in admin tables There were places where we had two links pointing to the same place; one link would be the name/title of a record, and one link would be under the "actions" column. This is confusing, since users would probably expect these links to point to different places (which is what happens in other tables in the admin section) and might try to click one of them and then the other one and be surprised when they found out both of them go to the same page. --- app/views/admin/budget_groups/index.html.erb | 2 +- app/views/admin/budget_headings/index.html.erb | 2 +- app/views/admin/officials/index.html.erb | 4 +--- app/views/admin/poll/polls/_poll.html.erb | 4 +--- app/views/admin/poll/polls/_questions.html.erb | 4 +--- app/views/admin/poll/polls/booth_assignments.html.erb | 4 +--- spec/system/admin/budget_groups_spec.rb | 2 +- spec/system/admin/budget_headings_spec.rb | 2 +- spec/system/admin/officials_spec.rb | 2 +- spec/system/admin/poll/booth_assigments_spec.rb | 2 +- spec/system/admin/poll/polls_spec.rb | 2 +- spec/system/admin/poll/questions_spec.rb | 2 +- 12 files changed, 12 insertions(+), 20 deletions(-) diff --git a/app/views/admin/budget_groups/index.html.erb b/app/views/admin/budget_groups/index.html.erb index 023cdae4a..293078dd3 100644 --- a/app/views/admin/budget_groups/index.html.erb +++ b/app/views/admin/budget_groups/index.html.erb @@ -22,7 +22,7 @@ <% @groups.each do |group| %> - <%= link_to group.name, edit_admin_budget_group_path(@budget, group) %> + <%= group.name %> <%= group.max_votable_headings %> <%= group.headings.count %> diff --git a/app/views/admin/budget_headings/index.html.erb b/app/views/admin/budget_headings/index.html.erb index bfb878ec9..7ffd37ff7 100644 --- a/app/views/admin/budget_headings/index.html.erb +++ b/app/views/admin/budget_headings/index.html.erb @@ -24,7 +24,7 @@ <% @headings.each do |heading| %> - <%= link_to heading.name, edit_admin_budget_group_heading_path(@budget, @group, heading) %> + <%= heading.name %> <%= @budget.formatted_heading_price(heading) %> <% if @budget.approval_voting? %> <%= heading.max_ballot_lines %> diff --git a/app/views/admin/officials/index.html.erb b/app/views/admin/officials/index.html.erb index a9b76dcc1..b62a450b6 100644 --- a/app/views/admin/officials/index.html.erb +++ b/app/views/admin/officials/index.html.erb @@ -16,9 +16,7 @@ <% @officials.each do |official| %> - - <%= link_to official.name, edit_admin_official_path(official) %> - + <%= official.name %> <%= official.official_position %> diff --git a/app/views/admin/poll/polls/_poll.html.erb b/app/views/admin/poll/polls/_poll.html.erb index 33189750b..2cad1f6cd 100644 --- a/app/views/admin/poll/polls/_poll.html.erb +++ b/app/views/admin/poll/polls/_poll.html.erb @@ -1,8 +1,6 @@ - - <%= link_to poll.name, admin_poll_path(poll) %> - + <%= poll.name %> <%= l poll.starts_at.to_date %> diff --git a/app/views/admin/poll/polls/_questions.html.erb b/app/views/admin/poll/polls/_questions.html.erb index 79e57748a..130f899c6 100644 --- a/app/views/admin/poll/polls/_questions.html.erb +++ b/app/views/admin/poll/polls/_questions.html.erb @@ -18,9 +18,7 @@ <% @poll.questions.each do |question| %> - - <%= link_to question.title, admin_question_path(question) %> - + <%= question.title %> <% if question.proposal.present? %> <%= link_to t("admin.polls.show.see_proposal"), diff --git a/app/views/admin/poll/polls/booth_assignments.html.erb b/app/views/admin/poll/polls/booth_assignments.html.erb index 0816de134..7fa9b2e01 100644 --- a/app/views/admin/poll/polls/booth_assignments.html.erb +++ b/app/views/admin/poll/polls/booth_assignments.html.erb @@ -10,9 +10,7 @@ <% @polls.each do |poll| %> - - <%= link_to poll.name, manage_admin_poll_booth_assignments_path(poll) %> - + <%= poll.name %> <%= l poll.starts_at.to_date %> - <%= l poll.ends_at.to_date %> diff --git a/spec/system/admin/budget_groups_spec.rb b/spec/system/admin/budget_groups_spec.rb index 6026ea187..75c05e1b9 100644 --- a/spec/system/admin/budget_groups_spec.rb +++ b/spec/system/admin/budget_groups_spec.rb @@ -128,7 +128,7 @@ describe "Admin budget groups" do click_button "Create new group" expect(page).to have_content "Group created successfully!" - expect(page).to have_link "All City" + expect(page).to have_content "All City" end scenario "Maximum number of headings in which a user can vote is set to 1 by default" do diff --git a/spec/system/admin/budget_headings_spec.rb b/spec/system/admin/budget_headings_spec.rb index b92d4ce6e..397b39968 100644 --- a/spec/system/admin/budget_headings_spec.rb +++ b/spec/system/admin/budget_headings_spec.rb @@ -148,7 +148,7 @@ describe "Admin budget headings" do click_button "Create new heading" expect(page).to have_content "Heading created successfully!" - expect(page).to have_link "All City" + expect(page).to have_content "All City" expect(page).to have_content "€1,000" expect(page).to have_content "10000" expect(page).to have_content "Yes" diff --git a/spec/system/admin/officials_spec.rb b/spec/system/admin/officials_spec.rb index 3c5abd448..a9eaab1f5 100644 --- a/spec/system/admin/officials_spec.rb +++ b/spec/system/admin/officials_spec.rb @@ -19,7 +19,7 @@ describe "Admin officials" do scenario "Edit an official" do visit admin_officials_path - click_link official.name + click_link "Edit official" expect(page).to have_current_path(edit_admin_official_path(official)) diff --git a/spec/system/admin/poll/booth_assigments_spec.rb b/spec/system/admin/poll/booth_assigments_spec.rb index 7ee942b05..ebfb38695 100644 --- a/spec/system/admin/poll/booth_assigments_spec.rb +++ b/spec/system/admin/poll/booth_assigments_spec.rb @@ -16,7 +16,7 @@ describe "Admin booths assignments" do visit booth_assignments_admin_polls_path - expect(page).to have_link(poll.name, href: manage_admin_poll_booth_assignments_path(poll)) + expect(page).to have_link("Manage assignments", href: manage_admin_poll_booth_assignments_path(poll)) expect(page).to have_content(second_poll.name) within("#poll_#{second_poll.id}") do diff --git a/spec/system/admin/poll/polls_spec.rb b/spec/system/admin/poll/polls_spec.rb index 8703dd4e2..d7a2fbc21 100644 --- a/spec/system/admin/poll/polls_spec.rb +++ b/spec/system/admin/poll/polls_spec.rb @@ -58,7 +58,7 @@ describe "Admin polls" do poll = create(:poll) visit admin_polls_path - click_link poll.name + click_link "Configure" expect(page).to have_content poll.name end diff --git a/spec/system/admin/poll/questions_spec.rb b/spec/system/admin/poll/questions_spec.rb index dde70b676..3863cf676 100644 --- a/spec/system/admin/poll/questions_spec.rb +++ b/spec/system/admin/poll/questions_spec.rb @@ -52,7 +52,7 @@ describe "Admin poll questions" do question = create(:poll_question, poll: poll) visit admin_poll_path(poll) - click_link question.title + click_link "Edit answers" expect(page).to have_content(question.title) expect(page).to have_content(question.author.name)