add_copy_link_item_to_context_menu.patch

Mizuki ISHIKAWA, 2021-03-19 05:49

Download (2.43 KB)

View differences:

app/views/context_menus/issues.html.erb
157 157
  <% end %>
158 158
  <li><%= context_menu_link l(:button_copy), project_copy_issue_path(@project, @issue),
159 159
          :class => 'icon icon-copy', :disabled => !@can[:copy] %></li>
160
  <li><%= copy_object_url_link(issue_url(@issue, only_path: false)) %></li>
160 161
<% else %>
161 162
  <li><%= context_menu_link l(:button_copy), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'),
162 163
                          :class => 'icon icon-copy', :disabled => !@can[:copy] %></li>
164
  <li><%= copy_object_url_link(issues_url(set_filter: 1, issue_id: @issue_ids.join(','), status_id: '*', only_path: false)) %></li>
163 165
<% end %>
164 166
  <li><%= context_menu_link l(:button_delete), issues_path(:ids => @issue_ids, :back_url => @back),
165 167
                            :method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon icon-del', :disabled => !@can[:delete] %></li>
test/functional/context_menus_controller_test.rb
48 48

  
49 49
    assert_select 'a.icon-edit[href=?]', '/issues/1/edit', :text => 'Edit'
50 50
    assert_select 'a.icon-copy[href=?]', '/projects/ecookbook/issues/1/copy', :text => 'Copy'
51
    assert_select 'a.icon-copy-link[data-clipboard-text=?]', 'http://test.host/issues/1', :text => 'Copy link'
51 52
    assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1', :text => 'Delete'
52 53

  
53 54
    # Statuses
......
90 91

  
91 92
    assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Edit'
92 93
    assert_select 'a.icon-copy[href=?]', "/issues/bulk_edit?copy=1&#{ids}", :text => 'Copy'
94
    # issue_id: '1,2', set_filter: 1, status_id: '*'
95
    assert_select 'a.icon-copy-link[data-clipboard-text=?]', "http://test.host/issues?issue_id=1%2C2&set_filter=1&status_id=%2A", :text => 'Copy link'
93 96
    assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete'
94 97

  
95 98
    assert_select 'a[href=?]', "/issues/bulk_update?#{ids}&issue%5Bstatus_id%5D=5", :text => 'Closed'