diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-11-21 22:25:37 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-11-23 22:25:14 +0300 |
commit | 5c2c471a835f9588e39ec11fa79571c8b44979f8 (patch) | |
tree | a1e861518e7ee2e9199891fd75f02657c7f50ba9 /app/services/issuable | |
parent | e72804ed0a73f8807ca58881645f0c95c70de9c9 (diff) |
Fix WIP system note not being created
Diffstat (limited to 'app/services/issuable')
-rw-r--r-- | app/services/issuable/common_system_notes_service.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/services/issuable/common_system_notes_service.rb b/app/services/issuable/common_system_notes_service.rb index 92eaa5d5115..3da21bd8b8f 100644 --- a/app/services/issuable/common_system_notes_service.rb +++ b/app/services/issuable/common_system_notes_service.rb @@ -41,6 +41,14 @@ module Issuable end end + def create_wip_note(old_title) + return unless issuable.is_a?(MergeRequest) + + if MergeRequest.work_in_progress?(old_title) != issuable.work_in_progress? + SystemNoteService.handle_merge_request_wip(issuable, issuable.project, current_user) + end + end + def create_labels_note(old_labels) added_labels = issuable.labels - old_labels removed_labels = old_labels - issuable.labels @@ -49,7 +57,11 @@ module Issuable end def create_title_change_note(old_title) - SystemNoteService.change_title(issuable, issuable.project, current_user, old_title) + create_wip_note(old_title) + + if issuable.wipless_title_changed(old_title) + SystemNoteService.change_title(issuable, issuable.project, current_user, old_title) + end end def create_description_change_note |