Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use plan shopping partial for shopping details #4205

Merged
Merged
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,11 @@ def active_menu_item(label, path, controller = nil)
"#{li_start}#{link_to(label, path)}</li>"
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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
45 changes: 33 additions & 12 deletions app/views/insured/plan_shoppings/_plan_details.html.erb
Original file line number Diff line number Diff line change
@@ -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 %>
<div class="plan-card plan-row border my-2 rounded-lg"
data-plan-id="<%= plan.id %>"
Expand All @@ -17,10 +18,27 @@
data-can-use-aptc="<%= plan.can_use_aptc? %>">
<div class="panel-header p-2 d-flex justify-content-between">
<div class="pl-0 col-3">
<label for="compare_plan_checkbox_<%= plan.id %>" data-cuke="compare_plan_checkbox" class="weight-n d-flex align-items-center">
<input id="compare_plan_checkbox_<%= plan.id %>" type="checkbox" class="compare_plan_checkbox checkbox-custom ivl-select-plan-for-comparison mr-2" data-hbx-id="<%= @hbx_enrollment.id %>" data-hios-id="<%= plan.hios_id %>" data-plan-year="<%= plan.active_year %>" data-plan-enrollment-kind="<%= @enrollment_kind %>" data-plan-change-plan="<%= @change_plan%>"></input>
<%= l10n("compare") %>
</label>
<% if details_page %>
<div class="plan-type">
<% if plan.kind.to_s == "dental" %>
<svg width="20" height="18" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<title><%= plan.kind.to_s.titleize %></title>
<path d="M2.35483 1.38688C3.35456 0.552474 4.64378 0 5.75001 0C6.61867 0 7.30138 0.138086 7.85732 0.370562C8.41691 0.604567 8.80939 0.918185 9.1117 1.21347C9.2436 1.34231 9.36142 1.47097 9.45856 1.57706L9.48894 1.61022C9.59848 1.72963 9.67635 1.8121 9.7494 1.87706C9.87344 1.98737 9.92861 2 10 2C10.0714 2 10.1266 1.98737 10.2506 1.87706C10.3237 1.8121 10.4015 1.72964 10.5111 1.61022L10.5414 1.57707C10.6386 1.47099 10.7564 1.34231 10.8883 1.21347C11.1906 0.918186 11.5831 0.604567 12.1427 0.370562C12.6986 0.138086 13.3813 0 14.25 0C15.3562 0 16.6455 0.552473 17.6452 1.38688C18.6514 2.22674 19.5 3.4684 19.5 4.94802C19.5 5.72617 19.4977 7.2538 18.127 8.88603C17.757 9.4714 17.5032 10.1607 17.5 10.7541C17.4895 12.6801 17.0627 14.3074 16.4174 15.4794C15.8012 16.5984 14.8607 17.5 13.75 17.5C13.392 17.5 13.0585 17.3995 12.7745 17.1891C12.5012 16.9866 12.3199 16.7167 12.1947 16.4492C11.9551 15.9375 11.8515 15.2765 11.7765 14.6469C11.7453 14.3849 11.7177 14.1181 11.6899 13.8489C11.5751 12.7401 11.456 11.5895 11.063 10.5532C10.8772 10.1956 10.5566 10 10.25 10H9.75001C9.43585 10 9.10703 10.2053 8.92355 10.5799C8.37966 11.6904 8.31249 12.9425 8.24799 14.1449C8.23957 14.302 8.23118 14.4583 8.22179 14.6133C8.18453 15.228 8.12663 15.9093 7.89129 16.4392C7.76492 16.7238 7.57181 17.004 7.2713 17.208C6.96775 17.4141 6.6171 17.5 6.25001 17.5C5.01064 17.5 4.06144 16.6287 3.46034 15.4609C2.85263 14.2802 2.51036 12.654 2.50002 10.7541C2.49712 10.222 2.29285 9.60884 1.9759 9.05673C1.92022 8.95974 1.8419 8.86299 1.71361 8.71076C0.499723 7.27033 0.499915 5.6806 0.500001 4.96606L0.500006 4.94802C0.500006 3.4684 1.34856 2.22674 2.35483 1.38688ZM13.75 3C13.3358 3 13 3.33579 13 3.75C13 4.16421 13.3358 4.5 13.75 4.5C14.4644 4.5 15 5.03563 15 5.75C15 6.16421 15.3358 6.5 15.75 6.5C16.1642 6.5 16.5 6.16421 16.5 5.75C16.5 4.2072 15.2928 3 13.75 3Z" fill="currentColor"/>
</svg>
<% else %>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<title><%= plan.kind.to_s.titleize %></title>
<path d="M10 3.25C9.0335 3.25 8.25 4.0335 8.25 5V8.25H5C4.0335 8.25 3.25 9.0335 3.25 10V14C3.25 14.9665 4.0335 15.75 5 15.75H8.25V19C8.25 19.9665 9.0335 20.75 10 20.75H14C14.9665 20.75 15.75 19.9665 15.75 19V15.75H19C19.9665 15.75 20.75 14.9665 20.75 14V10C20.75 9.0335 19.9665 8.25 19 8.25H15.75V5C15.75 4.0335 14.9665 3.25 14 3.25H10Z" fill="currentColor"/>
</svg>
<% end %>
<span><%= plan.kind.to_s.titleize %></span>
</div>
<% else %>
<label for="compare_plan_checkbox_<%= plan.id %>" data-cuke="compare_plan_checkbox" class="weight-n d-flex align-items-center">
<input id="compare_plan_checkbox_<%= plan.id %>" type="checkbox" class="compare_plan_checkbox checkbox-custom ivl-select-plan-for-comparison mr-2" data-hbx-id="<%= @hbx_enrollment.id %>" data-hios-id="<%= plan.hios_id %>" data-plan-year="<%= plan.active_year %>" data-plan-enrollment-kind="<%= @enrollment_kind %>" data-plan-change-plan="<%= @change_plan%>"></input>
<%= l10n("compare") %>
</label>
<% end %>
</div>
<div>
<div class="d-flex justify-content-between mb-3">
Expand All @@ -34,7 +52,8 @@
<%= plan.standard_plan_label.titleize %>
</span>
<% 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) %>
<span class="badge badge-pill badge-lg badge-current-plan ml-2 d-flex align-items-center">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<title>Star</title>
Expand All @@ -58,12 +77,12 @@
<div class="col-md-2 col-sm-2"><%= display_carrier_logo(Maybe.new(plan), {width: 100}) %></div>
<div class="col-md-8">
<h3 class="no-buffer">
<%= 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?%>
<span tabindex="0" class="far fa-check-square" title="Eligible for Cost Sharing Reduction" data-toggle="tooltip"></span>
<% end %>
<%= plan.name %>
<% end) %>
<% end %>
</h3>
</div>
<div class="col-md-2">
Expand Down Expand Up @@ -113,18 +132,20 @@
<div class="d-flex align-items-center justify-content-between plan-footer">
<div>
<%= render partial: "shared/plan_shoppings/sbc_link", locals: { plan: plan, custom_css: false } %>
<%= h(link_to l10n("see_details"), 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}), {:class => "primary-text ml-4", :remote => true}) %>
<% unless details_page %>
<%= link_to l10n("see_details"), 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}), {:class => "primary-text ml-4", :remote => true} %>
<% end %>
</div>
<% if (@tax_household || @aptc_grants) && params[:market_kind]=='individual' && params[:coverage_kind] == 'health' %>
<% if @csr_available && plan.metal_level != "silver" %>
<%= h(link_to l10n("select_plan"), "javascript:void(0)", class: 'btn btn-default btn-right', data: {'toggle': 'modal', 'target': "#csrEligibleReminder-#{plan.id}"}) %>
<%= h(link_to(l10n("select_plan"), "javascript:void(0)", {class: 'dn btn btn-default btn-right plan-select select', data: {url: thankyou_insured_plan_shopping_path(@hbx_enrollment, plan_id: plan.id, change_plan: @change_plan, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind)}})) %>
<%= link_to l10n("select_plan"), "javascript:void(0)", class: 'btn btn-default btn-right', data: {'toggle': 'modal', 'target': "#csrEligibleReminder-#{plan.id}"} %>
<%= link_to(l10n("select_plan"), "javascript:void(0)", {class: 'dn btn btn-default btn-right plan-select select', data: {url: thankyou_insured_plan_shopping_path(@hbx_enrollment, plan_id: plan.id, change_plan: @change_plan, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind)}}) %>
<%= render partial: "shared/csr_eligible_reminder_modal", locals: { plan: plan } %>
<% else %>
<%= h(link_to(l10n("select_plan"), "javascript:void(0)", {class: 'btn btn-default btn-right plan-select select', data: {url: thankyou_insured_plan_shopping_path(@hbx_enrollment, plan_id: plan.id, change_plan: @change_plan, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind)}})) %>
<%= link_to(l10n("select_plan"), "javascript:void(0)", {class: 'btn btn-default btn-right plan-select select', data: {url: thankyou_insured_plan_shopping_path(@hbx_enrollment, plan_id: plan.id, change_plan: @change_plan, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind)}}) %>
<% end %>
<% else %>
<%= h(link_to(l10n("select_plan"), "javascript:void(0)", {class: 'btn btn-default btn-right plan-select select', data: {url: thankyou_insured_plan_shopping_path(@hbx_enrollment, plan_id: plan.id, change_plan: @change_plan, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind)}})) %>
<%= link_to(l10n("select_plan"), "javascript:void(0)", {class: 'btn btn-default btn-right plan-select select', data: {url: thankyou_insured_plan_shopping_path(@hbx_enrollment, plan_id: plan.id, change_plan: @change_plan, market_kind: @market_kind, coverage_kind: @coverage_kind, enrollment_kind: @enrollment_kind)}}) %>
<% end %>
</div>

Expand Down
7 changes: 5 additions & 2 deletions app/views/ui-components/v1/cards/_summary.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
<% unless @hbx_enrollment.shopping? %>
<h1><%= @hbx_enrollment.coverage_year %> <%= @hbx_enrollment&.product&.kind.to_s.titleize %> <%= l10n('coverage').titleize %></h1>
<% end %>

<% unless action_name == "home" %>
<%= render partial: "insured/families/enrollment_refactored", :collection => [@hbx_enrollment], :as => :hbx_enrollment, locals: { read_only: false, details_page: true, shopping: @hbx_enrollment.shopping? } %>
<% 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, details_page: true, shopping: @hbx_enrollment.shopping? } %>
<% end %>
<% end %>

<% if display_enr_summary_is_enabled(@hbx_enrollment) %>
Expand Down
Loading