Commit ed01d53c authored by Alexander Oleynikov's avatar Alexander Oleynikov Committed by Imre Farkas

Deprecate GET /admin/application_settings route

parent 070abce6
......@@ -37,10 +37,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
define_method(action) { perform_update if submitted? }
end
def show
render :general
end
def update
perform_update
end
......@@ -73,7 +69,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
RepositoryCheck::ClearWorker.perform_async
redirect_to(
admin_application_settings_path,
general_admin_application_settings_path,
notice: _('Started asynchronous removal of all repository check states.')
)
end
......@@ -256,7 +252,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
session[:ask_for_usage_stats_consent] = current_user.requires_usage_stats_consent?
end
redirect_path = referer_path(request) || admin_application_settings_path
redirect_path = referer_path(request) || general_admin_application_settings_path
respond_to do |format|
if successful
......
......@@ -42,7 +42,7 @@
.well-segment.admin-well.admin-well-features
%h4 Features
= feature_entry(_('Sign up'),
href: admin_application_settings_path(anchor: 'js-signup-settings'),
href: general_admin_application_settings_path(anchor: 'js-signup-settings'),
enabled: allow_signup?)
= feature_entry(_('LDAP'),
......@@ -50,11 +50,11 @@
doc_href: help_page_path('administration/auth/ldap'))
= feature_entry(_('Gravatar'),
href: admin_application_settings_path(anchor: 'js-account-settings'),
href: general_admin_application_settings_path(anchor: 'js-account-settings'),
enabled: gravatar_enabled?)
= feature_entry(_('OmniAuth'),
href: admin_application_settings_path(anchor: 'js-signin-settings'),
href: general_admin_application_settings_path(anchor: 'js-signin-settings'),
enabled: Gitlab::Auth.omniauth_enabled?,
doc_href: help_page_path('integration/omniauth'))
......@@ -85,7 +85,7 @@
.float-right
= version_status_badge
%p
%a{ href: admin_application_settings_path }
%a{ href: general_admin_application_settings_path }
GitLab
%span.float-right
= Gitlab::VERSION
......
......@@ -221,7 +221,7 @@
= _('Appearance')
= nav_link(controller: :application_settings) do
= link_to admin_application_settings_path do
= link_to general_admin_application_settings_path do
.nav-icon-container
= sprite_icon('settings')
%span.nav-item-name.qa-admin-settings-item
......@@ -229,11 +229,11 @@
%ul.sidebar-sub-level-items.qa-admin-sidebar-settings-submenu
= nav_link(controller: :application_settings, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_application_settings_path do
= link_to general_admin_application_settings_path do
%strong.fly-out-top-item-name
= _('Settings')
%li.divider.fly-out-top-item
= nav_link(path: 'application_settings#show') do
= nav_link(path: 'application_settings#general') do
= link_to general_admin_application_settings_path, title: _('General'), class: 'qa-admin-settings-general-item' do
%span
= _('General')
......
---
title: Deprecate /admin/application_settings in favor of /admin/application_settings/general. The former path is to be removed in 13.0.
merge_request: 22252
author: Alexander Oleynikov
type: changed
......@@ -107,7 +107,11 @@ namespace :admin do
end
end
resource :application_settings, only: [:show, :update] do
resource :application_settings, only: :update do
# This redirect should be removed with 13.0 release.
# https://gitlab.com/gitlab-org/gitlab/issues/199427
get '/', to: redirect('admin/application_settings/general'), as: nil
resources :services, only: [:index, :edit, :update]
get :usage_data
......
......@@ -249,7 +249,7 @@ on the **secondary** node.
Geo synchronizes repositories over HTTP/HTTPS, and therefore requires this clone
method to be enabled. Navigate to **Admin Area > Settings**
(`/admin/application_settings`) on the **primary** node, and set
(`/admin/application_settings/general`) on the **primary** node, and set
`Enabled Git access protocols` to `Both SSH and HTTP(S)` or `Only HTTP(S)`.
### Step 7. Verify proper functioning of the **secondary** node
......
......@@ -33,8 +33,8 @@ bundle exec rake gitlab:import_export:data RAILS_ENV=production
Note the following:
- Importing is not possible if the version of the import instance is older than that of the exporter.
- The project import option must be enabled in
application settings (`/admin/application_settings`) under **Import sources**, which is available
- The project import option must be enabled in application settings
(`/admin/application_settings/general`) under **Import sources**, which is available
under **{admin}** **Admin Area >** **{settings}** **Settings > Visibility and access controls**.
- The exports are stored in a temporary [shared directory](../../development/shared_files.md)
and are deleted every 24 hours by a specific worker.
......@@ -2,7 +2,7 @@
These API calls allow you to read and modify GitLab instance
[application settings](#list-of-settings-that-can-be-accessed-via-api-calls)
as appear in `/admin/application_settings`. You have to be an
as appear in `/admin/application_settings/general`. You have to be an
administrator in order to perform this action.
## Get current application settings
......
......@@ -201,7 +201,7 @@ The table below shows what kind of documentation goes where.
describing what can be achieved by accessing GitLab's admin interface
(_not to be confused with `doc/administration` where server access is
required_).
1. Every category under `/admin/application_settings` should have its
1. Every category under `/admin/application_settings/` should have its
own document located at `doc/user/admin_area/settings/`. For example,
the **Visibility and Access Controls** category should have a document
located at `doc/user/admin_area/settings/visibility_and_access_controls.md`.
......
......@@ -49,7 +49,7 @@ From GitLab 12.6, the minimum password length set in this configuration file wil
The user password length is set to a minimum of 8 characters by default.
To change that using GitLab UI:
In **Admin Area > Settings** (`/admin/application_settings`), go to the section **Sign-up restrictions**.
In **Admin Area > Settings** (`/admin/application_settings/general`), go to the section **Sign-up restrictions**.
[Minimum password length settings](../user/admin_area/img/minimum_password_length_settings_v12_6.png)
......
......@@ -17,7 +17,7 @@ algorithms.
GitLab allows you to restrict the allowed SSH key technology as well as specify
the minimum key length for each technology.
In **Admin Area > Settings** (`/admin/application_settings`), expand the
In **Admin Area > Settings** (`/admin/application_settings/general`), expand the
**Visibility and access controls** section:
![SSH keys restriction admin settings](img/ssh_keys_restrictions_settings.png)
......
......@@ -25,7 +25,8 @@ won't be able to leave the 2FA configuration area at `/profile/two_factor_auth`.
To enable 2FA for all users:
1. Navigate to **Admin Area > Settings > General** (`/admin/application_settings`).
1. Navigate to **Admin Area > Settings > General**
(`/admin/application_settings/general`).
1. Expand the **Sign-in restrictions** section, where you can configure both.
If you want 2FA enforcement to take effect on next login, change the grace
......
......@@ -8,7 +8,7 @@ GitLab can be configured to require confirmation of a user's email address when
the user signs up. When this setting is enabled, the user is unable to sign in until
they confirm their email address.
In **Admin Area > Settings** (`/admin/application_settings`), go to the section
In **Admin Area > Settings** (`/admin/application_settings/general`), go to the section
**Sign-up Restrictions** and look for the **Send confirmation email on sign-up** option.
<!-- ## Troubleshooting
......
......@@ -17,8 +17,8 @@ Note the following:
- Importing is not possible if the import instance version differs from
that of the exporter.
- The project import option must be enabled in
application settings (`/admin/application_settings`) under under **Import sources**, which is
- The project import option must be enabled in application settings
(`/admin/application_settings/general`) under **Import sources**, which is
available under **{admin}** **Admin Area >** **{settings}** **Settings > Visibility and access controls**.
Ask your administrator if you don't see the **GitLab export** button when
creating a new project.
......
......@@ -42,7 +42,7 @@ describe Admin::ApplicationSettingsController do
put :update, params: { application_setting: settings }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
settings.except(:elasticsearch_url, :repository_size_limit).each do |setting, value|
expect(ApplicationSetting.current.public_send(setting)).to eq(value)
end
......@@ -136,7 +136,7 @@ describe Admin::ApplicationSettingsController do
it 'updates repository_size_limit' do
put :update, params: { application_setting: { repository_size_limit: '100' } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(response).to set_flash[:notice].to('Application settings saved successfully')
end
......
......@@ -56,49 +56,49 @@ describe Admin::ApplicationSettingsController do
it 'updates the password_authentication_enabled_for_git setting' do
put :update, params: { application_setting: { password_authentication_enabled_for_git: "0" } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.password_authentication_enabled_for_git).to eq(false)
end
it 'updates the default_project_visibility for string value' do
put :update, params: { application_setting: { default_project_visibility: "20" } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.default_project_visibility).to eq(Gitlab::VisibilityLevel::PUBLIC)
end
it 'update the restricted levels for string values' do
put :update, params: { application_setting: { restricted_visibility_levels: %w[10 20] } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.restricted_visibility_levels).to eq([10, 20])
end
it 'updates the restricted_visibility_levels when empty array is passed' do
put :update, params: { application_setting: { restricted_visibility_levels: [""] } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.restricted_visibility_levels).to be_empty
end
it 'updates the receive_max_input_size setting' do
put :update, params: { application_setting: { receive_max_input_size: "1024" } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.receive_max_input_size).to eq(1024)
end
it 'updates the default_project_creation for string value' do
put :update, params: { application_setting: { default_project_creation: ::Gitlab::Access::MAINTAINER_PROJECT_ACCESS } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.default_project_creation).to eq(::Gitlab::Access::MAINTAINER_PROJECT_ACCESS)
end
it 'updates minimum_password_length setting' do
put :update, params: { application_setting: { minimum_password_length: 10 } }
expect(response).to redirect_to(admin_application_settings_path)
expect(response).to redirect_to(general_admin_application_settings_path)
expect(ApplicationSetting.current.minimum_password_length).to eq(10)
end
......
......@@ -121,7 +121,7 @@ describe 'Admin disables Git access protocol', :js do
end
def switch_git_protocol(value)
visit admin_application_settings_path
visit general_admin_application_settings_path
page.within('.as-visibility-access') do
find('#application_setting_enabled_git_access_protocol').find(:xpath, "option[#{value}]").select_option
......
......@@ -37,7 +37,7 @@ describe 'Admin mode', :clean_gitlab_redis_shared_state, :do_not_mock_admin_mode
end
it 'is necessary to provide credentials again before opening pages in admin scope' do
visit admin_application_settings_path # admin logged out because not in admin_mode
visit general_admin_application_settings_path # admin logged out because not in admin_mode
expect(page).to have_current_path(new_admin_session_path)
end
......
......@@ -458,11 +458,11 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
sign_in(admin)
visit admin_application_settings_path
visit general_admin_application_settings_path
end
it 'loads admin settings page without redirect for reauthentication' do
expect(current_path).to eq admin_application_settings_path
expect(current_path).to eq general_admin_application_settings_path
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