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
42831148
Commit
42831148
authored
Jan 21, 2020
by
Diego Louzán
Committed by
Imre Farkas
Jan 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix method in dashboard link for disabling admin mode
The link for bigger screen sizes has incorrectly GET as method
parent
28cfea36
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
app/views/layouts/nav/_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+1
-1
changelogs/unreleased/fix-disable-admin-mode-link-in-dashboard.yml
...s/unreleased/fix-disable-admin-mode-link-in-dashboard.yml
+5
-0
spec/features/admin/admin_settings_spec.rb
spec/features/admin/admin_settings_spec.rb
+18
-4
No files found.
app/views/layouts/nav/_dashboard.html.haml
View file @
42831148
...
...
@@ -76,7 +76,7 @@
-
if
Feature
.
enabled?
(
:user_mode_in_session
)
-
if
header_link?
(
:admin_mode
)
=
nav_link
(
controller:
'admin/sessions'
,
html_options:
{
class:
"d-none d-lg-block d-xl-block"
})
do
=
link_to
destroy_admin_session_path
,
title:
_
(
'Leave Admin Mode'
),
aria:
{
label:
_
(
'Leave Admin Mode'
)
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
link_to
destroy_admin_session_path
,
method: :post
,
title:
_
(
'Leave Admin Mode'
),
aria:
{
label:
_
(
'Leave Admin Mode'
)
},
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
sprite_icon
(
'lock-open'
,
size:
18
)
-
elsif
current_user
.
admin?
=
nav_link
(
controller:
'admin/sessions'
,
html_options:
{
class:
"d-none d-lg-block d-xl-block"
})
do
...
...
changelogs/unreleased/fix-disable-admin-mode-link-in-dashboard.yml
0 → 100644
View file @
42831148
---
title
:
Fix POST method in dashboard link for disabling admin mode
merge_request
:
23363
author
:
Diego Louzán
type
:
fixed
spec/features/admin/admin_settings_spec.rb
View file @
42831148
...
...
@@ -9,7 +9,7 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc
let
(
:admin
)
{
create
(
:admin
)
}
context
'feature flag :user_mode_in_session is enabled'
do
context
'feature flag :user_mode_in_session is enabled'
,
:request_store
do
before
do
stub_env
(
'IN_MEMORY_APPLICATION_SETTINGS'
,
'false'
)
sign_in
(
admin
)
...
...
@@ -486,10 +486,24 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc
end
end
it
'can leave admin mode
'
do
it
'can leave admin mode
using main dashboard link'
,
:js
do
page
.
within
(
'.navbar-sub-nav'
)
do
# Select first, link is also included in mobile view list
click_on
'Leave Admin Mode'
,
match: :first
click_on
'Leave Admin Mode'
expect
(
page
).
to
have_link
(
href:
new_admin_session_path
)
end
end
it
'can leave admin mode using dropdown menu on smaller screens'
,
:js
do
resize_screen_xs
visit
root_dashboard_path
find
(
'.header-more'
).
click
page
.
within
'.navbar-sub-nav'
do
click_on
'Leave Admin Mode'
find
(
'.header-more'
).
click
expect
(
page
).
to
have_link
(
href:
new_admin_session_path
)
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