https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292012-11-12T03:38:12ZRedmineRedmine - Feature #12348: support to add watcher to repositoryhttps://www.redmine.org/issues/12348?journal_id=427572012-11-12T03:38:12ZToshi MARUYAMA
<ul><li><strong>Category</strong> set to <i>SCM</i></li></ul> Redmine - Feature #12348: support to add watcher to repositoryhttps://www.redmine.org/issues/12348?journal_id=675422015-11-26T22:09:37ZNicolas Rodriguez
<ul></ul><p>Hi!</p>
<p>I'm working on a similar issue for Redmine Git Hosting plugin : <a class="external" href="https://github.com/jbox-web/redmine_git_hosting/issues/536">https://github.com/jbox-web/redmine_git_hosting/issues/536</a></p>
<p>I think this can be done with <code>acts_as_watchable</code> but before it works css class names for STI objects like repositories should be fixed :</p>
<p>Today it renders this : <br /><code><br /><a class="repository/xitolite-2-watcher icon icon-fav" href="/watchers/watch?object_id=2&object_type=repository%2Fxitolite" data-method="delete" rel="nofollow" data-remote="true">Ne plus surveiller</a><br /></code></p>
<p>CSS class should be dasherized : <code>repository-xitolite-2-watcher</code> otherwise watcher link is not updated.</p> Redmine - Feature #12348: support to add watcher to repositoryhttps://www.redmine.org/issues/12348?journal_id=675432015-11-27T01:15:15ZNicolas Rodriguez
<ul></ul><p>You should <code>gsub('/', '-')</code> here <a class="external" href="http://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/watchers_helper.rb#L43">http://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/watchers_helper.rb#L43</a> :</p>
<p><code>"#{objects.first.class.to_s.underscore}-#{id}-watcher".gsub('/', '-')</code></p>
<p>And here : <a class="external" href="http://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/watchers_helper.rb#L48">http://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/watchers_helper.rb#L48</a></p>
<p><code>"delete_#{object.class.name.underscore}_watchers".gsub('/', '_').to_sym</code></p>
<p>I've tested it, it works.</p>
<p>my 2 cents</p> Redmine - Feature #12348: support to add watcher to repositoryhttps://www.redmine.org/issues/12348?journal_id=683412016-01-08T09:22:48ZNicolas Rodriguez
<ul></ul><p>Up?</p> Redmine - Feature #12348: support to add watcher to repositoryhttps://www.redmine.org/issues/12348?journal_id=755182016-12-31T23:20:55ZNicolas Rodriguez
<ul></ul><p>Hi there! Any news?</p> Redmine - Feature #12348: support to add watcher to repositoryhttps://www.redmine.org/issues/12348?journal_id=755402017-01-01T10:54:50ZJan from Planio www.plan.io
<ul></ul><p>Hi Nicolas, it would be greatly appreciated if you could provide patch files for this that apply cleanly to current trunk.</p>
<p>I'd recommend to create a first patch that changes the CSS class names as you propose and then a second patch (or series of patches) which implement the watching feature (which I think would be a great addition).</p>
<p>If you're using Git, you can easily clone the <a href="https://github.com/redmine/redmine" class="external">Redmine Git mirror</a>, commit your changes locally and then create a series of patches using the <code>git format-patch</code> command, also see <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/Contribute#Basic-process-for-contributing-code">Contribute</a> and <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/How_to_create_patch_series_on_Mercurial_and_Git">How_to_create_patch_series_on_Mercurial_and_Git</a> in particular.</p>
<p>I'd be happy to review it.</p>