Commit 11472efd authored by Fatih Acet's avatar Fatih Acet

Merge branch '12307-errors-in-application-settings-geo-panel-shows-wrong-panel' into 'master'

Validation errors in application settings, such as Geo panel, shows wrong panel

See merge request gitlab-org/gitlab!14374
parents 72b234ba e976234d
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= _('Configure the %{link} integration.').html_safe % { link: link_to('Snowplow', 'https://snowplowanalytics.com/', target: '_blank') } = _('Configure the %{link} integration.').html_safe % { link: link_to('Snowplow', 'https://snowplowanalytics.com/', target: '_blank') }
.settings-content .settings-content
= form_for @application_setting, url: integrations_admin_application_settings_path, html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: integrations_admin_application_settings_path(anchor: 'js-snowplow-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= _('Select the custom project template source group.') = _('Select the custom project template source group.')
.settings-content .settings-content
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-custom-project-templates-settings') do |f| = form_for @application_setting, url: templates_admin_application_settings_path(anchor: 'js-custom-project-templates-settings') do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
= _('Elasticsearch integration. Elasticsearch AWS IAM.') = _('Elasticsearch integration. Elasticsearch AWS IAM.')
.settings-content .settings-content
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-elasticsearch-settings'), html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: integrations_admin_application_settings_path(anchor: 'js-elasticsearch-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= _('Geo allows you to replicate your GitLab instance to other geographical locations.') = _('Geo allows you to replicate your GitLab instance to other geographical locations.')
.settings-content .settings-content
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: geo_admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-pseudonymizer-settings'), html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: metrics_and_profiling_admin_application_settings_path(anchor: 'js-pseudonymizer-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
%p %p
- instance_link_start = '<a href="%{url}">'.html_safe % { url: help_page_path('user/admin_area/settings/instance_template_repository') } - instance_link_start = '<a href="%{url}">'.html_safe % { url: help_page_path('user/admin_area/settings/instance_template_repository') }
= s_('AdminSettings|The required pipeline configuration can be selected from the %{code_start}gitlab-ci%{code_end} directory inside of the configured %{link_start}instance template repository%{link_end} or from GitLab provided configurations.').html_safe % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe, link_start: instance_link_start, link_end: '</a>'.html_safe } = s_('AdminSettings|The required pipeline configuration can be selected from the %{code_start}gitlab-ci%{code_end} directory inside of the configured %{link_start}instance template repository%{link_end} or from GitLab provided configurations.').html_safe % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe, link_start: instance_link_start, link_end: '</a>'.html_safe }
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-required-pipeline-settings'), html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: ci_cd_admin_application_settings_path(anchor: 'js-required-pipeline-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
= _('Slack integration allows you to interact with GitLab via slash commands in a chat window.') = _('Slack integration allows you to interact with GitLab via slash commands in a chat window.')
.settings-content .settings-content
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-slack-settings'), html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: integrations_admin_application_settings_path(anchor: 'js-slack-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
%p %p
= _('Set instance-wide template repository') = _('Set instance-wide template repository')
.settings-content .settings-content
= form_for @application_setting, url: admin_application_settings_path, html: { class: 'fieldset-form' } do |f| = form_for @application_setting, url: templates_admin_application_settings_path, html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting) = form_errors(@application_setting)
%fieldset %fieldset
......
---
title: Admin settings errors now shown in the correct panel
merge_request: 14374
author:
type: fixed
...@@ -132,5 +132,13 @@ describe Admin::ApplicationSettingsController do ...@@ -132,5 +132,13 @@ describe Admin::ApplicationSettingsController do
expect(response).to render_template(:general) expect(response).to render_template(:general)
expect(assigns(:application_setting).errors[:repository_size_limit]).to be_present expect(assigns(:application_setting).errors[:repository_size_limit]).to be_present
end end
describe 'verify panel actions' do
%w[templates geo].each do |valid_action|
it_behaves_like 'renders correct panels' do
let(:action) { valid_action }
end
end
end
end end
end end
...@@ -38,8 +38,8 @@ describe 'Admin updates EE-only settings' do ...@@ -38,8 +38,8 @@ describe 'Admin updates EE-only settings' do
end end
end end
it 'Enable external authentication' do it 'Enables external authentication' do
visit admin_application_settings_path visit general_admin_application_settings_path
page.within('.as-external-auth') do page.within('.as-external-auth') do
check 'Enable classification control using an external service' check 'Enable classification control using an external service'
fill_in 'Default classification label', with: 'default' fill_in 'Default classification label', with: 'default'
...@@ -183,11 +183,16 @@ describe 'Admin updates EE-only settings' do ...@@ -183,11 +183,16 @@ describe 'Admin updates EE-only settings' do
end end
describe 'LDAP settings' do describe 'LDAP settings' do
before do
allow(Gitlab::Auth::LDAP::Config).to receive(:enabled?).and_return(ldap_setting)
visit general_admin_application_settings_path
end
context 'with LDAP enabled' do context 'with LDAP enabled' do
it 'Change allow group owners to manage ldap' do let(:ldap_setting) { true }
allow(Gitlab::Auth::LDAP::Config).to receive(:enabled?).and_return(true)
visit admin_application_settings_path
it 'Changes to allow group owners to manage ldap' do
page.within('.as-visibility-access') do page.within('.as-visibility-access') do
find('#application_setting_allow_group_owners_to_manage_ldap').set(false) find('#application_setting_allow_group_owners_to_manage_ldap').set(false)
click_button 'Save' click_button 'Save'
...@@ -199,9 +204,9 @@ describe 'Admin updates EE-only settings' do ...@@ -199,9 +204,9 @@ describe 'Admin updates EE-only settings' do
end end
context 'with LDAP disabled' do context 'with LDAP disabled' do
it 'Does not show option to allow group owners to manage ldap' do let(:ldap_setting) { false }
visit admin_application_settings_path
it 'Does not show option to allow group owners to manage ldap' do
expect(page).not_to have_css('#application_setting_allow_group_owners_to_manage_ldap') expect(page).not_to have_css('#application_setting_allow_group_owners_to_manage_ldap')
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