Commit 9a616fe2 by Tấn Trần Thanh

break line if notes larger than 1

parent 9939a3e0
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
- (0..(thead.length - 1)).each do |i| - (0..(thead.length - 1)).each do |i|
- if i == 0 - if i == 0
td.sidebar_visible = result[0][index] td.sidebar_visible = result[0][index]
- elsif i == 13
td = result[i][index].html_safe
- else - else
td = result[i][index] td = result[i][index]
- else - else
......
...@@ -52,7 +52,7 @@ module WorkflowReport ...@@ -52,7 +52,7 @@ module WorkflowReport
if journals.length.positive? if journals.length.positive?
number_of_est_changes = journals.count { |j| !j[1].nil? } || '' number_of_est_changes = journals.count { |j| !j[1].nil? } || ''
est_changes = journals.reject { |j| j[1].nil? }.select { |e| e[4].present? } est_changes = journals.reject { |j| j[1].nil? }.select { |e| e[4].present? }
notes = est_changes.inject('') { |all, i| "#{all}#{i[4]}\n" } || '' notes = est_changes.inject('') { |all, i| "#{all}<p> - #{i[4]}.</p> " } || ''
original_est_hours = journals.group_by(&:shift).inject(0) { |sum, i| sum + i[1][0][1].to_f unless i.nil? } || '' original_est_hours = journals.group_by(&:shift).inject(0) { |sum, i| sum + i[1][0][1].to_f unless i.nil? } || ''
result[11] << original_est_hours result[11] << original_est_hours
result[12] << number_of_est_changes result[12] << number_of_est_changes
...@@ -98,7 +98,7 @@ module WorkflowReport ...@@ -98,7 +98,7 @@ module WorkflowReport
result[32] << jp_request result[32] << jp_request
begin begin
jp_request_arr = URI(jp_request).path.split('/').reject(&:blank?) jp_request_arr = URI(jp_request).path.split('/').reject(&:blank?)
if jp_request_arr.length == 4 && jp_request_arr[3].to_i.positive? if jp_request_arr.length >= 4 && jp_request_arr[3].to_i.positive?
issue_detail = github.issues.find user: jp_request_arr[0], repo: jp_request_arr[1], number: jp_request_arr[3] issue_detail = github.issues.find user: jp_request_arr[0], repo: jp_request_arr[1], number: jp_request_arr[3]
result[33].push(issue_detail.success? ? issue_detail.comments : '') result[33].push(issue_detail.success? ? issue_detail.comments : '')
...@@ -119,7 +119,7 @@ module WorkflowReport ...@@ -119,7 +119,7 @@ module WorkflowReport
prs.each do |link| prs.each do |link|
begin begin
pr_link_arr = URI(link.strip).path.split('/').reject!(&:empty?) pr_link_arr = URI(link.strip).path.split('/').reject!(&:empty?)
next unless pr_link_arr.length == 4 next unless pr_link_arr.length >= 4
pr_detail = github.pull_requests.find user: pr_link_arr[0], repo: pr_link_arr[1], number: pr_link_arr[3] pr_detail = github.pull_requests.find user: pr_link_arr[0], repo: pr_link_arr[1], number: pr_link_arr[3]
if pr_detail.success? if pr_detail.success?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment