Merge remote-tracking branch 'upstream/pull/5763'

This commit is contained in:
Tom Hughes 2025-03-08 11:00:15 +00:00
commit 09d31dc6be
4 changed files with 39 additions and 11 deletions

View file

@ -15,6 +15,7 @@
<th><%= t ".reported_user" %></th>
<th class="reporting_users"><%= t ".reporting_users" %></th>
<th><%= t ".last_updated" %></th>
<th><%= t ".last_managed" %></th>
</tr>
</thead>
<tbody>
@ -28,12 +29,10 @@
<%= render :partial => "issues/reporters/reporters", :locals => { :issue => issue } %>
</td>
<td>
<% if issue.user_updated %>
<%= t ".last_updated_time_ago_user_html", :user => link_to(issue.user_updated.display_name, issue.user_updated),
:time_ago => friendly_date_ago(issue.updated_at) %>
<% else %>
<%= friendly_date_ago(issue.updated_at) %>
<% end %>
<%= friendly_date_ago(issue.updated_at) %>
</td>
<td>
<%= link_to(issue.user_updated.display_name, issue.user_updated) if issue.user_updated %>
</td>
</tr>
<% end %>

View file

@ -29,8 +29,8 @@
</div>
<div class="mb-3 col-md-auto">
<%= select_tag :last_updated_by,
options_for_select(@users.all.collect { |f| [f.display_name, f.id] } << [t(".not_updated"), "nil"], params[:last_updated_by]),
:include_blank => t(".select_last_updated_by"),
options_for_select(@users.all.collect { |f| [f.display_name, f.id] } << [t(".not_managed"), "nil"], params[:last_updated_by]),
:include_blank => t(".select_last_managed_by"),
:data => { :behavior => "category_dropdown" },
:class => "form-select" %>
</div>

View file

@ -1517,9 +1517,9 @@ en:
title: Issues
select_status: Select Status
select_type: Select Type
select_last_updated_by: Select Last Updated By
select_last_managed_by: Select Last Managed By
reported_user: Reported User
not_updated: Not Updated
not_managed: Not Managed
search: Search
search_guidance: "Search Issues:"
states:
@ -1533,7 +1533,7 @@ en:
status: Status
reports: Reports
last_updated: Last Updated
last_updated_time_ago_user_html: "%{time_ago} by %{user}"
last_managed: Last Managed
reporting_users: Reporting Users
reports_count:
one: "%{count} Report"

View file

@ -269,4 +269,33 @@ class IssuesTest < ApplicationSystemTestCase
assert_no_content issue.reports[n].user.display_name
end
end
def test_view_managed_issue
issue = create(:issue, :assigned_role => "moderator")
issue.reports << create(:report)
moderator_user = create(:moderator_user)
sign_in_as(moderator_user)
visit issues_path
within_content_body do
assert_no_link moderator_user.display_name
click_on "1 Report"
end
within_content_heading do
assert_content "Open Issue ##{issue.id}"
click_on "Resolve"
assert_content "Resolved Issue ##{issue.id}"
end
visit issues_path
within_content_body do
assert_link moderator_user.display_name
end
end
end