From 4ac151be495f3e4b67035e3d0a22eb84c441176d Mon Sep 17 00:00:00 2001 From: Suraj Vadgama Date: Thu, 12 Jul 2018 14:25:55 +0100 Subject: [PATCH] Resolve #677 --- Gemfile.lock | 4 ++-- app/cells/proposal_indicators_cell.rb | 18 ------------------ app/views/proposals/_card.html.haml | 5 ----- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 78db7230..87478167 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -206,7 +206,7 @@ GEM mixpanel-ruby (2.2.0) money (6.9.0) i18n (>= 0.6.4, < 0.9) - multi_json (1.12.1) + multi_json (1.13.1) multi_xml (0.6.0) netrc (0.11.0) nio4r (2.1.0) @@ -291,7 +291,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rollbar (2.15.0) + rollbar (2.16.3) multi_json rspec-cells (0.3.4) cells (>= 4.0.0, < 6.0.0) diff --git a/app/cells/proposal_indicators_cell.rb b/app/cells/proposal_indicators_cell.rb index e1a7cf2f..58c9a9f4 100644 --- a/app/cells/proposal_indicators_cell.rb +++ b/app/cells/proposal_indicators_cell.rb @@ -11,15 +11,6 @@ def eligibility_progress_bar render view: :progress_bar, locals: {bg_color: bg_color, names: names, states: states} end - def suitability_progress_bar - @counts = suitability_counts - @pcs = count_percentages(@counts) - bg_color = { 0 => 'bg-red', 1 => 'bg-yellow', 2 => 'bg-green', -1 => 'bg-blue' } - names = { 0 => 'unsuitable', 1 => 'fair suitability', 2 => 'suitable', -1 => 'to check' } - states = [-1, 0, 1, 2] - render view: :progress_bar, locals: {bg_color: bg_color, names: names, states: states} - end - def funds_checked model.assessments.where("eligibility_status != #{INCOMPLETE}").size end @@ -37,13 +28,4 @@ def eligibility_counts model.assessments.group(:eligibility_status).size ) end - - def suitability_counts - { - -1 => model.suitability.count{ |k, s| s.fetch('total') == nil }, - 0 => model.suitability.count{ |k, s| s.fetch('total') < 0.2 }, - 1 => model.suitability.count{ |k, s| s.fetch('total').between?(0.2, 0.5) }, - 2 => model.suitability.count{ |k, s| s.fetch('total') > 0.5 }, - } - end end diff --git a/app/views/proposals/_card.html.haml b/app/views/proposals/_card.html.haml index edac5750..1ff97041 100644 --- a/app/views/proposals/_card.html.haml +++ b/app/views/proposals/_card.html.haml @@ -20,11 +20,6 @@ Eligibility .col-two-thirds.fs12 = cell(:proposal_indicators, proposal).call(:eligibility_progress_bar) - .flex.mt3 - .col-one-third.fs12 - Suitability - .col-two-thirds.fs12 - = cell(:proposal_indicators, proposal).call(:suitability_progress_bar) .fs14.center.py15.border-top.border-silver = link_to 'Funds', funds_path(proposal), class: 'px15'