Project

General

Profile

Feature #31278 » 31278.patch

Go MAEDA, 2021-12-31 14:12

View differences:

app/views/context_menus/issues.html.erb
164 164
  <li><%= context_menu_link l(:button_copy), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'),
165 165
                          :class => 'icon icon-copy', :disabled => !@can[:copy] %></li>
166 166
<% end %>
167
  <li><%= context_menu_link l(:button_delete), issues_path(:ids => @issue_ids, :back_url => @back),
167
  <li><%= context_menu_link l(:button_delete_object, object_name: (@issue_ids.size > 1 ? l(:label_issue_plural) : l(:label_issue)).downcase), issues_path(:ids => @issue_ids, :back_url => @back),
168 168
                            :method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon icon-del', :disabled => !@can[:delete] %></li>
169 169

  
170 170
  <%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
app/views/issues/_action_menu.html.erb
9 9
            :class => 'icon icon-copy' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %>
10 10
<%= actions_dropdown do %>
11 11
  <%= copy_object_url_link(issue_url(@issue, only_path: false)) %>
12
  <%= link_to l(:button_delete), issue_path(@issue),
12
  <%= link_to l(:button_delete_object, object_name: l(:label_issue).downcase), issue_path(@issue),
13 13
              :data => {:confirm => issues_destroy_confirmation_message(@issue)},
14 14
              :method => :delete, :class => 'icon icon-del' if @issue.deletable? %>
15 15
<% end %>
test/functional/context_menus_controller_test.rb
49 49
    assert_select 'a.icon-edit[href=?]', '/issues/1/edit', :text => 'Edit'
50 50
    assert_select 'a.icon-copy-link[data-clipboard-text=?]', 'http://test.host/issues/1', :text => 'Copy link'
51 51
    assert_select 'a.icon-copy[href=?]', '/projects/ecookbook/issues/1/copy', :text => 'Copy'
52
    assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1', :text => 'Delete'
52
    assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1', :text => 'Delete issue'
53 53

  
54 54
    # Statuses
55 55
    assert_select 'a[href=?][data-method="patch"]', '/issues/1?ids%5B%5D=1&issue%5Bstatus_id%5D=5', :text => 'Closed'
......
72 72

  
73 73
    assert_select 'a.icon-edit[href=?]', '/issues/bulk_edit?ids%5B%5D=1&ids%5B%5D=2', :text => 'Bulk edit'
74 74
    assert_select 'a.icon-copy[href=?]', '/issues/bulk_edit?copy=1&ids%5B%5D=1&ids%5B%5D=2', :text => 'Copy'
75
    assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1&ids%5B%5D=2', :text => 'Delete'
75
    assert_select 'a.icon-del[href=?]', '/issues?ids%5B%5D=1&ids%5B%5D=2', :text => 'Delete issues'
76 76

  
77 77
    # Statuses
78 78
    assert_select 'a[href=?][data-method="patch"]', '/issues/bulk_update?ids%5B%5D=1&ids%5B%5D=2&issue%5Bstatus_id%5D=5', :text => 'Closed'
......
96 96
      )
97 97
      assert_response :success
98 98

  
99
      assert_select 'a.icon-del.disabled[href="#"]', :text => 'Delete'
99
      assert_select 'a.icon-del.disabled[href="#"]', :text => 'Delete issue'
100 100
    end
101 101
  end
102 102

  
......
116 116
    # issue_id: '1,2', set_filter: 1, status_id: '*'
117 117
    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'
118 118
    assert_select 'a.icon-copy[href=?]', "/issues/bulk_edit?copy=1&#{ids}", :text => 'Copy'
119
    assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete'
119
    assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete issues'
120 120

  
121 121
    assert_select 'a[href=?]', "/issues/bulk_update?#{ids}&issue%5Bstatus_id%5D=5", :text => 'Closed'
122 122
    assert_select 'a[href=?]', "/issues/bulk_update?#{ids}&issue%5Bpriority_id%5D=8", :text => 'Immediate'
......
138 138
    assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Bulk edit'
139 139
    # issue_id: '1,2,6', set_filter: 1, status_id: '*'
140 140
    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'
141
    assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete'
141
    assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete issues'
142 142

  
143 143
    assert_select 'a[href=?]', "/issues/bulk_update?#{ids}&issue%5Bstatus_id%5D=5", :text => 'Closed'
144 144
    assert_select 'a[href=?]', "/issues/bulk_update?#{ids}&issue%5Bpriority_id%5D=8", :text => 'Immediate'
test/functional/issues_controller_test.rb
2078 2078
      assert_select 'a', {:count => 0, :text => 'Watch'}
2079 2079
      assert_select 'a', {:count => 0, :text => 'Copy'}
2080 2080
      assert_select 'div.drdn-items a', {:count => 1, :text => 'Copy link'}
2081
      assert_select 'div.drdn-items a', {:count => 0, :text => 'Delete'}
2081
      assert_select 'div.drdn-items a', {:count => 0, :text => 'Delete issue'}
2082 2082
    end
2083 2083
    # anonymous role is allowed to add a note
2084 2084
    assert_select 'form#issue-form' do
......
2100 2100
      assert_select 'a', {:count => 1, :text => 'Watch'}
2101 2101
      assert_select 'a', {:count => 1, :text => 'Copy'}
2102 2102
      assert_select 'div.drdn-items a', {:count => 1, :text => 'Copy link'}
2103
      assert_select 'div.drdn-items a', {:count => 1, :text => 'Delete'}
2103
      assert_select 'div.drdn-items a', {:count => 1, :text => 'Delete issue'}
2104 2104
    end
2105 2105
    assert_select 'form#issue-form' do
2106 2106
      assert_select 'fieldset' do
......
3023 3023
    get(:show, :params => {:id => 1})
3024 3024
    assert_response :success
3025 3025
    assert_select 'a', :text => 'Edit'
3026
    assert_select 'a', :text => 'Delete'
3026
    assert_select 'a', :text => 'Delete issue'
3027 3027
  end
3028 3028

  
3029 3029
  def test_show_on_closed_project_should_not_display_edit_links
......
3032 3032
    get(:show, :params => {:id => 1})
3033 3033
    assert_response :success
3034 3034
    assert_select 'a', :text => 'Edit', :count => 0
3035
    assert_select 'a', :text => 'Delete', :count => 0
3035
    assert_select 'a', :text => 'Delete issue', :count => 0
3036 3036
  end
3037 3037

  
3038 3038
  def test_show_should_not_display_history_tabs_for_issue_without_journals
(3-3/3)