Feature #34932 » add_copy_link_item_to_context_menu_v2.patch
| app/helpers/routes_helper.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def _project_issues_url(project, *args)
|
||
|
if project
|
||
|
project_issues_url(project, *args)
|
||
|
else
|
||
|
issues_url(*args)
|
||
|
end
|
||
|
end
|
||
|
def _project_news_path(project, *args)
|
||
|
if project
|
||
|
project_news_index_path(project, *args)
|
||
| app/views/context_menus/issues.html.erb | ||
|---|---|---|
|
<li><%= context_menu_link l(:button_add_subtask), url_for_new_subtask(@issue),
|
||
|
:class => 'icon icon-add' %></li>
|
||
|
<% end %>
|
||
|
<li><%= copy_object_url_link(issue_url(@issue)) %></li>
|
||
|
<li><%= context_menu_link l(:button_copy), project_copy_issue_path(@project, @issue),
|
||
|
:class => 'icon icon-copy', :disabled => !@can[:copy] %></li>
|
||
|
<% else %>
|
||
|
<li><%= copy_object_url_link(_project_issues_url(@project, set_filter: 1, status_id: '*', issue_id: @issue_ids.join(','))) %></li>
|
||
|
<li><%= context_menu_link l(:button_copy), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'),
|
||
|
:class => 'icon icon-copy', :disabled => !@can[:copy] %></li>
|
||
|
<% end %>
|
||
| test/functional/context_menus_controller_test.rb | ||
|---|---|---|
|
assert_response :success
|
||
|
assert_select 'a.icon-edit[href=?]', '/issues/1/edit', :text => 'Edit'
|
||
|
assert_select 'a.icon-copy-link[data-clipboard-text=?]', 'http://test.host/issues/1', :text => 'Copy link'
|
||
|
assert_select 'a.icon-copy[href=?]', '/projects/ecookbook/issues/1/copy', :text => 'Copy'
|
||
|
assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1', :text => 'Delete'
|
||
| ... | ... | |
|
ids = [1, 2].map {|i| "ids%5B%5D=#{i}"}.join('&')
|
||
|
assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Edit'
|
||
|
# issue_id: '1,2', set_filter: 1, status_id: '*'
|
||
|
assert_select 'a.icon-copy-link[data-clipboard-text=?]', "http://test.host/projects/ecookbook/issues?issue_id=1%2C2&set_filter=1&status_id=%2A", :text => 'Copy link'
|
||
|
assert_select 'a.icon-copy[href=?]', "/issues/bulk_edit?copy=1&#{ids}", :text => 'Copy'
|
||
|
assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete'
|
||
| ... | ... | |
|
ids = [1, 2, 6].map {|i| "ids%5B%5D=#{i}"}.join('&')
|
||
|
assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Edit'
|
||
|
# issue_id: '1,2,6', set_filter: 1, status_id: '*'
|
||
|
assert_select 'a.icon-copy-link[data-clipboard-text=?]', "http://test.host/issues?issue_id=1%2C2%2C6&set_filter=1&status_id=%2A", :text => 'Copy link'
|
||
|
assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete'
|
||
|
assert_select 'a[href=?]', "/issues/bulk_update?#{ids}&issue%5Bstatus_id%5D=5", :text => 'Closed'
|
||
| test/helpers/routes_helper_test.rb | ||
|---|---|---|
|
assert_equal '/issues/1/time_entries/new', _new_time_entry_path(nil, Issue.find(1))
|
||
|
assert_equal '/time_entries/new', _new_time_entry_path(nil, nil)
|
||
|
end
|
||
|
def test_project_issues_url
|
||
|
assert_equal 'http://test.host/projects/ecookbook/issues', _project_issues_url(Project.find(1))
|
||
|
assert_equal 'http://test.host/issues', _project_issues_url(nil)
|
||
|
assert_equal 'http://test.host/projects/ecookbook/issues?set_filter=1', _project_issues_url(Project.find(1), set_filter: 1)
|
||
|
assert_equal 'http://test.host/issues?set_filter=1', _project_issues_url(nil, set_filter: 1)
|
||
|
end
|
||
|
end
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »