https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292022-11-24T02:42:01ZRedmineRedmine - Defect #37958: Groups added to watchers are not shown as linkshttps://www.redmine.org/issues/37958?journal_id=1085862022-11-24T02:42:01ZMizuki ISHIKAWA
<ul></ul><p>I think the following code will solve the problem.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index fc97da1056..97067378e4 100644
</span><span class="gd">--- a/app/helpers/watchers_helper.rb
</span><span class="gi">+++ b/app/helpers/watchers_helper.rb
</span><span class="p">@@ -51,7 +51,7 @@</span> module WatchersHelper
lis = object.watcher_users.collect do |user|
s = ''.html_safe
s << avatar(user, :size => "16").to_s
<span class="gd">- s << link_to_user(user, :class => 'user')
</span><span class="gi">+ s << link_to_principal(user, class: user.class.to_s.downcase)
</span> if object.respond_to?(:visible?) && user.is_a?(User) && !object.visible?(user)
s << content_tag('span', l(:notice_invalid_watcher), class: 'icon-only icon-warning', title: l(:notice_invalid_watcher))
end
<span class="gh">diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index a10abbd129..58e51348a9 100644
</span><span class="gd">--- a/test/functional/issues_controller_test.rb
</span><span class="gi">+++ b/test/functional/issues_controller_test.rb
</span><span class="p">@@ -2726,7 +2726,7 @@</span> class IssuesControllerTest < Redmine::ControllerTest
end
assert_select "li.user-10" do
assert_select 'img.gravatar[title=?]', 'A Team'
<span class="gd">- assert_select 'a[href="/users/10"]', false
</span><span class="gi">+ assert_select 'a[href="/groups/10"]'
</span> assert_select 'a[class*=delete]'
end
end
</code></pre> Redmine - Defect #37958: Groups added to watchers are not shown as linkshttps://www.redmine.org/issues/37958?journal_id=1085912022-11-24T10:58:24ZDmitry Makurin
<ul></ul>The problem is that there are multiple methods to render user/group links:
<ul>
<li>link_to_user</li>
<li>link_to_principal</li>
<li>link_to_group</li>
</ul>
<p>Before <a class="changeset" title="Add link from group name to group page on project overview page (#12795). Patch by Go MAEDA." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/21073">r21073</a> only <code>link_to_(user/group)</code> existed and it was clear what method was responsible for.</p>
<p><code>link_to_principal</code> combined both <code>link_to_user</code> and <code>link_to_group</code> and now it's really confusing what the difference between all of them.</p>
<p>I would suggest to unify <code>link_to_user</code> and <code>link_to_group</code> into <code>link_to_principal</code> or properly decompose <code>link_to_principal</code>.</p> Redmine - Defect #37958: Groups added to watchers are not shown as linkshttps://www.redmine.org/issues/37958?journal_id=1086252022-11-28T23:00:27ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Marius BĂLTEANU</i></li><li><strong>Target version</strong> set to <i>5.0.4</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>I've committed for now the patch posted by Mizuki to catch the release of new maintenance version.</p> Redmine - Defect #37958: Groups added to watchers are not shown as linkshttps://www.redmine.org/issues/37958?journal_id=1086262022-11-28T23:01:02ZMarius BĂLTEANU
<ul></ul><p>Dmitry Makurin wrote:</p>
<blockquote>
The problem is that there are multiple methods to render user/group links:
<ul>
<li>link_to_user</li>
<li>link_to_principal</li>
<li>link_to_group</li>
</ul>
<p>Before <a class="changeset" title="Add link from group name to group page on project overview page (#12795). Patch by Go MAEDA." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/21073">r21073</a> only <code>link_to_(user/group)</code> existed and it was clear what method was responsible for.</p>
<p><code>link_to_principal</code> combined both <code>link_to_user</code> and <code>link_to_group</code> and now it's really confusing what the difference between all of them.</p>
<p>I would suggest to unify <code>link_to_user</code> and <code>link_to_group</code> into <code>link_to_principal</code> or properly decompose <code>link_to_principal</code>.</p>
</blockquote>
<p>Indeed, it sounds confusing. If you have code proposal, I'll very happy to review it.</p> Redmine - Defect #37958: Groups added to watchers are not shown as linkshttps://www.redmine.org/issues/37958?journal_id=1086502022-12-01T15:03:30ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>