Commit 2bf5de4f by Tấn Trần Thanh

done ui

parent baaa838d
Pipeline #1612 canceled with stages
in 0 seconds
h2 = "Total: #{result[0]&.length}"
- if result.present?
table[border="1"]
tr.header_table--visible
......@@ -9,27 +10,35 @@
th.pink[colspan="8"] Github
tr.header_table--visible.none_colspan
- thead.each_with_index do |head, index|
- if (0..7).include?(index)
- case index
- when 0..2
th[class="root_col_#{index} green"] = head
- when (3..7)
th.green = head
- elsif (8..10).include?(index)
- when (8..10)
th.red = head
- elsif (11..13).include?(index)
- when (11..13)
th.blue = head
- elsif (14..20).include?(index)
- when (14..20)
th.purple = head
- elsif (21..27).include?(index)
- when (21..27)
th.gray = head
- elsif (28..31).include?(index)
- when (28..31)
th.yellow = head
- else
th.pink = head
- result[0].each_with_index do |_root_id, index|
- result[0].each_with_index do |root_id, index|
tr
- (0..(thead.length - 1)).each do |i|
- if i == 0
td.sidebar_visible = result[0][index]
- elsif i == 13
td.break-line = result[i][index]
- case i
- when 0..2
td[class="root_col_#{i}"]
p = result[i][index]
- when 13
td.notes
- notes = result[i][index]
p.break-line.note_est[class="note__est-#{root_id} #{notes.length.zero? ? 'none-over' : 'over_text'}"] = notes
- else
td = result[i][index]
- else
......
......@@ -77,3 +77,10 @@ window.addEventListener('load', function () {
download(csvContent)
}
})
$(document).on('click', 'td.notes', function () {
if (!$(this).find('p.note_est').hasClass('none-over')) {
$(this).find('p.note_est').toggleClass('over_text')
$(this).find('p.note_est').toggleClass('w-100')
}
})
......@@ -11,34 +11,24 @@
table {
display: inline-block;
table-layout: fixed;
border-collapse: collapse;
border-collapse: separate;
}
.header_table--visible {
position: sticky;
top: -1px;
top: 0;
z-index: 2;
height: 30px;
}
.none_colspan {
top: 29px;
}
.sidebar_visible {
position: sticky;
background: #dacbcb;
left: 0;
z-index: 1;
top: 32px;
}
.mt-10 {
margin-top: 10px;
}
.green {
background-color: #92ce92;
}
.red {
background-color: #e38585;
}
......@@ -88,3 +78,72 @@ p.error_link {
.break-line {
white-space: break-spaces;
}
.root_col_0 {
position: sticky;
left: 0;
z-index: 1;
padding: 5px 0;
background: #dacbcb;
}
.root_col_0 > p {
width: 78px;
text-align: center;
}
.root_col_1 {
position: sticky;
left: 80px;
z-index: 1;
padding: 5px 0;
background: #dacbcb;
}
.root_col_1 > p {
width: 120px;
text-align: center;
}
.root_col_2 {
position: sticky;
left: 202px;
z-index: 1;
padding: 5px 8px;
background: #dacbcb;
}
.green {
background: #92ce92;
}
td.notes {
position: relative;
}
.note_est {
width: 140px;
}
.over_text {
overflow: hidden;
display: block;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}
.over_text::before {
position: absolute;
right: 6px;
top: 8px;
content: '';
display: inline-block;
border: 5px solid transparent;
border-top-color: black;
vertical-align: middle;
}
.w-100 {
width: 100%;
}
......@@ -23,8 +23,9 @@ module WorkflowReport
return { workflow_report: [], error_links: [] } if raw_tasks.empty?
raw_tasks.group_by(&:root_id).each do |root_id, issues|
issue_ids = issues.map(&:id)
root_issue = WorkflowReportIssue.find(root_id)
arr_issue = WorkflowReportIssue.where(root_id: root_id)
issue_ids = arr_issue.map(&:id)
root_issue = arr_issue.find(root_id)
journals = WorkflowReportJournal.find_journal_by_issue_ids(issue_ids).to_a
result[0] << root_id
......@@ -40,7 +41,7 @@ module WorkflowReport
issue_due_date = issue_due_dates.max_by { |due_date| due_date }
result[6].push(issue_due_date.present? ? issue_due_date&.strftime('%Y-%m-%d %H:%M:%S') : '')
result[7].push(root_issue.status&.name.present? ? root_issue.status&.name : '')
sum_estimated_hours = issues.map(&:estimated_hours).compact.sum
sum_estimated_hours = arr_issue.map(&:estimated_hours).compact.sum
result[8] << sum_estimated_hours.round(2)
actual_time = TimeEntry.where(issue_id: issue_ids).sum(:hours)
if actual_time.present?
......@@ -61,7 +62,7 @@ module WorkflowReport
else
(11..13).each { |i| result[i] << '' }
end
issues.each do |issue|
arr_issue.each do |issue|
if issue.tracker_id == USER_STORY_TRACKER_ID
pr_links = issue.custom_values.find_by(custom_field_id: PR_FIELD_ID)&.value
jp_request = issue.custom_values.find_by(custom_field_id: JP_REQUEST_FIELD_ID)&.value
......
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