diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/services/notes | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/services/notes')
-rw-r--r-- | app/services/notes/create_service.rb | 6 | ||||
-rw-r--r-- | app/services/notes/destroy_service.rb | 7 | ||||
-rw-r--r-- | app/services/notes/update_service.rb | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index 48f44affb23..b2826b5c905 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -73,6 +73,8 @@ module Notes if note.for_merge_request? && note.diff_note? && note.start_of_discussion? Discussions::CaptureDiffNotePositionService.new(note.noteable, note.diff_file&.paths).execute(note.discussion) end + + track_note_creation_usage_for_issues(note) if note.for_issue? end def do_commands(note, update_params, message, only_commands) @@ -113,5 +115,9 @@ module Notes track_usage_event(:incident_management_incident_comment, user.id) end + + def track_note_creation_usage_for_issues(note) + Gitlab::UsageDataCounters::IssueActivityUniqueCounter.track_issue_comment_added_action(author: note.author) + end end end diff --git a/app/services/notes/destroy_service.rb b/app/services/notes/destroy_service.rb index ee8a680fcb4..2b6ec47eaef 100644 --- a/app/services/notes/destroy_service.rb +++ b/app/services/notes/destroy_service.rb @@ -8,6 +8,13 @@ module Notes end clear_noteable_diffs_cache(note) + track_note_removal_usage_for_issues(note) if note.for_issue? + end + + private + + def track_note_removal_usage_for_issues(note) + Gitlab::UsageDataCounters::IssueActivityUniqueCounter.track_issue_comment_removed_action(author: note.author) end end end diff --git a/app/services/notes/update_service.rb b/app/services/notes/update_service.rb index 193d3080078..37872f7fbdb 100644 --- a/app/services/notes/update_service.rb +++ b/app/services/notes/update_service.rb @@ -14,6 +14,8 @@ module Notes note.save end + track_note_edit_usage_for_issues(note) if note.for_issue? + only_commands = false quick_actions_service = QuickActionsService.new(project, current_user) @@ -89,6 +91,10 @@ module Notes Note.id_in(note.discussion.notes.map(&:id)).update_all(confidential: params[:confidential]) end + + def track_note_edit_usage_for_issues(note) + Gitlab::UsageDataCounters::IssueActivityUniqueCounter.track_issue_comment_edited_action(author: note.author) + end end end |