diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/presenters/alert_management/alert_presenter.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/presenters/alert_management/alert_presenter.rb')
-rw-r--r-- | app/presenters/alert_management/alert_presenter.rb | 12 |
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 |