change-button-name.patch

Mizuki ISHIKAWA, 2021-08-17 04:05

Download (4.41 KB)

View differences:

app/views/context_menus/issues.html.erb
5 5
    <li><%= context_menu_link l(:button_edit), edit_issue_path(@issue),
6 6
            :class => 'icon icon-edit', :disabled => !@can[:edit] %></li>
7 7
  <% else %>
8
    <li><%= context_menu_link l(:button_edit), bulk_edit_issues_path(:ids => @issue_ids),
8
    <li><%= context_menu_link l(:label_bulk_edit_selected_issues), bulk_edit_issues_path(:ids => @issue_ids),
9 9
            :class => 'icon icon-edit', :disabled => !@can[:edit] %></li>
10 10
  <% end %>
11 11

  
app/views/context_menus/time_entries.html.erb
3 3
    <li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry},
4 4
            :class => 'icon icon-edit', :disabled => !@can[:edit] %></li>
5 5
  <% else %>
6
    <li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)},
6
    <li><%= context_menu_link l(:label_bulk_edit_selected_time_entries), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)},
7 7
            :class => 'icon icon-edit', :disabled => !@can[:edit] %></li>
8 8
  <% end %>
9 9

  
test/functional/context_menus_controller_test.rb
70 70
    }
71 71
    assert_response :success
72 72

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

  
......
112 112

  
113 113
    ids = [1, 2].map {|i| "ids%5B%5D=#{i}"}.join('&')
114 114

  
115
    assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Edit'
115
    assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Bulk edit selected issues'
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'
......
135 135

  
136 136
    ids = [1, 2, 6].map {|i| "ids%5B%5D=#{i}"}.join('&')
137 137

  
138
    assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Edit'
138
    assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Bulk edit selected issues'
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 141
    assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete'
......
402 402
    )
403 403
    assert_response :success
404 404

  
405
    assert_select 'a:not(.disabled)', :text => 'Edit'
405
    assert_select 'a:not(.disabled)', :text => 'Bulk edit selected time entries'
406 406
  end
407 407

  
408 408
  def test_context_menu_for_one_time_entry
......
454 454
    )
455 455
    assert_response :success
456 456

  
457
    assert_select 'a:not(.disabled)', :text => 'Edit'
457
    assert_select 'a:not(.disabled)', :text => 'Bulk edit selected time entries'
458 458
  end
459 459

  
460 460
  def test_time_entries_context_menu_without_edit_permission
......
468 468
    )
469 469
    assert_response :success
470 470

  
471
    assert_select 'a.disabled', :text => 'Edit'
471
    assert_select 'a.disabled', :text => 'Bulk edit selected time entries'
472 472
  end
473 473
end