diff options
Diffstat (limited to 'app/controllers/concerns/integrations/actions.rb')
-rw-r--r-- | app/controllers/concerns/integrations/actions.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/concerns/integrations/actions.rb b/app/controllers/concerns/integrations/actions.rb index c0816c2fe9c..10e86bcc98d 100644 --- a/app/controllers/concerns/integrations/actions.rb +++ b/app/controllers/concerns/integrations/actions.rb @@ -7,7 +7,12 @@ module Integrations::Actions include Integrations::Params include IntegrationsHelper + # :overrides is defined in Admin:IntegrationsController + # rubocop:disable Rails/LexicallyScopedActionFilter + before_action :ensure_integration_enabled, only: [:edit, :update, :overrides, :test] before_action :integration, only: [:edit, :update, :overrides, :test] + # rubocop:enable Rails/LexicallyScopedActionFilter + before_action :render_404, only: :edit, if: -> do integration.to_param == 'prometheus' && Feature.enabled?(:remove_monitor_metrics) end @@ -58,6 +63,10 @@ module Integrations::Actions @integration ||= find_or_initialize_non_project_specific_integration(params[:id]) end + def ensure_integration_enabled + render_404 unless integration + end + def success_message if integration.active? format(s_('Integrations|%{integration} settings saved and active.'), integration: integration.title) |