summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-24 12:09:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-24 12:09:01 +0000
commit2c2dd5e36c4ed5f09f488be288882d98f9124d12 (patch)
treead4c478bb1c588387a881b26a7db7c3237b9d4f3 /app/services
parent2ff184ad761fbfbe25a3d827c8f704349963a8d2 (diff)
downloadgitlab-ce-2c2dd5e36c4ed5f09f488be288882d98f9124d12.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r--app/services/system_note_service.rb21
-rw-r--r--app/services/system_notes/issuables_service.rb6
2 files changed, 7 insertions, 20 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index 033c80fd8ed..8a0f44b4e93 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -100,9 +100,7 @@ module SystemNoteService
end
def close_after_error_tracking_resolve(issue, project, author)
- body = _('resolved the corresponding error and closed the issue.')
-
- create_note(NoteSummary.new(issue, project, author, body, action: 'closed'))
+ ::SystemNotes::IssuablesService.new(noteable: issue, project: project, author: author).close_after_error_tracking_resolve
end
def change_status(noteable, project, author, status, source = nil)
@@ -243,23 +241,6 @@ module SystemNoteService
def zoom_link_removed(issue, project, author)
::SystemNotes::ZoomService.new(noteable: issue, project: project, author: author).zoom_link_removed
end
-
- private
-
- def create_note(note_summary)
- note = Note.create(note_summary.note.merge(system: true))
- note.system_note_metadata = SystemNoteMetadata.new(note_summary.metadata) if note_summary.metadata?
-
- note
- end
-
- def url_helpers
- @url_helpers ||= Gitlab::Routing.url_helpers
- end
-
- def content_tag(*args)
- ActionController::Base.helpers.content_tag(*args)
- end
end
SystemNoteService.prepend_if_ee('EE::SystemNoteService')
diff --git a/app/services/system_notes/issuables_service.rb b/app/services/system_notes/issuables_service.rb
index 6fffd2ed4bf..d7787dac4b8 100644
--- a/app/services/system_notes/issuables_service.rb
+++ b/app/services/system_notes/issuables_service.rb
@@ -282,6 +282,12 @@ module SystemNotes
create_note(NoteSummary.new(noteable, project, author, body, action: action))
end
+ def close_after_error_tracking_resolve
+ body = _('resolved the corresponding error and closed the issue.')
+
+ create_note(NoteSummary.new(noteable, project, author, body, action: 'closed'))
+ end
+
private
def cross_reference_note_content(gfm_reference)