diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-04-04 13:36:58 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-04-04 13:36:58 +0300 |
commit | d67d43d1b693a37da73c8469e9b5c6c6f53ed0fa (patch) | |
tree | f225c33d0ed0d7bc3a69fc6610c29504617fccad /app/services/system_note_service.rb | |
parent | b57ed57f6b0100b2f8c5b062bac10628ce3bbacd (diff) |
Split status and confidentiality action
Diffstat (limited to 'app/services/system_note_service.rb')
-rw-r--r-- | app/services/system_note_service.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index d3e502b66dd..35cfcc3682e 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -183,7 +183,9 @@ module SystemNoteService body = status.dup body << " via #{source.gfm_reference(project)}" if source - create_note(NoteSummary.new(noteable, project, author, body, action: 'status')) + action = status == 'reopened' ? 'opened' : status + + create_note(NoteSummary.new(noteable, project, author, body, action: action)) end # Called when 'merge when pipeline succeeds' is executed @@ -273,9 +275,15 @@ module SystemNoteService # # Returns the created Note object def change_issue_confidentiality(issue, project, author) - body = issue.confidential ? 'made the issue confidential' : 'made the issue visible to everyone' + if issue.confidential + body = 'made the issue confidential' + action = 'confidential' + else + body = 'made the issue visible to everyone' + action = 'visible' + end - create_note(NoteSummary.new(issue, project, author, body, action: 'confidentiality')) + create_note(NoteSummary.new(issue, project, author, body, action: action)) end # Called when a branch in Noteable is changed |