Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ def convert_hash_to_pct(hash, total)
orange_pct: 0,
blue_pct: 0,
green_pct: 0,
hd_pct: 0,
oa_pct: 0,
a_pct: 1,
ba_pct: 0,
order_scale: 0
}.freeze

Expand All @@ -495,13 +499,22 @@ def self.create_task_stats_from(total_task_counts, project_task_counts, target_g
grey_pct = (1 - red_pct - orange_pct - green_pct - blue_pct).signif(2)

order_scale = (green_pct * 100) + (blue_pct * 100) + (orange_pct * 10) - red_pct

hd_pct = green_pct
oa_pct = blue_pct
a_pct = grey_pct
ba_pct = (orange_pct + red_pct).signif(2)
else
red_pct = 0
orange_pct = 0
green_pct = 0
blue_pct = 0
grey_pct = 1
order_scale = 0
hd_pct = 0
oa_pct = 0
a_pct = 1
ba_pct = 0
end

{
Expand All @@ -510,6 +523,10 @@ def self.create_task_stats_from(total_task_counts, project_task_counts, target_g
orange_pct: orange_pct,
blue_pct: blue_pct,
green_pct: green_pct,
hd_pct: hd_pct,
oa_pct: oa_pct,
a_pct: a_pct,
ba_pct: ba_pct,
order_scale: order_scale
}
end
Expand Down