Commit 11110e6c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '8380-geo-settings-empty-state' into 'master'

Geo: Add settings page empty state

Closes #8380

See merge request gitlab-org/gitlab-ee!9415
parents de9b9c9d a6d171f3
- return unless Gitlab::Geo.license_allows? - if Gitlab::Geo.license_allows?
%section.settings.as-geo.no-animate#js-geo-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('GitLab Geo')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
= _('Geo allows you to replicate your GitLab instance to other geographical locations.')
.settings-content
%section.settings.as-geo.no-animate#js-geo-settings{ class: ('expanded' if expanded) } = form_for @application_setting, url: admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f|
.settings-header = form_errors(@application_setting)
%h4
= _('GitLab Geo')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
= _('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| %fieldset
= form_errors(@application_setting) %p
These settings will only take effect if Geo is enabled and require a restart to take effect.
.form-group
= f.label :geo_status_timeout, 'Connection timeout', class: 'label-bold'
= f.number_field :geo_status_timeout, class: 'form-control'
.form-text.text-muted
The amount of seconds after which a request to get a secondary node
status will time out.
%fieldset = f.submit 'Save changes', class: "btn btn-success"
%p - else
These settings will only take effect if Geo is enabled and require a restart to take effect. = render 'shared/empty_states/geo'
.form-group
= f.label :geo_status_timeout, 'Connection timeout', class: 'label-bold'
= f.number_field :geo_status_timeout, class: 'form-control'
.form-text.text-muted
The amount of seconds after which a request to get a secondary node
status will time out.
= f.submit 'Save changes', class: "btn btn-success"
---
title: "Geo: Add settings page empty state"
merge_request: 9415
author:
type: changed
...@@ -9,15 +9,29 @@ describe 'Admin updates EE-only settings' do ...@@ -9,15 +9,29 @@ describe 'Admin updates EE-only settings' do
allow(License).to receive(:feature_available?).and_return(true) allow(License).to receive(:feature_available?).and_return(true)
end end
it 'Modify GitLab Geo settings' do context 'Geo settings' do
visit geo_admin_application_settings_path context 'when the license has Geo feature' do
page.within('.as-geo') do it 'allows users to change Geo settings' do
fill_in 'Connection timeout', with: 15 visit geo_admin_application_settings_path
click_button 'Save changes' page.within('.as-geo') do
fill_in 'Connection timeout', with: 15
click_button 'Save changes'
end
expect(Gitlab::CurrentSettings.geo_status_timeout).to eq(15)
expect(page).to have_content "Application settings saved successfully"
end
end end
expect(Gitlab::CurrentSettings.geo_status_timeout).to eq(15) context 'when the license does not have Geo feature' do
expect(page).to have_content "Application settings saved successfully" it 'shows empty page' do
allow(License).to receive(:feature_available?).and_return(false)
visit geo_admin_application_settings_path
expect(page).to have_content "Discover GitLab Geo"
end
end
end end
it 'Enable external authentication' do it 'Enable external authentication' do
......
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