mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 15:26:03 +01:00
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
This commit is contained in:
@@ -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 %>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user