Commit ba4f0abf47940f27160166500979f6bcbd797d45
1 parent
b1bd3f12
Exists in
master
and in
4 other branches
wall comment does not create an event on dashboard any more
Showing
2 changed files
with
7 additions
and
5 deletions
Show diff stats
app/helpers/notes_helper.rb
1 | 1 | module NotesHelper |
2 | 2 | # Helps to distinguish e.g. commit notes in mr notes list |
3 | 3 | def note_for_main_target?(note) |
4 | - note.for_wall? || | |
5 | - (@target_type.camelize == note.noteable_type && !note.for_diff_line?) | |
4 | + (@target_type.camelize == note.noteable_type && !note.for_diff_line?) | |
6 | 5 | end |
7 | 6 | |
8 | 7 | def note_target_fields | ... | ... |
app/observers/activity_observer.rb
... | ... | @@ -4,9 +4,12 @@ class ActivityObserver < ActiveRecord::Observer |
4 | 4 | def after_create(record) |
5 | 5 | event_author_id = record.author_id |
6 | 6 | |
7 | - # Skip status notes | |
8 | - if record.kind_of?(Note) && record.note.include?("_Status changed to ") | |
9 | - return true | |
7 | + if record.kind_of?(Note) | |
8 | + # Skip system status notes like 'status changed to close' | |
9 | + return true if record.note.include?("_Status changed to ") | |
10 | + | |
11 | + # Skip wall notes to prevent spaming of dashboard | |
12 | + return true if record.noteable_type.blank? | |
10 | 13 | end |
11 | 14 | |
12 | 15 | if event_author_id | ... | ... |