summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-03-30 06:23:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-03-30 06:23:52 +0000
commitb46741f7fcf7002d30ea5fba43d3068fb627271c (patch)
tree90e4b579d0dab552ead0d7b2f97749ff1dc4472c
parent56742e65deffd32a80b0ad84721ced2079e6e28b (diff)
downloadredmine-b46741f7fcf7002d30ea5fba43d3068fb627271c.tar.gz
redmine-b46741f7fcf7002d30ea5fba43d3068fb627271c.zip
Let user select a tracker from the modal (#442).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18016 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/issues/_trackers_description.html.erb11
-rw-r--r--test/system/issues_test.rb15
2 files changed, 25 insertions, 1 deletions
diff --git a/app/views/issues/_trackers_description.html.erb b/app/views/issues/_trackers_description.html.erb
index 63c361983..a02114123 100644
--- a/app/views/issues/_trackers_description.html.erb
+++ b/app/views/issues/_trackers_description.html.erb
@@ -4,10 +4,19 @@
<dl>
<% trackers.each do |tracker| %>
<% if tracker.description.present? %>
- <dt><%= tracker.name %></dt>
+ <dt><%= content_tag 'a', tracker.name, :onclick => "selectTracker('#{tracker.id}'); return false;", :href => '#', :title => l(:text_select_apply_tracker) %></dt>
<dd><%= tracker.description %></dd>
<% end %>
<% end %>
</dl>
</div>
<% 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/system/issues_test.rb b/test/system/issues_test.rb
index b47e22eef..849fe2b31 100644
--- a/test/system/issues_test.rb
+++ b/test/system/issues_test.rb
@@ -340,4 +340,19 @@ class IssuesTest < ApplicationSystemTestCase
subjects = csv.map {|row| row[subject_index]}
assert_equal subjects.sort, subjects
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