Add reported user diaspora ID in /report view

closes #8464
This commit is contained in:
flaburgan
2025-04-13 14:09:56 +02:00
committed by Dennis Schubert
parent c24ca7d56c
commit 452f46a548
5 changed files with 20 additions and 10 deletions

View File

@@ -7,6 +7,7 @@
* Fix a bug with parsing certain OpenGraph metadata structures [#8463](https://github.com/diaspora/diaspora/pull/8463)
## Features
* For admins, the offending content's author is now visible in the reports overview [#8464](https://github.com/diaspora/diaspora/pull/8464)
# 0.9.0.0

View File

@@ -21,6 +21,10 @@
= report.text
.panel-body
.content
%strong
= t("report.author_label")
%p
= report.reported_author.diaspora_handle
= report_content(report)
.segment-selection
= button_to t("report.reported_user_details"),

View File

@@ -1049,8 +1049,9 @@ en:
placeholder: "This content violates the terms because..."
submit: "Report this content"
title: "Reports overview"
post_label: "<strong>Post</strong>: %{content}"
comment_label: "<strong>Comment</strong>: %{data}"
author_label: "Author:"
post_label: "<strong>Post</strong>:<br />%{content}"
comment_label: "<strong>Comment</strong>:<br />%{data}"
reported_label: "<strong>Reported by</strong> %{person}"
reason_label: "Reason:"
review_link: "Mark as reviewed"

View File

@@ -23,7 +23,7 @@ Feature: reporting of posts and comments
And I submit the form
Then I should see an error flash message containing "The report already exists"
When I go to the report page
Then I should see a report by "alice@alice.alice" with reason "That's my reason" on post "I'm a post by Bob"
Then I should see a report by "alice@alice.alice" with reason "That's my reason" on post "I'm a post by Bob" by "bob@localhost"
And "alice@alice.alice" should have received an email with subject "A new post was marked as offensive"
Scenario: User can report a comment, but cannot report it twice
@@ -42,7 +42,7 @@ Feature: reporting of posts and comments
And I submit the form
Then I should see an error flash message containing "The report already exists"
When I go to the report page
Then I should see a report by "alice@alice.alice" with reason "That's my reason" on comment "Bob comment"
Then I should see a report by "alice@alice.alice" with reason "That's my reason" on comment "Bob comment" by "bob@localhost"
And "alice@alice.alice" should have received an email with subject "A new comment was marked as offensive"
Scenario: The correct post is reported

View File

@@ -8,16 +8,20 @@ And /^I should see the report modal/ do
step %(I should see "Reporting content" within "#reportModal")
end
And /^I should see a report by "([^"]*)" with reason "([^"]*)" on post "([^"]*)"$/ do |reporter, reason, content|
test_report("Post", User.find_by(email: reporter), reason, content)
And /^I should see a report by "([^"]*)" with reason "([^"]*)" on post "([^"]*)" by "([^"]*)"$/ do
|reporter, reason, content, author|
test_report("Post", User.find_by(email: reporter), reason, content, author)
end
And /^I should see a report by "([^"]*)" with reason "([^"]*)" on comment "([^"]*)"$/ do |reporter, reason, content|
test_report("Comment", User.find_by(email: reporter), reason, content)
And /^I should see a report by "([^"]*)" with reason "([^"]*)" on comment "([^"]*)" by "([^"]*)"$/ do
|reporter, reason, content, author|
test_report("Comment", User.find_by(email: reporter), reason, content, author)
end
def test_report(type, reporter, reason, content)
def test_report(type, reporter, reason, content, author)
step %(I should see "#{reporter.username}" within ".reporter")
step %(I should see "#{reason}" within ".reason")
step %(I should see "#{type}: #{content}" within ".content")
step %(I should see "#{author}:" within ".content")
step %(I should see "#{type}:" within ".content")
step %(I should see "#{content}" within ".content")
end