diff --git a/app/views/issues/_trackers_description.html.erb b/app/views/issues/_trackers_description.html.erb index 63c3619..a021141 100755 --- a/app/views/issues/_trackers_description.html.erb +++ b/app/views/issues/_trackers_description.html.erb @@ -4,10 +4,19 @@
<% trackers.each do |tracker| %> <% if tracker.description.present? %> -
<%= tracker.name %>
+
<%= content_tag 'a', tracker.name, :onclick => "selectTracker('#{tracker.id}'); return false;", :href => '#', :title => l(:text_select_apply_tracker) %>
<%= tracker.description %>
<% end %> <% end %>
<% end %> +<%= javascript_tag do %> + function selectTracker(id) { + var target = $('#issue_tracker_id'); + target.attr("selected", false); + target.find('option[value="' + id + '"]').prop('selected', true); + target.trigger('change'); + hideModal('#trackers_description h3'); + } +<% end %> diff --git a/test/ui/issues_test_ui.rb b/test/ui/issues_test_ui.rb old mode 100644 new mode 100755 index c073917..1222437 --- a/test/ui/issues_test_ui.rb +++ b/test/ui/issues_test_ui.rb @@ -49,7 +49,7 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base # check issue attributes assert_equal 'jsmith', issue.author.login assert_equal 1, issue.project.id - assert_equal IssueStatus.find_by_name('New'), issue.status + assert_equal IssueStatus.find_by_name('New'), issue.status assert_equal Tracker.find_by_name('Bug'), issue.tracker assert_equal IssuePriority.find_by_name('Low'), issue.priority assert_equal 'Value for field 2', issue.custom_field_value(CustomField.find_by_name('Searchable field')) @@ -298,9 +298,9 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base # Check that the page shows the Estimated hours total assert page.has_css?('p.query-totals') assert page.has_css?('span.total-for-estimated-hours') - # Open the Options of the form (necessary for having the totalable columns options clickable) + # Open the Options of the form (necessary for having the totalable columns options clickable) page.all('legend')[1].click - # Deselect the default totalable column (none should be left) + # Deselect the default totalable column (none should be left) page.first('input[name="t[]"][value="estimated_hours"]').click within('#query_form') do click_link 'Apply' @@ -332,4 +332,19 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base sleep 1 assert_equal 'Updated notes', Journal.find(2).notes end + + def test_issue_trackers_description_should_select_tracker + log_user('admin', 'admin') + + visit '/issues/1' + page.first(:link, 'Edit').click + page.click_link('View all trackers description') + assert page.has_css?('#trackers_description') + within('#trackers_description') do + click_link('Feature') + end + + assert !page.has_css?('#trackers_description') + assert_equal "2", page.find('select#issue_tracker_id').value + end end