diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-13 15:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-13 15:08:49 +0300 |
commit | 988424215cf104d9ee24bb1751141424cffb32d1 (patch) | |
tree | 9d2525571ecc693902b949ac8441e8c97b299c3c /app/services/notes | |
parent | 2705a15deaef07b1a38a53b9539d02f8ad499ce3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/notes')
-rw-r--r-- | app/services/notes/create_service.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index d32d1c8ca12..ff94f4c1451 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -45,13 +45,13 @@ module Notes def execute_quick_actions(note) return yield(false) unless quick_actions_supported?(note) - content, update_params, message = quick_actions_service.execute(note, quick_action_options) + content, update_params, message, command_names = quick_actions_service.execute(note, quick_action_options) only_commands = content.empty? note.note = content yield(only_commands) - do_commands(note, update_params, message, only_commands) + do_commands(note, update_params, message, command_names, only_commands) end def quick_actions_supported?(note) @@ -84,7 +84,7 @@ module Notes end end - def do_commands(note, update_params, message, only_commands) + def do_commands(note, update_params, message, command_names, only_commands) return if quick_actions_service.commands_executed_count.to_i == 0 if update_params.present? @@ -96,6 +96,7 @@ module Notes # when #save is called if only_commands note.errors.add(:commands_only, message.presence || _('Failed to apply commands.')) + note.errors.add(:command_names, command_names.flatten) # Allow consumers to detect problems applying commands note.errors.add(:commands, _('Failed to apply commands.')) unless message.present? end |