Commit 63f9c8d8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dz-remove-profile-sidebar' into 'master'

Remove current user link to the profile from sidebar

Because user avatar and link to the profile are duplicated in the header now

Related to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4939 and https://gitlab.com/gitlab-org/gitlab-ce/issues/18544

cc @iamphill @jschatz1 

See merge request !5077
parents c20ab9f5 05e72272
...@@ -20,17 +20,6 @@ ...@@ -20,17 +20,6 @@
.sidebar-wrapper { .sidebar-wrapper {
background: $color-darker; background: $color-darker;
.sidebar-user {
background: $color-darker;
color: $color-light;
&:hover {
background-color: $color-dark;
color: $white-light;
text-decoration: none;
}
}
} }
.nav-sidebar li { .nav-sidebar li {
......
...@@ -40,32 +40,16 @@ ...@@ -40,32 +40,16 @@
} }
} }
.sidebar-user {
padding: 15px;
position: absolute;
left: 0;
bottom: 0;
width: $sidebar_width;
overflow: hidden;
font-size: 16px;
line-height: 36px;
transition: width $sidebar-transition-duration, padding $sidebar-transition-duration;
@media (min-width: $sidebar-breakpoint) {
bottom: 50px;
}
}
.nav-sidebar { .nav-sidebar {
position: absolute; position: absolute;
top: 50px; top: 50px;
bottom: 65px; bottom: 0;
width: $sidebar_width; width: $sidebar_width;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
@media (min-width: $sidebar-breakpoint) { @media (min-width: $sidebar-breakpoint) {
bottom: 115px; bottom: 50px;
} }
&.navbar-collapse { &.navbar-collapse {
......
...@@ -8,11 +8,6 @@ ...@@ -8,11 +8,6 @@
- else - else
= render 'layouts/nav/explore' = render 'layouts/nav/explore'
- if current_user
= link_to current_user, class: 'sidebar-user', title: "Profile", data: {user: current_user.username} do
= image_tag avatar_icon(current_user, 60), alt: 'Profile', class: 'avatar avatar s36'
.username
= current_user.username
= link_to '#', class: "nav-header-btn text-center pin-nav-btn has-tooltip #{'is-active' if pinned_nav?} js-nav-pin", title: pinned_nav? ? "Unpin navigation" : "Pin Navigation", data: {placement: 'right', container: 'body'} do = link_to '#', class: "nav-header-btn text-center pin-nav-btn has-tooltip #{'is-active' if pinned_nav?} js-nav-pin", title: pinned_nav? ? "Unpin navigation" : "Pin Navigation", data: {placement: 'right', container: 'body'} do
%span.sr-only Toggle navigation pinning %span.sr-only Toggle navigation pinning
= icon('thumb-tack') = icon('thumb-tack')
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
.dropdown-menu-nav.dropdown-menu-align-right .dropdown-menu-nav.dropdown-menu-align-right
%ul %ul
%li %li
= link_to "Profile", current_user = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username }
%li %li
= link_to "Profile Settings", profile_path = link_to "Profile Settings", profile_path
%li.divider %li.divider
......
...@@ -155,8 +155,11 @@ class Spinach::Features::Profile < Spinach::FeatureSteps ...@@ -155,8 +155,11 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end end
step 'I click on my profile picture' do step 'I click on my profile picture' do
find(:css, '.side-nav-toggle').click find(:css, '.header-user-dropdown-toggle').click
find(:css, '.sidebar-user').click
page.within ".header-user" do
click_link "Profile"
end
end end
step 'I should see my user page' do step 'I should see my user page' do
......
...@@ -144,9 +144,7 @@ describe "Admin::Users", feature: true do ...@@ -144,9 +144,7 @@ describe "Admin::Users", feature: true do
before { click_link 'Impersonate' } before { click_link 'Impersonate' }
it 'logs in as the user when impersonate is clicked' do it 'logs in as the user when impersonate is clicked' do
page.within '.sidebar-wrapper' do expect(page.find(:css, '.header-user .profile-link')['data-user']).to eql(another_user.username)
expect(page.find('.sidebar-user')['data-user']).to eql(another_user.username)
end
end end
it 'sees impersonation log out icon' do it 'sees impersonation log out icon' do
...@@ -158,9 +156,7 @@ describe "Admin::Users", feature: true do ...@@ -158,9 +156,7 @@ describe "Admin::Users", feature: true do
it 'can log out of impersonated user back to original user' do it 'can log out of impersonated user back to original user' do
find(:css, 'li.impersonation a').click find(:css, 'li.impersonation a').click
page.within '.sidebar-wrapper' do expect(page.find(:css, '.header-user .profile-link')['data-user']).to eql(@user.username)
expect(page.find('.sidebar-user')['data-user']).to eql(@user.username)
end
end end
it 'is redirected back to the impersonated users page in the admin after stopping' do it 'is redirected back to the impersonated users page in the admin after stopping' 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