]> source.dussan.org Git - redmine.git/commitdiff
Link "Last activity" column to project activity page (#40706, #23954).
authorMarius Balteanu <marius.balteanu@zitec.com>
Tue, 28 May 2024 17:40:09 +0000 (17:40 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Tue, 28 May 2024 17:40:09 +0000 (17:40 +0000)
Patch by Go MAEDA (@maeda).

git-svn-id: https://svn.redmine.org/redmine/trunk@22848 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/projects_queries_helper.rb
test/functional/projects_controller_test.rb

index dc540a432b339ac44def6d34de42be9a9792be15..66e47d551ebf338d444e8bb72c243d3356c2058d 100644 (file)
@@ -40,6 +40,16 @@ module ProjectsQueriesHelper
         get_project_status_label[column.value_object(item)]
       when :parent_id
         link_to_project(item.parent) unless item.parent.nil?
+      when :last_activity_date
+        formatted_value = super
+        if value.present? && formatted_value.present?
+          link_to(
+            formatted_value,
+            project_activity_path(item, :from => User.current.time_to_date(value))
+          )
+        else
+          formatted_value
+        end
       else
         super
       end
index 20cf613827b009d61299a682d1eec5c9e8b713cd..a21b50b077beeede7a339392939eef5327cb5fac 100644 (file)
@@ -260,7 +260,10 @@ class ProjectsControllerTest < Redmine::ControllerTest
       assert_response :success
     end
     assert_equal ['Name', 'Description', 'Last activity'], columns_in_list
-    assert_select 'tr#project-1 td.last_activity_date', :text => format_time(Journal.find(3).created_on)
+    activity_time = Journal.find(3).created_on
+    assert_select "tr#project-1 td.last_activity_date a[href=?]",
+      project_activity_path(Project.find(1), :from => User.current.time_to_date(activity_time)),
+      :text => format_time(activity_time)
     assert_select 'tr#project-4 td.last_activity_date', :text => ''
   end