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 @@
= _('Configure the %{link} integration.').html_safe % { link: link_to('Snowplow', 'https://snowplowanalytics.com/', target: '_blank') }
.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)
%fieldset
......
......@@ -9,7 +9,7 @@
= _('Select the custom project template source group.')
.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)
%fieldset
......
......@@ -14,7 +14,7 @@
= _('Elasticsearch integration. Elasticsearch AWS IAM.')
.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)
%fieldset
......
......@@ -9,7 +9,7 @@
= _('Geo allows you to replicate your GitLab instance to other geographical locations.')
.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)
%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)
%fieldset
......
......@@ -13,7 +13,7 @@
%p
- 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 }
= 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)
%fieldset
......
......@@ -10,7 +10,7 @@
= _('Slack integration allows you to interact with GitLab via slash commands in a chat window.')
.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)
%fieldset
......
......@@ -8,7 +8,7 @@
%p
= _('Set instance-wide template repository')
.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)
%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
expect(response).to render_template(:general)
expect(assigns(:application_setting).errors[:repository_size_limit]).to be_present
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
......@@ -38,8 +38,8 @@ describe 'Admin updates EE-only settings' do
end
end
it 'Enable external authentication' do
visit admin_application_settings_path
it 'Enables external authentication' do
visit general_admin_application_settings_path
page.within('.as-external-auth') do
check 'Enable classification control using an external service'
fill_in 'Default classification label', with: 'default'
......@@ -183,11 +183,16 @@ describe 'Admin updates EE-only settings' do
end
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
it 'Change allow group owners to manage ldap' do
allow(Gitlab::Auth::LDAP::Config).to receive(:enabled?).and_return(true)
visit admin_application_settings_path
let(:ldap_setting) { true }
it 'Changes to allow group owners to manage ldap' do
page.within('.as-visibility-access') do
find('#application_setting_allow_group_owners_to_manage_ldap').set(false)
click_button 'Save'
......@@ -199,9 +204,9 @@ describe 'Admin updates EE-only settings' do
end
context 'with LDAP disabled' do
it 'Does not show option to allow group owners to manage ldap' do
visit admin_application_settings_path
let(:ldap_setting) { false }
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')
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