Commit 5ecf5224 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Move alerts-endpoint inside ClusterPresenter

parent 4949b735
...@@ -15,7 +15,8 @@ module EE ...@@ -15,7 +15,8 @@ module EE
'empty-unable-to-connect-svg-path': image_path('illustrations/monitoring/unable_to_connect.svg'), 'empty-unable-to-connect-svg-path': image_path('illustrations/monitoring/unable_to_connect.svg'),
'settings-path': '', 'settings-path': '',
'project-path': '', 'project-path': '',
'tags-path': '' 'tags-path': '',
'alerts-endpoint': alerts_endpoint
} }
end end
...@@ -24,6 +25,10 @@ module EE ...@@ -24,6 +25,10 @@ module EE
def image_path(path) def image_path(path)
ActionController::Base.helpers.image_path(path) ActionController::Base.helpers.image_path(path)
end end
def alerts_endpoint
'/' if ::Feature.enabled?(:prometheus_computed_alerts)
end
end end
end end
end end
...@@ -28,9 +28,20 @@ describe Clusters::ClusterPresenter do ...@@ -28,9 +28,20 @@ describe Clusters::ClusterPresenter do
'empty-unable-to-connect-svg-path': match_asset_path('/assets/illustrations/monitoring/unable_to_connect.svg'), 'empty-unable-to-connect-svg-path': match_asset_path('/assets/illustrations/monitoring/unable_to_connect.svg'),
'settings-path': '', 'settings-path': '',
'project-path': '', 'project-path': '',
'tags-path': '' 'tags-path': '',
'alerts-endpoint': '/'
) )
end end
context 'when prometheus_computed_alerts feature is disabled' do
before do
stub_feature_flags(prometheus_computed_alerts: false)
end
it 'alerts-endpoint is nil' do
expect(subject['alerts-endpoint']).to be_nil
end
end
end end
context 'with project cluster' do context 'with project cluster' do
......
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