Commit aa4632e0 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Add description field in alert presenter

Add a description field to AlertPresenter's metadata list.
So that created alert issue will have a description field on the page.
parent 57d5e537
......@@ -60,6 +60,7 @@ module AlertManagement
metadata << list_item('Service', service) if service
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.join(MARKDOWN_LINE_BREAK)
end
......
......@@ -12,7 +12,7 @@ RSpec.describe AlertManagement::AlertPresenter do
}
end
let_it_be(:alert) do
create(:alert_management_alert, :with_host, :with_service, :with_monitoring_tool, project: project, payload: generic_payload)
create(:alert_management_alert, :with_description, :with_host, :with_service, :with_monitoring_tool, project: project, payload: generic_payload)
end
subject(:presenter) { described_class.new(alert) }
......@@ -29,7 +29,8 @@ RSpec.describe AlertManagement::AlertPresenter do
**Severity:** #{presenter.severity}#{markdown_line_break}
**Service:** #{alert.service}#{markdown_line_break}
**Monitoring tool:** #{alert.monitoring_tool}#{markdown_line_break}
**Hosts:** #{alert.hosts.join(' ')}
**Hosts:** #{alert.hosts.join(' ')}#{markdown_line_break}
**Description:** #{alert.description}
#### Alert Details
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment