Merge branch 'breadcrumb-item-links' into 'master'

Fixed breadcrumb title not linking

Closes #38059

See merge request gitlab-org/gitlab-ce!14532
This commit is contained in:
Tim Zallmann 2017-09-29 08:46:05 +00:00
commit 0addef2e57
6 changed files with 18 additions and 9 deletions

View File

@ -10,11 +10,7 @@ module BreadcrumbsHelper
def breadcrumb_title_link
return @breadcrumb_link if @breadcrumb_link
if controller.available_action?(:index)
url_for(action: "index")
else
request.path
end
request.path
end
def breadcrumb_title(title)

View File

@ -16,5 +16,5 @@
= breadcrumb_list_item link_to(extra[:text], extra[:link])
= render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after
%li
%h2.breadcrumbs-sub-title= @breadcrumb_title
%h2.breadcrumbs-sub-title= link_to @breadcrumb_title, breadcrumb_title_link
= yield :header_content

View File

@ -0,0 +1,5 @@
---
title: Fixed issue/merge request breadcrumb titles not having links
merge_request:
author:
type: fixed

View File

@ -131,6 +131,14 @@ describe 'Issues' do
end
describe 'Issue info' do
it 'links to current issue in breadcrubs' do
issue = create(:issue, project: project)
visit project_issue_path(project, issue)
expect(find('.breadcrumbs-sub-title a')[:href]).to end_with(issue_path(issue))
end
it 'excludes award_emoji from comment count' do
issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar')
create(:award_emoji, awardable: issue)

View File

@ -40,7 +40,7 @@ describe 'User updates wiki page' do
expect(current_path).to include('one/two/three-test')
expect(find('.wiki-pages')).to have_content('Three')
click_on('Three')
first(:link, text: 'Three').click
expect(find('.nav-text')).to have_content('Three')

View File

@ -34,7 +34,7 @@ describe 'User views a wiki page' do
it 'shows the history of a page that has a path', :js do
expect(current_path).to include('one/two/three-test')
click_on('Three')
first(:link, text: 'Three').click
click_on('Page history')
expect(current_path).to include('one/two/three-test')
@ -48,7 +48,7 @@ describe 'User views a wiki page' do
expect(current_path).to include('one/two/three-test')
expect(find('.wiki-pages')).to have_content('Three')
click_on('Three')
first(:link, text: 'Three').click
expect(find('.nav-text')).to have_content('Three')