Project

General

Profile

Feature #35770 » change-button-name-to-bulk-edit.patch

Mizuki ISHIKAWA, 2021-09-09 06:37

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), 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), {: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

  
config/locales/en.yml
928 928
  label_changeset_plural: Changesets
929 929
  label_default_columns: Default columns
930 930
  label_no_change_option: (No change)
931
  label_bulk_edit: Bulk edit
931 932
  label_bulk_edit_selected_issues: Bulk edit selected issues
932 933
  label_bulk_edit_selected_time_entries: Bulk edit selected time entries
933 934
  label_theme: Theme
config/locales/ja.yml
757 757
  label_changeset_plural: 更新履歴
758 758
  label_default_columns: デフォルトの項目
759 759
  label_no_change_option: (変更無し)
760
  label_bulk_edit: 一括編集
760 761
  label_bulk_edit_selected_issues: チケットの一括編集
761 762
  label_theme: テーマ
762 763
  label_default: デフォルト
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'
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'
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'
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'
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'
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'
472 472
  end
473 473
end
(4-4/4)