update_issue_subject_v3.patch

Marius BALTEANU, 2016-10-25 10:18

Download (4.29 KB)

View differences:

app/views/timelog/_form.html.erb
13 13
  <% end %>
14 14
  <p>
15 15
    <%= f.text_field :issue_id, :size => 6 %>
16
    <% if @time_entry.issue.try(:visible?) %>
17
      <span id="time_entry_issue"><%= "#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}" %></span>
18
    <% end %>
16
    <span id="time_entry_issue">
17
      <%=  link_to_issue(@time_entry.issue) if @time_entry.issue.try(:visible?) %>
18
    </span>
19 19
  </p>
20 20
  <p><%= f.date_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
21 21
  <p><%= f.text_field :hours, :size => 6, :required => true %></p>
app/views/timelog/new.js.erb
1 1
$('#time_entry_activity_id').html('<%= escape_javascript options_for_select(activity_collection_for_select_options(@time_entry), @time_entry.activity_id) %>');
2
$('#time_entry_issue').html('<%= escape_javascript link_to_issue(@time_entry.issue) if @time_entry.issue.try(:visible?) %>');
test/functional/timelog_controller_test.rb
35 35

  
36 36
    assert_select 'input[name=?][type=hidden]', 'project_id', 0
37 37
    assert_select 'input[name=?][type=hidden]', 'issue_id', 0
38
    assert_select 'span[id=?]', 'time_entry_issue'
38 39
    assert_select 'select[name=?]', 'time_entry[project_id]' do
39 40
      # blank option for project
40 41
      assert_select 'option[value=""]'
......
58 59

  
59 60
    assert_select 'input[name=?][type=hidden]', 'project_id', 0
60 61
    assert_select 'input[name=?][type=hidden]', 'issue_id'
62
    assert_select 'a[href=?]', '/issues/2', :text => /Feature request #2/
61 63
    assert_select 'select[name=?]', 'time_entry[project_id]', 0
62 64
  end
63 65

  
......
249 251
    end
250 252
    assert_select_error /Issue is invalid/
251 253
    assert_select "input[name=?][value=?]", "time_entry[issue_id]", issue.id.to_s
252
    assert_select "#time_entry_issue", 0
254
    assert_select "#time_entry_issue a", 0
253 255
    assert !response.body.include?('issue_that_is_not_visible')
254 256
  end
255 257

  
......
501 503
    assert_select 'form#bulk_edit_form[action=?]', '/time_entries/bulk_update' do
502 504
      # System wide custom field
503 505
      assert_select 'select[name=?]', 'time_entry[custom_field_values][10]'
504
  
506

  
505 507
      # Activities
506 508
      assert_select 'select[name=?]', 'time_entry[activity_id]' do
507 509
        assert_select 'option[value=""]', :text => '(No change)'
......
549 551
    @request.session[:user_id] = 2
550 552
    # makes user a manager on the other project
551 553
    Member.create!(:user_id => 2, :project_id => 3, :role_ids => [1])
552
    
554

  
553 555
    # update time entry activity
554 556
    post :bulk_update, :params => {:ids => [1, 2, 4], :time_entry => { :activity_id => 9 }}
555 557

  
......
677 679
  def test_index_at_project_level
678 680
    get :index, :params => {:project_id => 'ecookbook', :c => ['project']}
679 681
    assert_response :success
680
    
682

  
681 683
    assert_select 'tr.time-entry', 4
682
    
684

  
683 685
    # project and subproject
684 686
    projects = css_select('table.time-entries tbody td.project').map(&:text).uniq.sort
685 687
    assert_equal ["eCookbook", "eCookbook Subproject 1"], projects
......
959 961

  
960 962
  def test_index_at_project_level_should_include_csv_export_dialog
961 963
    get :index, :params => {
962
      :project_id => 'ecookbook', 
964
      :project_id => 'ecookbook',
963 965
      :f => ['spent_on'],
964 966
      :op => {'spent_on' => '>='},
965 967
      :v => {'spent_on' => ['2007-04-01']},