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
437b42c1
Commit
437b42c1
authored
Nov 07, 2017
by
Tim Zallmann
Committed by
Nick Thomas
Nov 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Geo secondary help users not waste time on impossible operations."
parent
bff9e896
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
5 deletions
+41
-5
app/controllers/oauth/geo_auth_controller.rb
app/controllers/oauth/geo_auth_controller.rb
+0
-5
app/views/layouts/_page.html.haml
app/views/layouts/_page.html.haml
+1
-0
changelogs/unreleased-ee/2524-geo-secondary-help-users-not-waste-time-on-impossible-operations.yml
...ry-help-users-not-waste-time-on-impossible-operations.yml
+5
-0
ee/app/views/layouts/header/ee/_geo_secondary_banner.html.haml
...p/views/layouts/header/ee/_geo_secondary_banner.html.haml
+6
-0
spec/ee/spec/features/geo_node_spec.rb
spec/ee/spec/features/geo_node_spec.rb
+29
-0
No files found.
app/controllers/oauth/geo_auth_controller.rb
View file @
437b42c1
...
...
@@ -45,11 +45,6 @@ class Oauth::GeoAuthController < ActionController::Base
private
def
after_sign_in_with_gitlab
(
token
,
return_to
)
if
Gitlab
::
Geo
.
primary_node
primary_node
=
view_context
.
link_to
(
'primary node'
,
Gitlab
::
Geo
.
primary_node
.
url
)
flash
[
:notice
]
=
"You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the
#{
primary_node
}
."
.
html_safe
end
session
[
:access_token
]
=
token
redirect_to
(
return_to
||
root_path
)
end
...
...
app/views/layouts/_page.html.haml
View file @
437b42c1
...
...
@@ -6,6 +6,7 @@
.alert-wrapper
=
render
"layouts/header/ee_license_banner"
=
render
"layouts/broadcast"
=
render
'layouts/header/ee/geo_secondary_banner'
=
yield
:flash_message
-
unless
@hide_breadcrumbs
=
render
"layouts/nav/breadcrumbs"
...
...
changelogs/unreleased-ee/2524-geo-secondary-help-users-not-waste-time-on-impossible-operations.yml
0 → 100644
View file @
437b42c1
---
title
:
On Secondary read-only Geo Nodes now a flash banner is shown on all pages
merge_request
:
3260
author
:
type
:
added
ee/app/views/layouts/header/ee/_geo_secondary_banner.html.haml
0 → 100644
View file @
437b42c1
-
if
::
Gitlab
::
Geo
.
secondary?
&&
::
Gitlab
::
Geo
.
primary_node
-
primary_node
=
link_to
(
'primary node'
,
::
Gitlab
::
Geo
.
primary_node
.
url
)
.flash-container.flash-container-page
.flash-notice
%div
{
class:
(
container_class
)
}
%span
You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the
#{
primary_node
}
.
spec/ee/spec/features/geo_node_spec.rb
0 → 100644
View file @
437b42c1
require
'spec_helper'
feature
'GEO Nodes'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:geo_url
)
{
'http://geo.example.com'
}
context
'Geo Secondary Node'
do
before
do
allow
(
Gitlab
::
Geo
).
to
receive
(
:secondary?
)
{
true
}
allow
(
Gitlab
::
Geo
).
to
receive_message_chain
(
:primary_node
,
:url
)
{
geo_url
}
project
.
add_master
(
user
)
sign_in
(
user
)
end
describe
"showing Flash Info Message"
do
it
'on dashboard'
do
visit
root_dashboard_path
expect
(
page
).
to
have_content
'You are on a secondary (read-only) Geo node.'
end
it
'on project overview'
do
visit
project_path
(
project
)
expect
(
page
).
to
have_content
'You are on a secondary (read-only) Geo node.'
end
end
end
end
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