Commit 05844d8b authored by Phil Hughes's avatar Phil Hughes

Fixed breadcrumb title not linking

This fixes the breadcrumb titles not having links. This was a regression
in the updated breadcrumbs introduced in 10.0.

This introduces the link for all pages rather than selectively doing it.
This will cover issues, merge requests, pipelines, jobs etc.

Closes #38059
parent aaf435d1
...@@ -10,12 +10,8 @@ module BreadcrumbsHelper ...@@ -10,12 +10,8 @@ module BreadcrumbsHelper
def breadcrumb_title_link def breadcrumb_title_link
return @breadcrumb_link if @breadcrumb_link return @breadcrumb_link if @breadcrumb_link
if controller.available_action?(:index)
url_for(action: "index")
else
request.path request.path
end end
end
def breadcrumb_title(title) def breadcrumb_title(title)
return if defined?(@breadcrumb_title) return if defined?(@breadcrumb_title)
......
...@@ -16,5 +16,5 @@ ...@@ -16,5 +16,5 @@
= breadcrumb_list_item link_to(extra[:text], extra[:link]) = breadcrumb_list_item link_to(extra[:text], extra[:link])
= render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after = render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after
%li %li
%h2.breadcrumbs-sub-title= @breadcrumb_title %h2.breadcrumbs-sub-title= link_to @breadcrumb_title, breadcrumb_title_link
= yield :header_content = yield :header_content
---
title: Fixed issue/merge request breadcrumb titles not having links
merge_request:
author:
type: fixed
...@@ -131,6 +131,14 @@ describe 'Issues' do ...@@ -131,6 +131,14 @@ describe 'Issues' do
end end
describe 'Issue info' do 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 it 'excludes award_emoji from comment count' do
issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar') issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar')
create(:award_emoji, awardable: issue) create(:award_emoji, awardable: issue)
......
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