Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/integrations/chat_message')
-rw-r--r--app/models/integrations/chat_message/issue_message.rb10
-rw-r--r--app/models/integrations/chat_message/pipeline_message.rb2
2 files changed, 9 insertions, 3 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
diff --git a/app/models/integrations/chat_message/pipeline_message.rb b/app/models/integrations/chat_message/pipeline_message.rb
index 88db40bea7f..f8a634be336 100644
--- a/app/models/integrations/chat_message/pipeline_message.rb
+++ b/app/models/integrations/chat_message/pipeline_message.rb
@@ -151,7 +151,7 @@ module Integrations
fields << failed_stages_field if failed_stages.any?
fields << failed_jobs_field if failed_jobs.any?
fields << yaml_error_field if pipeline.has_yaml_errors?
- fields << pipeline_name_field if Feature.enabled?(:pipeline_name, project) && pipeline.name.present?
+ fields << pipeline_name_field if pipeline.name.present?
fields
end