Feature #29076 » 0001-Add-button-to-Create-and-follow-when-adding-a-subtas.patch
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
url_params[:issue][:project_id] = @issue.project_id
|
||
|
redirect_to new_issue_path(url_params)
|
||
|
end
|
||
|
elsif params[:follow]
|
||
|
redirect_to issue_path(@issue)
|
||
|
else
|
||
|
redirect_back_or_default issue_path(@issue)
|
||
|
end
|
||
| app/views/issues/new.html.erb | ||
|---|---|---|
|
</div>
|
||
|
<%= 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' %>
|
||
|
<% end %>
|
||
| config/locales/en.yml | ||
|---|---|---|
|
button_filter: Filter
|
||
|
button_actions: Actions
|
||
|
button_add_subtask: Add subtask
|
||
|
button_create_and_follow: Create and follow
|
||
|
status_active: active
|
||
|
status_registered: registered
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
assert_select 'select[name=?]', 'issue[done_ratio]'
|
||
|
assert_select 'input[name=?][value=?]', 'issue[custom_field_values][2]', 'Default string'
|
||
|
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
|
||
|
# Be sure we don't display inactive IssuePriorities
|
||
| ... | ... | |
|
assert_select 'div#trackers_description', 0
|
||
|
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
|
||
|
@request.session[:user_id] = 2
|
||
|
post(
|
||
- « Previous
- 1
- 2
- Next »