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) }
.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
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
= form_for @application_setting, url: admin_application_settings_path(anchor: 'js-geo-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
%fieldset
%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
%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.
= f.submit 'Save changes', class: "btn btn-success"
= f.submit 'Save changes', class: "btn btn-success"
- else
= render 'shared/empty_states/geo'
---
title: "Geo: Add settings page empty state"
merge_request: 9415
author:
type: changed
......@@ -9,15 +9,29 @@ describe 'Admin updates EE-only settings' do
allow(License).to receive(:feature_available?).and_return(true)
end
it 'Modify GitLab Geo settings' do
visit geo_admin_application_settings_path
page.within('.as-geo') do
fill_in 'Connection timeout', with: 15
click_button 'Save changes'
context 'Geo settings' do
context 'when the license has Geo feature' do
it 'allows users to change Geo settings' do
visit geo_admin_application_settings_path
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
expect(Gitlab::CurrentSettings.geo_status_timeout).to eq(15)
expect(page).to have_content "Application settings saved successfully"
context 'when the license does not have Geo feature' do
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
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