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