Commit 18798332 authored by jplang's avatar jplang

The cancel operation in the issue edit mode doesn't work (#21579).

Patch by Marius BALTEANU.

git-svn-id: https://svn.redmine.org/redmine/trunk@16361 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 566015e5
......@@ -69,7 +69,7 @@
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
<%= submit_tag l(:button_submit) %>
<%= preview_link preview_edit_issue_path(:project_id => @project, :id => @issue), 'issue-form' %>
| <%= link_to l(:button_cancel), {}, :onclick => "$('#update').hide(); return false;" %>
| <%= link_to l(:button_cancel), issue_path(id: @issue.id), :onclick => params[:action] == 'show' ? "$('#update').hide(); return false;" : '' %>
<%= hidden_field_tag 'prev_issue_id', @prev_issue_id if @prev_issue_id %>
<%= hidden_field_tag 'next_issue_id', @next_issue_id if @next_issue_id %>
......
......@@ -4852,4 +4852,20 @@ class IssuesControllerTest < Redmine::ControllerTest
User.add_to_project(user, Project.find(2), Role.find_by_name('Manager'))
user
end
def test_cancel_edit_link_for_issue_show_action_should_have_onclick_action
@request.session[:user_id] = 1
get :show, :id => 1
assert_response :success
assert_select 'a[href=?][onclick=?]', "/issues/1", "$('#update').hide(); return false;", :text => 'Cancel'
end
def test_cancel_edit_link_for_issue_edit_action_should_not_have_onclick_action
@request.session[:user_id] = 1
get :edit, :id => 1
assert_response :success
assert_select 'a[href=?][onclick=?]', "/issues/1", "", :text => 'Cancel'
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment