Project

General

Profile

Defect #13521 » fix_late_line.patch

Mizuki ISHIKAWA, 2017-12-15 01:35

View differences:

lib/redmine/helpers/gantt.rb
595 595
                coords[:bar_progress_end] = self.date_to - self.date_from + 1
596 596
              end
597 597
            end
598
            if progress_date < User.current.today
599
              late_date = [User.current.today, end_date].min
598
            if progress_date <= User.current.today
599
              late_date = [User.current.today, end_date].min + 1
600 600
              if late_date > self.date_from && late_date > start_date
601 601
                if late_date < self.date_to
602
                  coords[:bar_late_end] = late_date - self.date_from + 1
602
                  coords[:bar_late_end] = late_date - self.date_from
603 603
                else
604 604
                  coords[:bar_late_end] = self.date_to - self.date_from + 1
605 605
                end
test/unit/lib/redmine/helpers/gantt_test.rb
353 353
    assert_select 'div.task_late[style*="width:30px"]', 1
354 354
  end
355 355

  
356
  test "#line late line should be the same width as task_todo when start date and end date are the same" do
357
    create_gantt
358
    @output_buffer = @gantt.line(today - 7, today - 7, 0, false, 'line', :format => :html, :zoom => 4)
359
    assert_select 'div.task_late[style*="width:2px"]', 1
360
    assert_select 'div.task_todo[style*="width:2px"]', 1
361
  end
362

  
363
  test "#line late line should be the same width as task_todo when start date and today are the same" do
364
    create_gantt
365
    @output_buffer = @gantt.line(today, today, 0, false, 'line', :format => :html, :zoom => 4)
366
    assert_select 'div.task_late[style*="width:2px"]', 1
367
    assert_select 'div.task_todo[style*="width:2px"]', 1
368
  end
369

  
356 370
  test "#line done line should start from the starting point on the left" do
357 371
    create_gantt
358 372
    @output_buffer = @gantt.line(today - 7, today + 7, 30, false, 'line', :format => :html, :zoom => 4)
(2-2/4)