Commit 348c4e6e authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'alert-endpoint-dropdown-helper' into 'master'

Alert endpoint dropdown helper

See merge request gitlab-org/gitlab!35739
parents 7c6d5829 6bc88545
......@@ -15,7 +15,7 @@ module OperationsHelper
end
end
def alerts_settings_data
def alerts_settings_data(disabled: false)
{
'prometheus_activated' => prometheus_service.manual_configuration?.to_s,
'activated' => alerts_service.activated?.to_s,
......@@ -28,7 +28,8 @@ module OperationsHelper
'prometheus_url' => notify_project_prometheus_alerts_url(@project, format: :json),
'url' => alerts_service.url,
'alerts_setup_url' => help_page_path('user/project/integrations/generic_alerts.md', anchor: 'setting-up-generic-alerts'),
'alerts_usage_url' => project_alert_management_index_path(@project)
'alerts_usage_url' => project_alert_management_index_path(@project),
'disabled' => disabled.to_s
}
end
end
......
.js-alerts-service-settings{ data: { activated: @service.activated?.to_s,
form_path: scoped_integration_path(@service),
authorization_key: @service.token,
url: @service.url || _('<namespace / project>'),
disabled: 'true',
alerts_setup_url: help_page_path('user/project/integrations/generic_alerts.md', anchor: 'setting-up-generic-alerts'),
alerts_usage_url: help_page_path('user/project/operations/alert_management.md') } }
.js-alerts-service-settings{ data: alerts_settings_data(disabled: true) }
......@@ -986,9 +986,6 @@ msgstr ""
msgid "<code>Protected</code> to expose them to protected branches or tags only."
msgstr ""
msgid "<namespace / project>"
msgstr ""
msgid "<no name set>"
msgstr ""
......
......@@ -39,7 +39,8 @@ RSpec.describe OperationsHelper do
'prometheus_authorization_key' => nil,
'prometheus_api_url' => nil,
'prometheus_activated' => 'false',
'prometheus_url' => notify_project_prometheus_alerts_url(project, format: :json)
'prometheus_url' => notify_project_prometheus_alerts_url(project, format: :json),
'disabled' => 'false'
)
end
end
......
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