2021-04-15 18:09:01 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Banzai
|
|
|
|
module Filter
|
|
|
|
module References
|
|
|
|
class AlertReferenceFilter < IssuableReferenceFilter
|
|
|
|
self.reference_type = :alert
|
2021-04-22 12:09:49 +00:00
|
|
|
self.object_class = AlertManagement::Alert
|
2021-04-15 18:09:01 +00:00
|
|
|
|
2021-04-22 12:09:49 +00:00
|
|
|
def object_sym
|
2021-04-15 18:09:01 +00:00
|
|
|
:alert
|
|
|
|
end
|
|
|
|
|
|
|
|
def parent_records(parent, ids)
|
|
|
|
parent.alert_management_alerts.where(iid: ids.to_a)
|
|
|
|
end
|
|
|
|
|
|
|
|
def url_for_object(alert, project)
|
|
|
|
::Gitlab::Routing.url_helpers.details_project_alert_management_url(
|
|
|
|
project,
|
|
|
|
alert.iid,
|
|
|
|
only_path: context[:only_path]
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|