From b3585b14ecc7891adfd77ac7e3dde2e2f043028b Mon Sep 17 00:00:00 2001 From: Kristin Merbach Date: Sun, 4 Aug 2024 18:10:56 -0700 Subject: [PATCH] use plan shopping partial for shopping details --- app/helpers/application_helper.rb | 7 ++- .../plan_shoppings/_plan_details.html.erb | 45 ++++++++++++++----- .../ui-components/v1/cards/_summary.html.erb | 7 ++- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9a83c03f0bb..53e2d8bb8c5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -322,13 +322,11 @@ def active_menu_item(label, path, controller = nil) "#{li_start}#{link_to(label, path)}" end - # rubocop:disable Naming/MethodParameterName def active_dropdown_classes(*args) args.map(&:to_s).include?(params[:controller].to_s) ? "dropdown active" : "dropdown" end - # rubocop:enable Naming/MethodParameterName - # rubocop:disable Naming/MethodParameterName + # rubocop:disable Naming/MethodParameterName def link_to_add_fields(name, f, association, classes = '') # rubocop:enable Naming/MethodParameterName new_object = f.object.send(association).klass.new @@ -766,6 +764,7 @@ def display_dental_metal_level(plan) end def ivl_hsa_status(plan_hsa_status, plan) + return unless plan_hsa_status.present? (plan_hsa_status[plan.id.to_s]) if plan.benefit_market_kind == :aca_individual end @@ -990,7 +989,7 @@ def csr_percentage_options_for_select end end - def show_component(url) # rubocop:disable Metrics/CyclomaticComplexity TODO: Remove this + def show_component(url) if url.split('/')[2] == "consumer_role" || url.split('/')[1] == "insured" && url.split('/')[2] == "interactive_identity_verifications" || url.split('/')[1] == "financial_assistance" && url.split('/')[2] == "applications" || url.split('/')[1] == "insured" && url.split('/')[2] == "family_members" || url.include?("family_relationships") false else diff --git a/app/views/insured/plan_shoppings/_plan_details.html.erb b/app/views/insured/plan_shoppings/_plan_details.html.erb index 0184ba9239e..4d86cf8e157 100644 --- a/app/views/insured/plan_shoppings/_plan_details.html.erb +++ b/app/views/insured/plan_shoppings/_plan_details.html.erb @@ -1,4 +1,5 @@ <% plan_carrier = Caches::MongoidCache.lookup(BenefitSponsors::Organizations::Organization.issuer_profiles, plan.issuer_profile_id) { plan.issuer_profile } %> +<% details_page = (defined? details_page) ? details_page : false %> <% if @bs4 %>
- + <% if details_page %> +
+ <% if plan.kind.to_s == "dental" %> + + <%= plan.kind.to_s.titleize %> + + + <% else %> + + <%= plan.kind.to_s.titleize %> + + + <% end %> + <%= plan.kind.to_s.titleize %> +
+ <% else %> + + <% end %>
@@ -34,7 +52,8 @@ <%= plan.standard_plan_label.titleize %> <% end %> - <% if @enrolled_hbx_enrollment_plan_ids.include?(plan.id) %> + <% current_plans = @hbx_enrollment.family.current_enrolled_or_termed_coverages(@hbx_enrollment, true).collect(&:product_id) %> + <% if current_plans.present? && current_plans.include?(plan.id) %> Star @@ -58,12 +77,12 @@
<%= display_carrier_logo(Maybe.new(plan), {width: 100}) %>

- <%= h(link_to(summary_products_plans_path({plan_id: plan.id, :standard_component_id => plan.hios_id, hbx_enrollment_id: @hbx_enrollment.id, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind, active_year: plan.try(:active_year), bs4: @bs4}), {:remote => true}) do %> + <%= link_to summary_products_plans_path({plan_id: plan.id, :standard_component_id => plan.hios_id, hbx_enrollment_id: @hbx_enrollment.id, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind, active_year: plan.try(:active_year), bs4: @bs4}), {:remote => true} do %> <% if plan.is_csr?%> <% end %> <%= plan.name %> - <% end) %> + <% end %>

@@ -113,18 +132,20 @@ diff --git a/app/views/ui-components/v1/cards/_summary.html.erb b/app/views/ui-components/v1/cards/_summary.html.erb index 2762675b839..2585276e269 100644 --- a/app/views/ui-components/v1/cards/_summary.html.erb +++ b/app/views/ui-components/v1/cards/_summary.html.erb @@ -16,9 +16,12 @@ <% end %> <% if qhp.present? %>

<%= @hbx_enrollment.coverage_year %> <%= @hbx_enrollment&.product&.kind.to_s.titleize %> <%= l10n('coverage').titleize %>

- <% unless action_name == "home" %> - <%= render partial: "insured/families/enrollment_refactored", :collection => [@hbx_enrollment], :as => :hbx_enrollment, locals: { read_only: false } %> + <% if @hbx_enrollment.shopping? %> + <%= render partial: "insured/plan_shoppings/plan_details", locals: { read_only: false, plan: @plan, details_page: true } %> + <% else %> + <%= render partial: "insured/families/enrollment_refactored", :collection => [@hbx_enrollment], :as => :hbx_enrollment, locals: { read_only: false } %> + <% end %> <% end %> <% if display_enr_summary_is_enabled(@hbx_enrollment) %>