]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5763'
authorTom Hughes <tom@compton.nu>
Sat, 8 Mar 2025 11:00:15 +0000 (11:00 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 8 Mar 2025 11:00:15 +0000 (11:00 +0000)
app/views/issues/_page.html.erb
app/views/issues/index.html.erb
config/locales/en.yml
test/system/issues_test.rb

index 225517c9dadd0a2e14d9f7dc478728320f08fa85..d42d6238dd16f5dbea28858735f897b44fed2f8b 100644 (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>
               <%= 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 %>
index 3f79190fae1ae09f6392934741e604d76c73f9e0..94c74c377b332b6d46665f07d553213469da3e62 100644 (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>
index 5cfb56062e349f81712a7732e5d860e0dc04c168..b73be94ad4c3ac0c86fbbce3c85ec8db663133bd 100644 (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"
index ae5e114c3d19d4a415633717fa606921a797cfa1..3cf7d22d574f42d53cd9134f4cb5095f83711bbe 100644 (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