Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-09-29 11:46:05 +0300
committerPhil Hughes <me@iamphill.com>2017-11-01 17:08:21 +0300
commitb65bd3f3e8375720f78ad63123f49012d6e83d41 (patch)
tree7f0bec95e3c41c43c97a3186daec18e3aefa0afe
parent8ebd2dd93d0b01a60bcbd5cefce0fb049cee2ee6 (diff)
Stable port of breadcrumb-item-links
-rw-r--r--app/helpers/breadcrumbs_helper.rb6
-rw-r--r--app/views/layouts/nav/_breadcrumbs.html.haml2
-rw-r--r--changelogs/unreleased/breadcrumb-item-links.yml5
-rw-r--r--spec/features/issues_spec.rb8
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 5c284a1fe5f..b08cd7ea9fd 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)