From bf52bac671fded9d979cab56e6935f1bb64e8895 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Tue, 21 Aug 2018 21:41:36 +0000 Subject: [PATCH] Render category in issue page as a link to all open issues with the same category --- app/views/issues/show.html.erb | 2 +- test/functional/issues_controller_test.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 97a2448..63b948d 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -49,7 +49,7 @@ rows.left l(:field_assigned_to), (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to' end unless @issue.disabled_core_fields.include?('category_id') || (@issue.category.nil? && @issue.project.issue_categories.none?) - rows.left l(:field_category), (@issue.category ? @issue.category.name : "-"), :class => 'category' + rows.left l(:field_category), (@issue.category ? (link_to(@issue.category.name, project_issues_path(@issue.project, :status_id => 'o', :category_id => @issue.category.id, :set_filter => 1))) : "-"), :class => 'category' end unless @issue.disabled_core_fields.include?('fixed_version_id') || (@issue.fixed_version.nil? && @issue.assignable_versions.none?) rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version' diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 35c5053..992c8d1 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2009,6 +2009,15 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'table.attributes .category', 0 end + def test_show_should_display_category_as_link + get :show, :params => { + :id => 1 + } + + assert_response :success + assert_select '.attributes .category .value a[href=?]', '/projects/ecookbook/issues?category_id=1&set_filter=1&status_id=o', :text => "Printing" + end + def test_show_should_display_link_to_the_assignee get :show, :params => { :id => 2 -- 2.1.4