Add confirmation screen when handling reports (#22375)

* Add confirmation screen on moderation actions

* Add flash notice when a report has been processed

* Refactor tests

* Add tests
This commit is contained in:
Claire
2023-01-18 16:40:09 +01:00
committed by GitHub
parent 4b92e59f4f
commit 343e1fe8e9
9 changed files with 240 additions and 29 deletions

View File

@ -58,6 +58,8 @@ ignore_unused:
- 'errors.429'
- 'admin.accounts.roles.*'
- 'admin.action_logs.actions.*'
- 'admin.reports.summary.action_preambles.*'
- 'admin.reports.summary.actions.*'
- 'admin_mailer.new_appeal.actions.*'
- 'statuses.attached.*'
- 'move_handler.carry_{mutes,blocks}_over_text'

View File

@ -590,6 +590,7 @@ en:
comment:
none: None
comment_description_html: 'To provide more information, %{name} wrote:'
confirm_action: Confirm moderation action against @%{acct}
created_at: Reported
delete_and_resolve: Delete posts
forwarded: Forwarded
@ -606,6 +607,7 @@ en:
placeholder: Describe what actions have been taken, or any other related updates...
title: Notes
notes_description_html: View and leave notes to other moderators and your future self
processed_msg: 'Report #%{id} successfully processed'
quick_actions_description_html: 'Take a quick action or scroll down to see reported content:'
remote_user_placeholder: the remote user from %{instance}
reopen: Reopen report
@ -618,9 +620,28 @@ en:
status: Status
statuses: Reported content
statuses_description_html: Offending content will be cited in communication with the reported account
summary:
action_preambles:
delete_html: 'You are about to <strong>remove</strong> some of <strong>@%{acct}</strong>''s posts. This will:'
mark_as_sensitive_html: 'You are about to <strong>mark</strong> some of <strong>@%{acct}</strong>''s posts as <strong>sensitive</strong>. This will:'
silence_html: 'You are about to <strong>limit</strong> <strong>@%{acct}</strong>''s account. This will:'
suspend_html: 'You are about to <strong>suspend</strong> <strong>@%{acct}</strong>''s account. This will:'
actions:
delete_html: Remove the offending posts
mark_as_sensitive_html: Mark the offending posts' media as sensitive
silence_html: Severely limit <strong>@%{acct}</strong>'s reach by making their profile and contents only visible to people already following them or manually looking it profile up
suspend_html: Suspend <strong>@%{acct}</strong>, making their profile and contents inaccessible and impossible to interact with
close_report: 'Mark report #%{id} as resolved'
close_reports_html: Mark <strong>all</strong> reports against <strong>@%{acct}</strong> as resolved
delete_data_html: Delete <strong>@%{acct}</strong>'s profile and contents 30 days from now unless they get unsuspended in the meantime
preview_preamble_html: "<strong>@%{acct}</strong> will receive a warning with the following contents:"
record_strike_html: Record a strike against <strong>@%{acct}</strong> to help you escalate on future violations from this account
send_email_html: Send <strong>@%{acct}</strong> a warning e-mail
warning_placeholder: Optional additional reasoning for the moderation action.
target_origin: Origin of reported account
title: Reports
unassign: Unassign
unknown_action_msg: 'Unknown action: %{action}'
unresolved: Unresolved
updated_at: Updated
view_profile: View profile

View File

@ -310,7 +310,11 @@ Rails.application.routes.draw do
end
resources :reports, only: [:index, :show] do
resources :actions, only: [:create], controller: 'reports/actions'
resources :actions, only: [:create], controller: 'reports/actions' do
collection do
post :preview
end
end
member do
post :assign_to_self