Project

General

Profile

Actions

Feature #12348

open

support to add watcher to repository

Added by Michael Zhu about 12 years ago. Updated almost 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

If the user is watching the repository, on repository is changed, notify the user.

Actions #1

Updated by Toshi MARUYAMA about 12 years ago

  • Category set to SCM
Actions #2

Updated by Nicolas Rodriguez about 9 years ago

Hi!

I'm working on a similar issue for Redmine Git Hosting plugin : https://github.com/jbox-web/redmine_git_hosting/issues/536

I think this can be done with acts_as_watchable but before it works css class names for STI objects like repositories should be fixed :

Today it renders this :

<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>

CSS class should be dasherized : repository-xitolite-2-watcher otherwise watcher link is not updated.

Actions #3

Updated by Nicolas Rodriguez about 9 years ago

You should gsub('/', '-') here http://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/watchers_helper.rb#L43 :

"#{objects.first.class.to_s.underscore}-#{id}-watcher".gsub('/', '-')

And here : http://www.redmine.org/projects/redmine/repository/entry/trunk/app/helpers/watchers_helper.rb#L48

"delete_#{object.class.name.underscore}_watchers".gsub('/', '_').to_sym

I've tested it, it works.

my 2 cents

Actions #4

Updated by Nicolas Rodriguez almost 9 years ago

Up?

Actions #5

Updated by Nicolas Rodriguez almost 8 years ago

Hi there! Any news?

Actions #6

Updated by Jan from Planio www.plan.io almost 8 years ago

Hi Nicolas, it would be greatly appreciated if you could provide patch files for this that apply cleanly to current trunk.

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).

If you're using Git, you can easily clone the Redmine Git mirror, commit your changes locally and then create a series of patches using the git format-patch command, also see Contribute and How_to_create_patch_series_on_Mercurial_and_Git in particular.

I'd be happy to review it.

Actions

Also available in: Atom PDF