diff --git a/app/assets/javascripts/qle.js.erb b/app/assets/javascripts/qle.js.erb
index 0435352243c..e2b6a7e3d32 100644
--- a/app/assets/javascripts/qle.js.erb
+++ b/app/assets/javascripts/qle.js.erb
@@ -9,7 +9,7 @@ var QLE = ( function( window, undefined ) {
function qle_question(url){
$.ajax({
type: "GET",
- data:{date_val: $("#qle_date").val(), qle_id: $("#qle_id").val()},
+ data:{date_val: $("#qle_date").val(), qle_id: $("#qle_id").val(), bs4: $("#bs4").val()},
url: "/insured/families/" + url
});
}
@@ -41,7 +41,7 @@ var QLE = ( function( window, undefined ) {
} )( window );
$(function () {
- function check_qle_date() {
+ function validate_qle_date_input() {
var date_value = $('#qle_date').val();
if(date_value == "" || isNaN(Date.parse(date_value))) { return false; }
return true;
@@ -52,14 +52,15 @@ $(function () {
$('#qle-details .error-info').addClass('hidden');
$('#qle-details #qle-date-chose').removeClass('hidden');
$("#qle_date").val("");
+ $('#qle-nav').removeClass('hidden');
var errorNotice = "Based on the information you entered, you may be eligible for a special enrollment period. Please call us at <%= EnrollRegistry[:enroll_app].setting(:health_benefit_exchange_authority_phone_number)&.item %> to give us more information so we can see if you qualify.";
$("#qle-details .error-text").html(errorNotice);
}
- function get_qle_date() {
+ function check_qle_date() {
$.ajax({
type: "GET",
- data:{date_val: $("#qle_date").val(), qle_id: $("#qle_id").val(), qle_reason_val: $("input:radio[name=reason]:checked").val()},
+ data:{date_val: $("#qle_date").val(), qle_id: $("#qle_id").val(), qle_reason_val: $("input:radio[name=reason]:checked").val(), bs4: $("#bs4").val()},
url: "/insured/families/check_qle_date.js"
});
}
@@ -90,6 +91,14 @@ $(function () {
dateFormat: 'mm/dd/yy',
defaultDate: cdate
});
+
+ $(".sep-date #qle_date").on("change", function(){
+ if ($(".sep-date #qle_date").val()) {
+ $('#qle_submit').removeAttr('disabled');
+ } else {
+ $('#qle_submit').attr('disabled', 'disabled');
+ }
+ });
}
$(document).on('click', 'a.qle-menu-item', function() {
@@ -105,8 +114,10 @@ $(function () {
$('.qle-label').html($(this).data('label'));
$('#change_plan').val($(this).data('title'));
$('#qle_id').val($(this).data('id'));
- $('#qle_reason .special_qle_reasons').addClass('hidden');
+ $('#qle_reason > *').addClass('hidden');
$('#qle-date-chose').show();
+ $('.sep-date #qle_submit').attr('disabled', 'disabled');
+ $('#qle-nav').addClass('hidden');
var is_self_attested = $(this).data('is-self-attested');
if (!is_self_attested) {
$('#qle-date-chose').addClass('hidden');
@@ -162,6 +173,11 @@ $(function () {
$('#qle_flow_info #qle-menu').show();
});
+ $('.sep-modal.modal').on('hide.bs.modal', function() {
+ init_qle_message();
+ $('#qle-details').addClass('hidden');
+ });
+
$(document).on('click', '#qle-details-for-existing-sep .close-popup, #qle-details-for-existing-sep .cancel', function() {
//init_qle_message();
//$('.seps-panel').removeClass('hidden');
@@ -173,6 +189,10 @@ $(function () {
// Disable form submit on pressing Enter, instead click Submit link
$('#qle_form').on('keydown', function(e) {
var code = e.keyCode || e.which;
+ if ($("#qle-nav").length > 0) {
+ return false;
+ }
+
if (code == 13 && !$("div.n-radio-row").is(":focus") && !$("a.btn-primary").is(":focus")) {
e.preventDefault();
$("#qle_submit").click();
@@ -187,11 +207,12 @@ $(function () {
/* QLE Date Validator */
$(document).off('click', '#qle_submit')
$(document).on('click', '#qle_submit', function() {
- if(check_qle_date()) {
+ if(validate_qle_date_input()) {
$('#qle_date').removeClass('input-error');
+ $('#date-nav').addClass('hidden');
if(QLE.check_qle_reason()){
- get_qle_date();
+ check_qle_date();
}
} else {
$('#qle_date').addClass('input-error');
@@ -203,7 +224,7 @@ $(function () {
var not_expected_response = ( health_message ) ? 'no' : 'yes';
if( $("input:radio[name=reason]:checked").val() != 'None of the Above' && $("input:radio[name=reason]:checked").val() != not_expected_response){
- get_qle_date();
+ check_qle_date();
} else {
$('#qle_reason').hide();
var errorNoticeAction = "Based on the information you have provided, you are not eligible for this special enrollment period. If you have questions or would like to provide additional information, please contact <%= EnrollRegistry[:enroll_app].setting(:short_name).item %> customer service at <%= EnrollRegistry[:enroll_app].setting(:contact_center_short_number).item %>.";
@@ -243,6 +264,14 @@ $(function () {
}
});
+ $(document).on('change', '#effective_on_kind', function(e) {
+ if ($('#effective_on_kind').find(":selected").val()){
+ $('#qle_success_submit').removeAttr('disabled');
+ } else {
+ $('#qle_success_submit').attr('disabled', 'disabled');
+ }
+ });
+
$(document).on('submit', '.qle-detail-for-existing-kind', function(e) {
if($('#qle_date').val() == ''){
$('#qle_effective_on_kind_alert-4').removeClass('hidden');
@@ -260,4 +289,8 @@ $(function () {
});
}
});
+
+ $(document).on('click', '#shop-link', function() {
+ $('#qle_success_submit').trigger('click');
+ });
});
diff --git a/app/controllers/insured/families_controller.rb b/app/controllers/insured/families_controller.rb
index 76c4aeae3c2..fa7e098dd4e 100644
--- a/app/controllers/insured/families_controller.rb
+++ b/app/controllers/insured/families_controller.rb
@@ -5,6 +5,8 @@ class Insured::FamiliesController < FamiliesController
include Config::SiteConcern
include Insured::FamiliesHelper
+ layout :resolve_layout
+ before_action :enable_bs4_layout, only: [:find_sep, :record_sep, :check_qle_date, :check_move_reason, :check_marriage_reason, :check_insurance_reason, :personal] if EnrollRegistry.feature_enabled?(:bs4_consumer_flow)
before_action :updateable?, only: [:delete_consumer_broker, :record_sep, :purchase, :upload_notice]
before_action :init_qualifying_life_events, only: [:home, :manage_family, :find_sep]
before_action :check_for_address_info, only: [:find_sep, :home]
@@ -139,7 +141,7 @@ def find_sep
end
respond_to do |format|
- format.html { render :layout => 'application' }
+ format.html
end
end
@@ -151,7 +153,7 @@ def record_sep
special_enrollment_period = @family.special_enrollment_periods.new(effective_on_kind: params[:effective_on_kind])
special_enrollment_period.selected_effective_on = Date.strptime(params[:effective_on_date], "%m/%d/%Y") if params[:effective_on_date].present?
special_enrollment_period.qualifying_life_event_kind = qle
- special_enrollment_period.qle_on = Date.strptime(params[:qle_date], "%m/%d/%Y")
+ special_enrollment_period.qle_on = get_date(:qle_date)
special_enrollment_period.market_kind = qle.market_kind == "individual" ? "ivl" : qle.market_kind
special_enrollment_period.save
end
@@ -175,7 +177,6 @@ def personal
@person.resident_role.build_nested_models_for_person if @person.is_resident_role_active?
@resident = @person.is_resident_role_active?
- @bs4 = true if params[:bs4] == "true"
respond_to do |format|
format.html
format.js
@@ -249,7 +250,7 @@ def check_qle_date
today = TimeKeeper.date_of_record
start_date = today - 30.days
end_date = today + 30.days
- @qle_event_date = Date.strptime(params[:date_val], "%m/%d/%Y")
+ @qle_event_date = get_date(:date_val)
if params[:qle_id].present?
@qle = QualifyingLifeEventKind.find(params[:qle_id])
@@ -372,7 +373,7 @@ def purchase
@terminate_date = fetch_terminate_date(params["terminate_date_#{@enrollment.hbx_id}"]) if @terminate.present?
@terminate_reason = params[:terminate_reason] || ''
respond_to do |format|
- format.html { render :layout => 'application' }
+ format.html
end
else
redirect_to :back
@@ -660,7 +661,7 @@ def notice_upload_secure_message(notice, subject)
end
def calculate_dates
- @qle_event_date = Date.strptime(params[:date_val], "%m/%d/%Y")
+ @qle_event_date = get_date(:date_val)
@qle = QualifyingLifeEventKind.find(params[:qle_id])
@qle_date = @qle.qle_event_date_kind == :qle_on ? @qle_event_date : TimeKeeper.date_of_record
start_date = TimeKeeper.date_of_record - @qle.post_event_sep_in_days.try(:days)
@@ -677,4 +678,26 @@ def calculate_dates
end
end
+
+ def get_date(date_param)
+ date_format = @bs4 ? "%Y-%m-%d" : "%m/%d/%Y"
+ Date.strptime(params[date_param], date_format)
+ end
+
+ def conditionally_bs4_enabled_actions
+ %i[record_sep check_qle_date check_move_reason check_marriage_reason check_insurance_reason personal]
+ end
+
+ def enable_bs4_layout
+ @bs4 = conditionally_bs4_enabled_actions.include?(action_name) ? params[:bs4] == "true" : true
+ end
+
+ def resolve_layout
+ case action_name
+ when "find_sep"
+ EnrollRegistry.feature_enabled?(:bs4_consumer_flow) ? "progress" : "application"
+ when "purchase"
+ "application"
+ end
+ end
end
diff --git a/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb
index 91bd5cb825a..be208bf1548 100644
--- a/app/helpers/navigation_helper.rb
+++ b/app/helpers/navigation_helper.rb
@@ -34,6 +34,14 @@ def local_assigned_boolean(local, default)
local == "true"
end
+ def special_enrollment_period_hash
+ if @change_plan.blank?
+ sep_nav_options
+ else
+ sep_shop_for_plans_nav_options
+ end
+ end
+
def family_info_progress_hash
if @change_plan.present?
qle_nav_options
diff --git a/app/views/insured/families/_effective_on_kind_fields.html.erb b/app/views/insured/families/_effective_on_kind_fields.html.erb
index 99c606ab7cc..a10371341b2 100644
--- a/app/views/insured/families/_effective_on_kind_fields.html.erb
+++ b/app/views/insured/families/_effective_on_kind_fields.html.erb
@@ -1,12 +1,18 @@
<% if @qle.effective_on_kinds.count > 1 %>
-
<%= l10n(".please_select_effective_date") %>
-
- <%= select_tag 'effective_on_kind', options_for_select(generate_options_for_effective_on_kinds(@qle, @qle_event_date)), include_blank: "#{l10n('.select_effective_date').to_s.upcase} *" %>
-
+ <% if @bs4 %>
+
+ <%= l10n('please_select_effective_date') %>
+ <%= select_tag 'effective_on_kind', options_for_select(generate_options_for_effective_on_kinds(@qle, @qle_event_date)), include_blank: l10n("select"), class: "col-auto pr-4" %>
+
+ <% else %>
+ <%= l10n(".please_select_effective_date") %>
+
+ <%= select_tag 'effective_on_kind', options_for_select(generate_options_for_effective_on_kinds(@qle, @qle_event_date)), include_blank: "#{l10n('.select_effective_date').to_s.upcase} *" %>
+
+
+ <% end %>
<% else %>
<%= hidden_field_tag 'effective_on_kind', @qle.effective_on_kinds.first %>
-<% end %>
-
-
\ No newline at end of file
+<% end %>
\ No newline at end of file
diff --git a/app/views/insured/families/_insurance_fields.html.erb b/app/views/insured/families/_insurance_fields.html.erb
index 70109b02458..c4e358c78b8 100644
--- a/app/views/insured/families/_insurance_fields.html.erb
+++ b/app/views/insured/families/_insurance_fields.html.erb
@@ -1,35 +1,63 @@
-
- <% translation_keys = {
- contact_center_phone_number: EnrollRegistry[:enroll_app].settings(:contact_center_short_number).item,
- contact_center_tty_number: EnrollRegistry[:enroll_app].settings(:contact_center_tty_number).item,
- contact_center_name: EnrollRegistry[:enroll_app].settings(:contact_center_name).item
- } %>
-
- <% if EnrollRegistry.feature_enabled?(:is_your_health_coverage_ending_expanded_question) %>
- <%= l10n("insured.is_your_health_coverage_ending_expanded", translation_keys) %>
- <% else %>
- <%= l10n("insured.is_your_health_coverage_ending") %>
- <% end %>
-
-
-
-
-
- <%= radio_button_tag :reason, "yes", !EnrollRegistry.feature_enabled?(:default_is_your_health_coverage_ending_no), id: 'reason_accept', class: "n-radio" %>
-
- <%= l10n("yes") %>
-
-
-
-
+<% if @bs4 %>
+
+
+ <% if EnrollRegistry.feature_enabled?(:is_your_health_coverage_ending_expanded_question) %>
+ <%= l10n("insured.is_your_health_coverage_ending_expanded", contact_center_phone_number: EnrollRegistry[:enroll_app].settings(:contact_center_short_number).item, contact_center_tty_number: EnrollRegistry[:enroll_app].settings(:contact_center_tty_number).item, contact_center_name: EnrollRegistry[:enroll_app].settings(:contact_center_name).item) %>
+
+ <% else %>
+ <%= l10n("insured.is_your_health_coverage_ending") %>
+ <% end %>
+
+
+
+ <%= radio_button_tag :reason, "yes", !EnrollRegistry.feature_enabled?(:default_is_your_health_coverage_ending_no), id: 'reason_accept' %>
+ <%= l10n("yes") %>
+
+
+
+
<%= radio_button_tag :reason, "no", EnrollRegistry.feature_enabled?(:default_is_your_health_coverage_ending_no), id: 'reason_accept1', class: "n-radio" %>
-
- <%= l10n("no") %>
-
-
+ <%= l10n("no") %>
+
+
+
+ <%= render partial: 'shared/progress_navigation_buttons', locals: {button_type: "button", button_id: "qle_submit_reason"} %>
-
- <%= link_to l10n("continue").to_s.upcase, 'javascript:;', class: 'btn btn-primary btn-md', id: 'qle_submit_reason' %>
+
+<% else %>
+
+ <% translation_keys = {
+ contact_center_phone_number: EnrollRegistry[:enroll_app].settings(:contact_center_short_number).item,
+ contact_center_tty_number: EnrollRegistry[:enroll_app].settings(:contact_center_tty_number).item,
+ contact_center_name: EnrollRegistry[:enroll_app].settings(:contact_center_name).item
+ } %>
+
+ <% if EnrollRegistry.feature_enabled?(:is_your_health_coverage_ending_expanded_question) %>
+ <%= l10n("insured.is_your_health_coverage_ending_expanded", translation_keys) %>
+ <% else %>
+ <%= l10n("insured.is_your_health_coverage_ending") %>
+ <% end %>
+
+
+
+
+
+ <%= radio_button_tag :reason, "yes", !EnrollRegistry.feature_enabled?(:default_is_your_health_coverage_ending_no), id: 'reason_accept', class: "n-radio" %>
+
+ <%= l10n("yes") %>
+
+
+
+
+ <%= radio_button_tag :reason, "no", EnrollRegistry.feature_enabled?(:default_is_your_health_coverage_ending_no), id: 'reason_accept1', class: "n-radio" %>
+
+ <%= l10n("no") %>
+
+
+
+
+ <%= link_to l10n("continue").to_s.upcase, 'javascript:;', class: 'btn btn-primary btn-md', id: 'qle_submit_reason' %>
+
-
+<% end %>
diff --git a/app/views/insured/families/_marriage_fields.html.erb b/app/views/insured/families/_marriage_fields.html.erb
index 5cebac623d4..b9fbeab7873 100644
--- a/app/views/insured/families/_marriage_fields.html.erb
+++ b/app/views/insured/families/_marriage_fields.html.erb
@@ -1,24 +1,49 @@
-
-
Did you or your spouse have health insurance for at least one day between <%= @qle_date_calc %> and <%= @qle_date %> ?
-
-
-
-
- <%= radio_button_tag :reason, "no", false, id: 'reason_accept1', class: "n-radio" %>
-
- yes
-
-
-
-
- <%= radio_button_tag :reason, "yes", true, id: 'reason_accept', class: "n-radio" %>
-
- no
-
+<% if @bs4 %>
+
+
<%= l10n("insured.qle_detail.special_reason.marriage", qle_start_date: @qle_date_calc, qle_date: @qle_date) %>
+
+
+
+
+ <%= radio_button_tag :reason, "no", false, id: 'reason_accept1' %>
+ <%= l10n("yes") %>
+
+
+
+
+ <%= radio_button_tag :reason, "yes", true, id: 'reason_accept', class: "n-radio" %>
+ <%= l10n("no") %>
+
+
+
+ <%= render partial: 'shared/progress_navigation_buttons', locals: {button_type: "button", button_id: "qle_submit_reason"} %>
+
-
- <%= link_to 'CONTINUE', 'javascript:;', class: 'btn btn-primary btn-md', id: 'qle_submit_reason' %>
+
+<% else %>
+
+
Did you or your spouse have health insurance for at least one day between <%= @qle_date_calc %> and <%= @qle_date %> ?
+
+
+
+
+ <%= radio_button_tag :reason, "no", false, id: 'reason_accept1', class: "n-radio" %>
+
+ yes
+
+
+
+
+ <%= radio_button_tag :reason, "yes", true, id: 'reason_accept', class: "n-radio" %>
+
+ no
+
+
+
+
+ <%= link_to 'CONTINUE', 'javascript:;', class: 'btn btn-primary btn-md', id: 'qle_submit_reason' %>
+
-
\ No newline at end of file
+<% end %>
\ No newline at end of file
diff --git a/app/views/insured/families/_moving_fields.html.erb b/app/views/insured/families/_moving_fields.html.erb
index 42eb453f698..fb283d2ed25 100644
--- a/app/views/insured/families/_moving_fields.html.erb
+++ b/app/views/insured/families/_moving_fields.html.erb
@@ -1,66 +1,119 @@
-
-
<%= l10n("insured.indicate_following_circumstances_apply_to_you") %>:
-
-
-
-
- <%= radio_button_tag :reason, "", true, id: 'reason_accept', class: "n-radio zip-check" %>
-
-
-
-
-
-
- <%= radio_button_tag :reason, "I was living outside the US or in a US territory", false, id: 'reason_accept1', class: "n-radio" %>
-
- <%= l10n("insured.living_outside_the_US_or_in_US_territory") %>
-
-
-
-
- <%= radio_button_tag :reason, "I had income below 100% of the Federal Poverty Level and was living in a state that had not expanded Medicaid (tool-tip below)", false, id: 'reason_accept2', class: "n-radio zip-check"%>
-
-
- <%= l10n("insured.moving_fields_had_income_below_of_the_federal_poverty_level") %> <%= h(link_to("(Use the calculator to see if you qualify)", 'http://www.healthcare.gov/lower-costs', target: :_blank, rel: "noopener noreferrer")) if individual_market_is_enabled? %>
-
-
-
-
-
- <%= radio_button_tag :reason, "None of the Above", false, id:'reason_reject', class: "n-radio" %>
-
- <%= l10n("none_of_the_above") %>
-
+<% if @bs4 %>
+
+
<%= l10n("insured.indicate_following_circumstances_apply_to_you") %>:
+
+
+ <%= radio_button_tag :reason, "", true, id: 'reason_accept', class: "zip-check" %>
+ <%= l10n('insured.qle_detail.special_reason.move', qle_start_date: @qle_date_calc, qle_date: @qle_date) %>
+
+
+
+
+ <%= radio_button_tag :reason, "I was living outside the US or in a US territory", false, id: 'reason_accept1' %>
+ <%= l10n("insured.living_outside_the_US_or_in_US_territory") %>
+
+
+
+
+ <%= radio_button_tag :reason, "I had income below 100% of the Federal Poverty Level and was living in a state that had not expanded Medicaid (tool-tip below)", false, id: 'reason_accept2', class: "zip-check"%>
+ <%= l10n("insured.moving_fields_had_income_below_of_the_federal_poverty_level") %> <%= h(link_to(l10n("insured.qle_detail.special_reason.move.calculator"), 'http://www.healthcare.gov/lower-costs', target: :_blank, rel: "noopener noreferrer")) if individual_market_is_enabled? %>
+
+
+
+
+ <%= radio_button_tag :reason, "None of the Above", false, id:'reason_reject' %>
+ <%= l10n("none_of_the_above") %>
+
+
+
+ <%= render partial: 'shared/progress_navigation_buttons', locals: {button_type: "button", button_id: "qle_submit_reason"} %>
+
+
+
+
<%= l10n("insured.qle_detail.special_reason.move.enter_zip") %>
+
+
+ <%= l10n("insured.qle_detail.special_reason.move.old_zip") %>
+
+
+
+ <%= l10n("insured.qle_detail.special_reason.move.new_zip") %>
+
+
+
+ <%= render partial: 'shared/progress_navigation_buttons', locals: {button_type: "button", button_id: "qle_zip_compare"} %>
+
-
- <%= link_to l10n('continue').to_s.upcase, 'javascript:;', class: 'btn btn-primary btn-md', id: 'qle_submit_reason' %>
+
+
+<% else %>
+
+
<%= l10n("insured.indicate_following_circumstances_apply_to_you") %>:
+
+
+
+
+ <%= radio_button_tag :reason, "", true, id: 'reason_accept', class: "n-radio zip-check" %>
+
+ <%= l10n('insured.qle_detail.special_reason.move', qle_start_date: @qle_date_calc, qle_date: @qle_date) %>
+
+
+
+
+ <%= radio_button_tag :reason, "I was living outside the US or in a US territory", false, id: 'reason_accept1', class: "n-radio" %>
+
+ <%= l10n("insured.living_outside_the_US_or_in_US_territory") %>
+
+
+
+
+ <%= radio_button_tag :reason, "I had income below 100% of the Federal Poverty Level and was living in a state that had not expanded Medicaid (tool-tip below)", false, id: 'reason_accept2', class: "n-radio zip-check"%>
+
+
+ <%= l10n("insured.moving_fields_had_income_below_of_the_federal_poverty_level") %> <%= h(link_to("(Use the calculator to see if you qualify)", 'http://www.healthcare.gov/lower-costs', target: :_blank, rel: "noopener noreferrer")) if individual_market_is_enabled? %>
+
+
+
+
+
+ <%= radio_button_tag :reason, "None of the Above", false, id:'reason_reject', class: "n-radio" %>
+
+ <%= l10n("none_of_the_above") %>
+
+
+
+ <%= link_to l10n('continue').to_s.upcase, 'javascript:;', class: 'btn btn-primary btn-md', id: 'qle_submit_reason' %>
+
-
-
-