mirror of
				https://github.com/redmine/redmine.git
				synced 2025-10-31 02:15:52 +01:00 
			
		
		
		
	Adds button to "Create and follow" when adding a subtask from the parent issue. Now the user have the following options:
* Create: redirects the user to the parent task (existing behaviour) * Create and follow: redirects the user to the newly created subtask (new behaviour) * Create and add another: redirects the user to new subtask (existing behaviour). (#29076). git-svn-id: http://svn.redmine.org/redmine/trunk@21269 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
		| @@ -701,6 +701,8 @@ class IssuesController < ApplicationController | |||||||
|         url_params[:issue][:project_id] = @issue.project_id |         url_params[:issue][:project_id] = @issue.project_id | ||||||
|         redirect_to new_issue_path(url_params) |         redirect_to new_issue_path(url_params) | ||||||
|       end |       end | ||||||
|  |     elsif params[:follow] | ||||||
|  |       redirect_to issue_path(@issue) | ||||||
|     else |     else | ||||||
|       redirect_back_or_default issue_path(@issue) |       redirect_back_or_default issue_path(@issue) | ||||||
|     end |     end | ||||||
|   | |||||||
| @@ -38,6 +38,9 @@ | |||||||
|   </div> |   </div> | ||||||
|  |  | ||||||
|   <%= submit_tag l(:button_create) %> |   <%= submit_tag l(:button_create) %> | ||||||
|  |   <% if params[:back_url] && params[:issue] && params[:issue][:parent_issue_id] %> | ||||||
|  |     <%= submit_tag l(:button_create_and_follow), name: 'follow' %> | ||||||
|  |   <% end %> | ||||||
|   <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> |   <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> | ||||||
| <% end %> | <% end %> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1186,6 +1186,7 @@ en: | |||||||
|   button_save_object: "Save %{object_name}" |   button_save_object: "Save %{object_name}" | ||||||
|   button_edit_object: "Edit %{object_name}" |   button_edit_object: "Edit %{object_name}" | ||||||
|   button_delete_object: "Delete %{object_name}" |   button_delete_object: "Delete %{object_name}" | ||||||
|  |   button_create_and_follow: Create and follow | ||||||
|  |  | ||||||
|   status_active: active |   status_active: active | ||||||
|   status_registered: registered |   status_registered: registered | ||||||
|   | |||||||
| @@ -3212,6 +3212,11 @@ class IssuesControllerTest < Redmine::ControllerTest | |||||||
|       assert_select 'select[name=?]', 'issue[done_ratio]' |       assert_select 'select[name=?]', 'issue[done_ratio]' | ||||||
|       assert_select 'input[name=?][value=?]', 'issue[custom_field_values][2]', 'Default string' |       assert_select 'input[name=?][value=?]', 'issue[custom_field_values][2]', 'Default string' | ||||||
|       assert_select 'input[name=?]', 'issue[watcher_user_ids][]' |       assert_select 'input[name=?]', 'issue[watcher_user_ids][]' | ||||||
|  |  | ||||||
|  |       # Assert submit buttons | ||||||
|  |       assert_select 'input[type=submit][name=?]', 'commit' | ||||||
|  |       assert_select 'input[type=submit][name=?]', 'continue' | ||||||
|  |       assert_select 'input[type=submit][name=?]', 'follow', 0 | ||||||
|     end |     end | ||||||
|  |  | ||||||
|     # Be sure we don't display inactive IssuePriorities |     # Be sure we don't display inactive IssuePriorities | ||||||
| @@ -3824,6 +3829,25 @@ class IssuesControllerTest < Redmine::ControllerTest | |||||||
|     assert_select 'div#trackers_description', 0 |     assert_select 'div#trackers_description', 0 | ||||||
|   end |   end | ||||||
|  |  | ||||||
|  |   def test_get_new_should_show_create_and_follow_button_when_issue_is_subtask_and_back_urL_is_present | ||||||
|  |     @request.session[:user_id] = 2 | ||||||
|  |     get :new, params: { | ||||||
|  |       project_id: 1, | ||||||
|  |       issue: { | ||||||
|  |         parent_issue_id: 2 | ||||||
|  |       }, | ||||||
|  |       back_url: "/issues/2" | ||||||
|  |     } | ||||||
|  |     assert_response :success | ||||||
|  |  | ||||||
|  |     assert_select 'form#issue-form' do | ||||||
|  |       # Assert submit buttons | ||||||
|  |       assert_select 'input[type=submit][name=?]', 'commit' | ||||||
|  |       assert_select 'input[type=submit][name=?]', 'continue' | ||||||
|  |       assert_select 'input[type=submit][name=?]', 'follow' | ||||||
|  |     end | ||||||
|  |   end | ||||||
|  |  | ||||||
|   def test_update_form_for_new_issue |   def test_update_form_for_new_issue | ||||||
|     @request.session[:user_id] = 2 |     @request.session[:user_id] = 2 | ||||||
|     post( |     post( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user