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/presenters/alert_management/alert_presenter.rb')
-rw-r--r--app/presenters/alert_management/alert_presenter.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/presenters/alert_management/alert_presenter.rb b/app/presenters/alert_management/alert_presenter.rb
index a515c70152d..5bfa6dee18b 100644
--- a/app/presenters/alert_management/alert_presenter.rb
+++ b/app/presenters/alert_management/alert_presenter.rb
@@ -4,6 +4,7 @@ module AlertManagement
class AlertPresenter < Gitlab::View::Presenter::Delegated
include Gitlab::Utils::StrongMemoize
include IncidentManagement::Settings
+ include ActionView::Helpers::UrlHelper
MARKDOWN_LINE_BREAK = " \n".freeze
@@ -37,8 +38,18 @@ module AlertManagement
MARKDOWN
end
+ def runbook
+ strong_memoize(:runbook) do
+ payload&.dig('runbook')
+ end
+ end
+
def metrics_dashboard_url; end
+ def details_url
+ details_project_alert_management_url(project, alert.iid)
+ end
+
private
attr_reader :alert, :project
@@ -61,6 +72,7 @@ module AlertManagement
metadata << list_item('Monitoring tool', monitoring_tool) if monitoring_tool
metadata << list_item('Hosts', host_links) if hosts.any?
metadata << list_item('Description', description) if description.present?
+ metadata << list_item('GitLab alert', details_url) if details_url.present?
metadata.join(MARKDOWN_LINE_BREAK)
end