Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 21:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 21:09:00 +0300
commitc57e10faab0abb213e7a18274fd5a98ba87a5c09 (patch)
treede0195e28dfe19fbfeb5bffa8fde4f511288d8ef /app/controllers/projects/services_controller.rb
parent11e5d1b9ca3efa7be34ddebb708a6aedb4e91639 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r--app/controllers/projects/services_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb
index daaca9e1268..c916140211e 100644
--- a/app/controllers/projects/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -8,6 +8,8 @@ class Projects::ServicesController < Projects::ApplicationController
before_action :ensure_service_enabled
before_action :service
before_action :web_hook_logs, only: [:edit, :update]
+ before_action :set_deprecation_notice_for_prometheus_service, only: [:edit, :update]
+ before_action :redirect_deprecated_prometheus_service, only: [:update]
respond_to :html
@@ -93,4 +95,16 @@ class Projects::ServicesController < Projects::ApplicationController
.as_json(only: @service.json_fields)
.merge(errors: @service.errors.as_json)
end
+
+ def redirect_deprecated_prometheus_service
+ redirect_to edit_project_service_path(project, @service) if @service.is_a?(::PrometheusService) && Feature.enabled?(:settings_operations_prometheus_service, project)
+ end
+
+ def set_deprecation_notice_for_prometheus_service
+ return if !@service.is_a?(::PrometheusService) || !Feature.enabled?(:settings_operations_prometheus_service, project)
+
+ operations_link_start = "<a href=\"#{project_settings_operations_path(project)}\">"
+ message = s_('PrometheusService|You can now manage your Prometheus settings on the %{operations_link_start}Operations%{operations_link_end} page. Fields on this page has been deprecated.') % { operations_link_start: operations_link_start, operations_link_end: "</a>" }
+ flash.now[:alert] = message.html_safe
+ end
end