]> source.dussan.org Git - redmine.git/commitdiff
Link from assignee to group page (#12795).
authorGo MAEDA <maeda@farend.jp>
Tue, 20 Jul 2021 21:39:17 +0000 (21:39 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 20 Jul 2021 21:39:17 +0000 (21:39 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@21075 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
app/views/issues/show.html.erb
test/functional/issues_controller_test.rb

index be3f40a94fc0332cca2bc1a09aa6463d4aace538..0db89544108303512ae9ba9fa83f85d8651acdaa 100644 (file)
@@ -265,8 +265,8 @@ module ApplicationHelper
       object.to_s
     when 'Float'
       sprintf "%.2f", object
-    when 'User'
-      html ? link_to_user(object) : object.to_s
+    when 'User', 'Group'
+      html ? link_to_principal(object) : object.to_s
     when 'Project'
       html ? link_to_project(object) : object.to_s
     when 'Version'
index 3a4e1b40f7d669b2566512809db344b6889a2f29..6b84bdfb3d8f237a15327624e01d4b6b0306fc4c 100644 (file)
@@ -50,7 +50,7 @@
   rows.left l(:field_priority), @issue.priority.name, :class => 'priority'
 
   unless @issue.disabled_core_fields.include?('assigned_to_id')
-    rows.left l(:field_assigned_to), (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
+    rows.left l(:field_assigned_to), (@issue.assigned_to ? link_to_principal(@issue.assigned_to) : "-"), :class => 'assigned-to'
   end
   unless @issue.disabled_core_fields.include?('category_id') || (@issue.category.nil? && @issue.project.issue_categories.none?)
     rows.left l(:field_category), (@issue.category ? @issue.category.name : "-"), :class => 'category'
index 87a6ec7045745625f96857bd29e52eb4197cde99..b8e185a2882b0c7470c0cb97db73daebc0e55d71 100644 (file)
@@ -2605,7 +2605,7 @@ class IssuesControllerTest < Redmine::ControllerTest
     assert_select 'table.attributes .category', 0
   end
 
-  def test_show_should_display_link_to_the_assignee
+  def test_show_should_display_link_to_the_assigned_user
     get(:show, :params => {:id => 2})
     assert_response :success
     assert_select '.assigned-to' do
@@ -2613,6 +2613,15 @@ class IssuesControllerTest < Redmine::ControllerTest
     end
   end
 
+  def test_show_should_display_link_to_the_assigned_group
+    Issue.find(2).update_attribute(:assigned_to_id, 10)
+    get(:show, :params => {:id => 2})
+    assert_response :success
+    assert_select '.assigned-to' do
+      assert_select 'a[href="/groups/10"]'
+    end
+  end
+
   def test_show_should_display_visible_changesets_from_other_projects
     project = Project.find(2)
     issue = project.issues.first