Use a button instead of a link to block users
We're continuing to replace links with buttons, for the reasons
explained in commit 5311daadf.
We're also adding an ARIA label since on the same page there might be
several links to block different users.
This commit is contained in:
@@ -17,8 +17,14 @@
|
||||
<% if user.hidden? %>
|
||||
<%= t("moderation.users.index.hidden") %>
|
||||
<% else %>
|
||||
<%= link_to t("moderation.users.index.hide"), hide_in_moderation_screen_moderation_user_path(user, request.query_parameters),
|
||||
method: :put, class: "button hollow alert" %>
|
||||
<%= render Admin::ActionComponent.new(
|
||||
:hide_in_moderation_screen,
|
||||
user,
|
||||
text: t("moderation.users.index.hide"),
|
||||
method: :put,
|
||||
"aria-label": true,
|
||||
class: "button hollow alert"
|
||||
) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -239,7 +239,7 @@ describe "Admin activity" do
|
||||
visit moderation_users_path(search: user.username)
|
||||
|
||||
within("#moderation_users") do
|
||||
click_link "Block"
|
||||
click_button "Block"
|
||||
end
|
||||
|
||||
visit admin_activity_path
|
||||
|
||||
@@ -75,7 +75,7 @@ describe "Moderate budget investments" do
|
||||
click_button "Search"
|
||||
|
||||
within "tr", text: investment.author.name do
|
||||
expect(page).to have_link "Block"
|
||||
expect(page).to have_button "Block"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ describe "Moderate comments" do
|
||||
click_button "Search"
|
||||
|
||||
within "tr", text: comment.user.name do
|
||||
expect(page).to have_link "Block"
|
||||
expect(page).to have_button "Block"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ describe "Moderate debates" do
|
||||
click_button "Search"
|
||||
|
||||
within "tr", text: debate.author.name do
|
||||
expect(page).to have_link "Block"
|
||||
expect(page).to have_button "Block"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ describe "Moderate proposal notifications" do
|
||||
click_button "Search"
|
||||
|
||||
within "tr", text: proposal_notification.author.name do
|
||||
expect(page).to have_link "Block"
|
||||
expect(page).to have_button "Block"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ describe "Moderate proposals" do
|
||||
click_button "Search"
|
||||
|
||||
within "tr", text: proposal.author.name do
|
||||
expect(page).to have_link "Block"
|
||||
expect(page).to have_button "Block"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ describe "Moderate users" do
|
||||
within("#moderation_users") do
|
||||
expect(page).to have_content citizen.name
|
||||
expect(page).not_to have_content "Blocked"
|
||||
click_link "Block"
|
||||
click_button "Block"
|
||||
end
|
||||
|
||||
within("#moderation_users") do
|
||||
|
||||
Reference in New Issue
Block a user