summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Wortschack <mwortschack@gitlab.com>2018-09-19 12:57:14 +0200
committerMartin Wortschack <mwortschack@gitlab.com>2018-09-19 12:57:14 +0200
commitdf9cb93091838b6c4661c974436ce9120d9b1983 (patch)
tree525149a1e0789640c1f58f3542f8fbfed558097c
parent0df11843bf014711cbefe92a8ad76cff731c4eb0 (diff)
downloadgitlab-ce-df9cb93091838b6c4661c974436ce9120d9b1983.tar.gz
Add empty controller actions and utilize referer_path helper
-rw-r--r--app/controllers/admin/application_settings_controller.rb26
-rw-r--r--app/controllers/concerns/internal_redirect.rb6
2 files changed, 30 insertions, 2 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index 6beed4b7dd2..51f75fb77f0 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -1,15 +1,37 @@
class Admin::ApplicationSettingsController < Admin::ApplicationController
+ include InternalRedirect
before_action :set_application_setting
def show
end
- def geo
+ def integrations
+ end
+
+ def repository
end
def templates
end
+ def ci_cd
+ end
+
+ def reporting
+ end
+
+ def metrics_and_profiling
+ end
+
+ def network
+ end
+
+ def geo
+ end
+
+ def preferences
+ end
+
def update
successful = ApplicationSettings::UpdateService
.new(@application_setting, current_user, application_setting_params)
@@ -19,7 +41,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
session[:ask_for_usage_stats_consent] = current_user.requires_usage_stats_consent?
end
- redirect_path = request.referer.presence ? URI(request.referer).path : admin_application_settings_path
+ redirect_path = referer_path(request) || admin_application_settings_path
respond_to do |format|
if successful
diff --git a/app/controllers/concerns/internal_redirect.rb b/app/controllers/concerns/internal_redirect.rb
index 10b9852e329..6ac9e860437 100644
--- a/app/controllers/concerns/internal_redirect.rb
+++ b/app/controllers/concerns/internal_redirect.rb
@@ -36,4 +36,10 @@ module InternalRedirect
path_with_query = [uri.path, uri.query].compact.join('?')
[path_with_query, uri.fragment].compact.join("#")
end
+
+ def referer_path(request)
+ return unless request.referer.presence
+
+ URI(request.referer).path
+ end
end