Commit df9cb930 authored by Martin Wortschack's avatar Martin Wortschack

Add empty controller actions and utilize referer_path helper

parent 0df11843
class Admin::ApplicationSettingsController < Admin::ApplicationController class Admin::ApplicationSettingsController < Admin::ApplicationController
include InternalRedirect
before_action :set_application_setting before_action :set_application_setting
def show def show
end end
def geo def integrations
end
def repository
end end
def templates def templates
end end
def ci_cd
end
def reporting
end
def metrics_and_profiling
end
def network
end
def geo
end
def preferences
end
def update def update
successful = ApplicationSettings::UpdateService successful = ApplicationSettings::UpdateService
.new(@application_setting, current_user, application_setting_params) .new(@application_setting, current_user, application_setting_params)
...@@ -19,7 +41,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -19,7 +41,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
session[:ask_for_usage_stats_consent] = current_user.requires_usage_stats_consent? session[:ask_for_usage_stats_consent] = current_user.requires_usage_stats_consent?
end 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| respond_to do |format|
if successful if successful
......
...@@ -36,4 +36,10 @@ module InternalRedirect ...@@ -36,4 +36,10 @@ module InternalRedirect
path_with_query = [uri.path, uri.query].compact.join('?') path_with_query = [uri.path, uri.query].compact.join('?')
[path_with_query, uri.fragment].compact.join("#") [path_with_query, uri.fragment].compact.join("#")
end end
def referer_path(request)
return unless request.referer.presence
URI(request.referer).path
end
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