Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a6d171f3
Commit
a6d171f3
authored
Feb 04, 2019
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Add settings page empty state
parent
4a93250b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
30 deletions
+50
-30
ee/app/views/admin/application_settings/_geo.html.haml
ee/app/views/admin/application_settings/_geo.html.haml
+24
-23
ee/changelogs/unreleased/8380-geo-settings-empty-state.yml
ee/changelogs/unreleased/8380-geo-settings-empty-state.yml
+5
-0
ee/spec/features/admin/admin_settings_spec.rb
ee/spec/features/admin/admin_settings_spec.rb
+21
-7
No files found.
ee/app/views/admin/application_settings/_geo.html.haml
View file @
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'
ee/changelogs/unreleased/8380-geo-settings-empty-state.yml
0 → 100644
View file @
a6d171f3
---
title
:
"
Geo:
Add
settings
page
empty
state"
merge_request
:
9415
author
:
type
:
changed
ee/spec/features/admin/admin_settings_spec.rb
View file @
a6d171f3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment