summaryrefslogtreecommitdiff
path: root/lib/gitlab/chat_commands/presenters/issue_search.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/chat_commands/presenters/issue_search.rb')
-rw-r--r--lib/gitlab/chat_commands/presenters/issue_search.rb47
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/gitlab/chat_commands/presenters/issue_search.rb b/lib/gitlab/chat_commands/presenters/issue_search.rb
deleted file mode 100644
index 73788cf9662..00000000000
--- a/lib/gitlab/chat_commands/presenters/issue_search.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-module Gitlab
- module ChatCommands
- module Presenters
- class IssueSearch < Presenters::Base
- include Presenters::IssueBase
-
- def present
- text = if @resource.count >= 5
- "Here are the first 5 issues I found:"
- elsif @resource.one?
- "Here is the only issue I found:"
- else
- "Here are the #{@resource.count} issues I found:"
- end
-
- ephemeral_response(text: text, attachments: attachments)
- end
-
- private
-
- def attachments
- @resource.map do |issue|
- url = "[#{issue.to_reference}](#{url_for([namespace, project, issue])})"
-
- {
- color: color(issue),
- fallback: "#{issue.to_reference} #{issue.title}",
- text: "#{url} ยท #{issue.title} (#{status_text(issue)})",
-
- mrkdwn_in: [
- :text
- ]
- }
- end
- end
-
- def project
- @project ||= @resource.first.project
- end
-
- def namespace
- @namespace ||= project.namespace.becomes(Namespace)
- end
- end
- end
- end
-end