diff options
author | Phil Hughes <me@iamphill.com> | 2017-09-27 18:22:12 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-27 19:06:24 +0300 |
commit | 05844d8b471b98c6b3251006aebfc78b97d88ac6 (patch) | |
tree | 1995c5b93710725dba9fd9d882aaaa239334cfa6 | |
parent | aaf435d16435bf3fbcfc2ab80071485ddb6bcf01 (diff) |
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
-rw-r--r-- | app/helpers/breadcrumbs_helper.rb | 6 | ||||
-rw-r--r-- | app/views/layouts/nav/_breadcrumbs.html.haml | 2 | ||||
-rw-r--r-- | changelogs/unreleased/breadcrumb-item-links.yml | 5 | ||||
-rw-r--r-- | spec/features/issues_spec.rb | 8 |
4 files changed, 15 insertions, 6 deletions
diff --git a/app/helpers/breadcrumbs_helper.rb b/app/helpers/breadcrumbs_helper.rb index ee1b7ed083e..87d2a47f6cb 100644 --- a/app/helpers/breadcrumbs_helper.rb +++ b/app/helpers/breadcrumbs_helper.rb @@ -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) diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index 7bd3f5306a2..002922e13f1 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -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 diff --git a/changelogs/unreleased/breadcrumb-item-links.yml b/changelogs/unreleased/breadcrumb-item-links.yml new file mode 100644 index 00000000000..9b66456efca --- /dev/null +++ b/changelogs/unreleased/breadcrumb-item-links.yml @@ -0,0 +1,5 @@ +--- +title: Fixed issue/merge request breadcrumb titles not having links +merge_request: +author: +type: fixed diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index fb763c93c66..b4222edbcd0 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -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) |