From: Anton Khorev Date: Fri, 7 Mar 2025 10:03:42 +0000 (+0300) Subject: Create last managing user column in issues table X-Git-Tag: live~32^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/52bfc5708939125fff6309aaeb8f884f4315e276?ds=inline;hp=--cc Create last managing user column in issues table --- 52bfc5708939125fff6309aaeb8f884f4315e276 diff --git a/app/views/issues/_page.html.erb b/app/views/issues/_page.html.erb index 9681704a1..a1279cb97 100644 --- a/app/views/issues/_page.html.erb +++ b/app/views/issues/_page.html.erb @@ -15,6 +15,7 @@ <%= t ".reported_user" %> <%= t ".reporting_users" %> <%= t ".last_updated" %> + <%= t ".last_managed" %> @@ -33,12 +34,10 @@ <% end %> - <% 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) %> + + + <%= link_to(issue.user_updated.display_name, issue.user_updated) if issue.user_updated %> <% end %> diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 3f79190fa..94c74c377 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -29,8 +29,8 @@
<%= 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" %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 093827ebd..064020397 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb index ae5e114c3..3cf7d22d5 100644 --- a/test/system/issues_test.rb +++ b/test/system/issues_test.rb @@ -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