Project

General

Profile

Feature #2716 » auto_watch_previous_assignee.patch

Marius BĂLTEANU, 2025-09-08 22:54

View differences:

app/models/journal.rb
354 354
        !Watcher.any_watched?(Array.wrap(journalized), user)
355 355
      journalized.set_watcher(user, true)
356 356
    end
357

  
358
    previous_assignee = journalized.previous_assignee
359
    if previous_assignee.is_a?(User) && previous_assignee&.active? &&
360
        previous_assignee.allowed_to?(:add_issue_watchers, project) &&
361
        previous_assignee.pref.auto_watch_on?('issue_previous_assigned_to_me') &&
362
        !Watcher.any_watched?(Array.wrap(journalized), previous_assignee)
363
      journalized.set_watcher(previous_assignee, true)
364
    end
357 365
  end
358 366

  
359 367
  def send_notification
app/models/user_preference.rb
44 44

  
45 45
  TEXTAREA_FONT_OPTIONS = ['monospace', 'proportional']
46 46
  DEFAULT_TOOLBAR_LANGUAGE_OPTIONS = %w[c cpp csharp css diff go groovy html java javascript objc perl php python r ruby sass scala shell sql swift xml yaml]
47
  AUTO_WATCH_ON_OPTIONS = %w[issue_created issue_contributed_to]
47
  AUTO_WATCH_ON_OPTIONS = %w[issue_created issue_contributed_to issue_previous_assigned_to_me]
48 48

  
49 49
  def initialize(attributes=nil, *args)
50 50
    super
config/locales/en.yml
993 993
  label_auto_watch_on: Auto watch
994 994
  label_auto_watch_on_issue_created: Issues I created
995 995
  label_auto_watch_on_issue_contributed_to: Issues I contributed to
996
  label_auto_watch_on_issue_previous_assigned_to_me: Issues previous assigned to me
996 997
  label_preferences: Preferences
997 998
  label_chronological_order: In chronological order
998 999
  label_reverse_chronological_order: In reverse chronological order
(5-5/5)