diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /app/models/integrations/chat_message/issue_message.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'app/models/integrations/chat_message/issue_message.rb')
-rw-r--r-- | app/models/integrations/chat_message/issue_message.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/integrations/chat_message/issue_message.rb b/app/models/integrations/chat_message/issue_message.rb index ca8ef670e67..1c234630370 100644 --- a/app/models/integrations/chat_message/issue_message.rb +++ b/app/models/integrations/chat_message/issue_message.rb @@ -9,6 +9,7 @@ module Integrations attr_reader :action attr_reader :state attr_reader :description + attr_reader :object_kind def initialize(params) super @@ -21,6 +22,7 @@ module Integrations @action = obj_attr[:action] @state = obj_attr[:state] @description = obj_attr[:description] || '' + @object_kind = params[:object_kind] end def attachments @@ -32,7 +34,7 @@ module Integrations def activity { - title: "Issue #{state} by #{strip_markup(user_combined_name)}", + title: "#{issue_type} #{state} by #{strip_markup(user_combined_name)}", subtitle: "in #{project_link}", text: issue_link, image: user_avatar @@ -42,7 +44,7 @@ module Integrations private def message - "[#{project_link}] Issue #{issue_link} #{state} by #{strip_markup(user_combined_name)}" + "[#{project_link}] #{issue_type} #{issue_link} #{state} by #{strip_markup(user_combined_name)}" end def opened_issue? @@ -69,6 +71,10 @@ module Integrations def issue_title "#{Issue.reference_prefix}#{issue_iid} #{strip_markup(title)}" end + + def issue_type + @issue_type ||= object_kind == 'incident' ? 'Incident' : 'Issue' + end end end end |