Skip to content

Commit

Permalink
start moving FAA to use bootstrap 4 (#3855)
Browse files Browse the repository at this point in the history
* fix fonts, more ridp work started

* start faa

* fix resolve layout

* fix resolve layout

* fix rebase issues

* pr requests and translations

---------

Signed-off-by: kristinmerbach <[email protected]>
  • Loading branch information
kristinmerbach authored and charlienparker committed Sep 16, 2024
1 parent 1003771 commit 28c6dc1
Show file tree
Hide file tree
Showing 20 changed files with 217 additions and 621 deletions.
2 changes: 1 addition & 1 deletion app/javascript/css/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ button.error, .button.error, .btn.error, .btn-error {
}

a.button:hover {
text-decoration: underline;
text-decoration: none;
cursor: pointer;
}
9 changes: 7 additions & 2 deletions app/javascript/css/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
--primary-color: #3D5D6F;
--primary-color-dark: #314A59;
--primary-color-darker: #253843;
--default-font-color: #323130;
--placeholder-color: #676767;
--placeholder-font-weight: 400;
--floatlabel-color: #767676;
--floatlabel-onclick-color:#676767;
--input-text-color: #454545;
--form-element-text-color: #454545;

--secondary-color: #3B6B90;
--secondary-color-dark: #2E5470;
Expand Down Expand Up @@ -104,7 +111,6 @@
--body-color: #FAFAFA;

--placeholder-color: #676767;
--placeholder-font-weight: 400;
--floatlabel-color: #767676;
--floatlabel-onclick-color:#676767;
--input-text-color: #454545;
Expand Down Expand Up @@ -168,7 +174,6 @@
--default-font-color: #323130;

--placeholder-color: #676767;
--placeholder-font-weight: 400;
--floatlabel-color: #767676;
--floatlabel-onclick-color:#676767;
--input-text-color: #454545;
Expand Down
1 change: 1 addition & 0 deletions app/javascript/css/contrast_level_aa.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// These will only be applied if the contrast level is set to true in the layout.
[data-contrast="true"] {
--font: Barlow, sans-serif;
--placeholder-font-weight: 400;

.warning-notice {
padding: 8px 14px 8px 14px;
Expand Down
1 change: 1 addition & 0 deletions app/javascript/css/dc.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// all contents of this file must be nested within the data-theme="dc" selector to make sure they don't leak to other clients.
[data-theme="dc"] {
--font: 'Open Sans', sans-serif;
--placeholder-font-weight: 400;
}
17 changes: 17 additions & 0 deletions app/javascript/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,15 @@ ul.list-right-section li {
.verification-update-reason {display: none}

@media screen and (max-width: 767px) {
.d-flex.sm-block {
display: block !important;
}

.progress-nav-container {
margin-left: $spacer;
margin-right: $spacer;
}

.sm-space, .col-sm {
margin-bottom: $spacer;
}
Expand Down Expand Up @@ -330,6 +339,14 @@ ul.list-right-section li {
height: 70vh;
}

.card {
border: 1px solid var(--grey-060);
border-radius: 5px;
margin-bottom: $spacer;
padding: 13px 12px;
background: var(--grey-000);
}

// modals

.backdrop-modal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@
</div>
</div>


<div class="row">
<div class="col-xs-12">
<%= (link_to 'Documents FAQ', ::EnrollRegistry[:enroll_app].setting(:submit_docs_url).item, class: "btn btn-default btn-small pull-right", target: '_blank', rel: "noopener noreferrer") %>
<%= h(link_to 'Documents FAQ', ::EnrollRegistry[:enroll_app].setting(:submit_docs_url).item, class: "btn btn-default btn-small pull-right", target: '_blank', rel: "noopener noreferrer") %>
</div>

<div class="collapse" id="docs-verification-faq">
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" data-theme="<%= ENV['CLIENT'] %>" data-contrast="t<%= EnrollRegistry.feature_enabled?(:contrast_level_aa) %>">
<html lang="en" data-theme="<%= ENV['CLIENT'] %>" data-contrast="<%= EnrollRegistry.feature_enabled?(:contrast_level_aa) %>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
Expand Down
9 changes: 7 additions & 2 deletions app/views/layouts/progress.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@
<div class="mt-4 mb-4">
<div class="container mt-4">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-3 mr-auto p-0">
<div class="col-sm-12 col-md-12 col-lg-3 mr-auto p-0 progress-nav-container">
<% step = content_for?(:step) ? yield(:step).to_i : 1 %>
<% title = content_for?(:title) ? yield(:title) : "" %>
<% title_link = content_for?(:title_link) ? yield(:title_link) : nil %>
<nav class="progress-nav">
<h3><%= title %></h3>
<% if title_link.present? %>
<h3><a href="<%= title_link %>"><i class="fa fa-arrow-circle-left white-font hh-previous-icon" aria-hidden="true"></i> <%= title %></a></h3>
<% else %>
<h3><%= title %></h3>
<% end %>
<ul class="progress-wrapper">
<%= yield(:nav_options) if content_for?(:nav_options) %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_shopping_nav_panel.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<%= h(link_to to_account_text, main_app.family_account_path, class: "button btn-block my-4 text-center #{is_complete ? 'btn-primary' : 'secondary outline'}", id: 'btn-continue') %>
<% end %>

<div style="display: flex; flex-direction: column;">
<div class=" d-flex flex-column mt-2">
<ul class="list-unstyled list-right-section">
<% if show_previous_button %>
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ class ApplicationsController < FinancialAssistance::ApplicationController

before_action :set_current_person
before_action :set_family
before_action :find_application, :except => [:index, :index_with_filter, :new]
before_action :find_application, :except => [:index, :index_with_filter, :new, :review, :raw_application]
before_action :enable_bs4_layout, only: [:application_year_selection, :application_checklist] if EnrollRegistry.feature_enabled?(:bs4_consumer_flow)

around_action :cache_current_hbx, :only => [:index_with_filter]

include ActionView::Helpers::SanitizeHelper
include ::UIHelpers::WorkflowController
include Acapi::Notifiers
include ::FileUploadHelper
include FinancialAssistance::NavigationHelper
require 'securerandom'

before_action :check_eligibility, only: [:copy]
Expand Down Expand Up @@ -44,7 +47,7 @@ class ApplicationsController < FinancialAssistance::ApplicationController
:update_application_year
]

layout "financial_assistance_nav", only: %i[edit step review_and_submit eligibility_response_error application_publish_error]
layout :resolve_layout

# We should ONLY be getting applications that are associated with PrimaryFamily of Current Person.
# DO NOT include applications from other families.
Expand Down Expand Up @@ -177,16 +180,13 @@ def application_year_selection
save_faa_bookmark(request.original_url)
set_admin_bookmark_url

respond_to do |format|
format.html { render layout: 'financial_assistance' }
end
respond_to :html
end

def application_checklist
authorize @application, :application_checklist?
save_faa_bookmark(request.original_url)
set_admin_bookmark_url

respond_to :html
end

Expand Down Expand Up @@ -398,6 +398,21 @@ def set_family
@family = @person.primary_family
end

def enable_bs4_layout
@bs4 = true
end

def resolve_layout
case action_name
when "edit", "step", "review_and_submit", "eligibility_response_error", "application_publish_error"
"financial_assistance_nav"
when %i[application_year_selection application_checklist]
EnrollRegistry.feature_enabled?(:bs4_consumer_flow) ? "financial_assistance_progress" : "financial_assistance"
else
"financial_assistance"
end
end

def determination_token_present?(application)
Rails.cache.read("application_#{application.hbx_id}_determined").present?.to_s
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

module FinancialAssistance
module ApplicationHelper
include ::FinancialAssistance::ReviewAndSubmitHelper

def to_est(datetime)
datetime.in_time_zone("Eastern Time (US & Canada)") if datetime.present?
Expand Down Expand Up @@ -212,19 +211,9 @@ def faa_relationship_options(dependent, _referer)

def applicant_currently_enrolled
if FinancialAssistanceRegistry[:has_enrolled_health_coverage].setting(:currently_enrolled).item
'Is this person currently enrolled in health coverage?'
'Is this person currently enrolled in health coverage? *'
elsif FinancialAssistanceRegistry[:has_enrolled_health_coverage].setting(:currently_enrolled_with_hra).item
'Is this person currently enrolled in health coverage or getting help paying for health coverage through a Health Reimbursement Arrangement?'
else
''
end
end

def applicant_currently_enrolled_short_key
if FinancialAssistanceRegistry[:has_enrolled_health_coverage].setting(:currently_enrolled).item
'has_enrolled_health_coverage_short'
elsif FinancialAssistanceRegistry[:has_enrolled_health_coverage].setting(:currently_enrolled_with_hra).item
'has_enrolled_health_coverage_from_hra_short'
'Is this person currently enrolled in health coverage or getting help paying for health coverage through a Health Reimbursement Arrangement? *'
else
''
end
Expand All @@ -242,23 +231,11 @@ def applicant_currently_enrolled_key

def applicant_eligibly_enrolled
if FinancialAssistanceRegistry[:has_eligible_health_coverage].setting(:currently_eligible).item
'Does this person currently have access to other health coverage that they are not enrolled in, including coverage they could get through another person?'
elsif FinancialAssistanceRegistry[:has_eligible_health_coverage].setting(:currently_eligible_with_hra).item && FinancialAssistanceRegistry.feature_enabled?(:minimum_value_standard_question)
'Does this person currently have access to health coverage or a Health Reimbursement Arrangement that they are not enrolled in?'
elsif FinancialAssistanceRegistry[:has_eligible_health_coverage].setting(:currently_eligible_with_hra).item
'Does this person currently have access to health coverage or a Health Reimbursement Arrangement that they are not enrolled in (including through another person, like a spouse or parent)?'
else
''
end
end

def applicant_eligibly_enrolled_short_key
if FinancialAssistanceRegistry[:has_eligible_health_coverage].setting(:currently_eligible).item
'has_eligible_health_coverage_short'
'Does this person currently have access to other health coverage that they are not enrolled in, including coverage they could get through another person? *'
elsif FinancialAssistanceRegistry[:has_eligible_health_coverage].setting(:currently_eligible_with_hra).item && FinancialAssistanceRegistry.feature_enabled?(:minimum_value_standard_question)
'has_eligible_health_coverage_from_hra_short'
'Does this person currently have access to health coverage or a Health Reimbursement Arrangement that they are not enrolled in? *'
elsif FinancialAssistanceRegistry[:has_eligible_health_coverage].setting(:currently_eligible_with_hra).item
'has_eligible_health_coverage_from_hra_short_min'
'Does this person currently have access to health coverage or a Health Reimbursement Arrangement that they are not enrolled in (including through another person, like a spouse or parent)? *'
else
''
end
Expand Down Expand Up @@ -302,9 +279,9 @@ def member_name_by_id(id)
::FinancialAssistance::Applicant.find(id)&.full_name
end

def immigration_document_options_submission_url(application, model, bs4)
def immigration_document_options_submission_url(application, model)
if model.try(:persisted?)
{ :remote => true, method: :put, :url => application_applicant_path(application_id: application.id, id: model.id, bs4: bs4), :as => :applicant }
{ :remote => true, method: :put, :url => application_applicant_path(application_id: application.id, id: model.id), :as => :applicant }
else
{ :remote => true, method: :post, :url => "/applications/#{application.id}/applicants", :as => :applicant }
end
Expand Down Expand Up @@ -395,77 +372,26 @@ def assistance_year
@assistance_year = year_selection_enabled ? @application.assistance_year.to_s : FinancialAssistanceRegistry[:enrollment_dates].setting(:application_year).item.constantize.new.call.value!.to_s
end

def renewal_year_select_options
options = []
(1..5).reverse_each do |year|
options << ["#{year} #{l10n('insured.preferences.renewal_year_option')}", year]
end
options << [l10n('insured.preferences.renewal_year_none', site_short_name: site_short_name), 0]
end

def faa_nav_options(step, application, applicant)
nav = {}

nav[:nav_options] = applicant.present? ? applicant_faa_nav_options(application, applicant) : no_applicant_faa_nav_options(application)
nav[:links] = true
nav[:step] = step
view_applications = (applicant.present? || step != 1) && application.is_draft?
nav[:title] = view_applications ? l10n("faa.left_nav.my_household") : l10n("faa.results.view_my_applications").titleize
nav[:title_link] = view_applications ? edit_application_path(application) : financial_assistance.applications_path
nav[:subheading] = l10n("faa.nav.applicant_subheader")

nav[:show_help_button] = true
nav[:show_exit_button] = true
nav[:show_previous_button] = false
nav[:show_account_button] = EnrollRegistry.feature_enabled?(:back_to_account_all_shop)
nav[:back_to_account_flag] = true

nav
end

def applicant_faa_nav_options(application, applicant)
[
{step: 1, label: l10n('faa.nav.tax_info'), link: go_to_step_application_applicant_path(application, applicant, 1), step_complete: applicant.tax_info_complete? },
{step: 2, label: l10n('faa.nav.job_income'), link: application_applicant_incomes_path(application, applicant), step_complete: applicant.embedded_document_section_entry_complete?(:income) },
{step: 3, label: l10n('faa.nav.other_income'), link: other_application_applicant_incomes_path(application, applicant), step_complete: applicant.embedded_document_section_entry_complete?(:other_income) },
{step: 4, label: l10n('faa.nav.income_adjustments'), link: application_applicant_deductions_path(application, applicant), step_complete: applicant.embedded_document_section_entry_complete?(:income_adjustment) },
{step: 5, label: l10n('faa.nav.health_coverage'), link: application_applicant_benefits_path(application, applicant), step_complete: applicant.embedded_document_section_entry_complete?(:health_coverage) },
{step: 6, label: l10n('faa.nav.other_questions'), link: other_questions_application_applicant_path(application, applicant), step_complete: applicant.other_questions_complete? }
]
end

def no_applicant_faa_nav_options(application)
step1_link = (application.present? && application.is_draft?) ? financial_assistance.edit_application_path(application) : "javascript:void(0);"
links = [
{step: 1, label: l10n('faa.nav.family_info'), link: step1_link}
{step: 1, label: l10n('faa.nav.family_info', link: step1_link)},
]
relationship_step = {step: 2, label: l10n('faa.nav.family_relationships'), link: "javascript:void(0);"}
review_step = {step: 2, label: l10n('faa.nav.review'), link: "javascript:void(0);"}
if application && application.incomplete_applicants?
relationship_step[:link] = nil
elsif application && application.applicants.count > 1 && application.is_draft?
relationship_step[:link] = financial_assistance.application_relationships_path(application)
end

if application&.applicants && application.applicants.count > 1
relationship_step[:link] = financial_assistance.application_relationships_path(application) if application.is_draft?
if application.applicants.count > 1
links << relationship_step
review_step[:step] = 3
end
review_step[:link] = financial_assistance.review_and_submit_application_path(application) if application.present? && application.ready_for_attestation? && application.is_draft?

review_step[:link] = financial_assistance.review_and_submit_application_path(application) if application.present? && application.ready_for_attestation? && application.is_draft?
links << review_step
end

def other_questions_prompt(key, use_applicant_name: false)
l10n("faa.other_ques.#{key}", subject: use_applicant_name ? @applicant.first_name.capitalize : l10n("faa.this_person"))
end

def hr_kind(kind, insurance_kind)
eligible_esi = kind == "is_eligible" && insurance_kind == 'employer_sponsored_insurance' && FinancialAssistanceRegistry.feature_enabled?(:minimum_value_standard_question)
term = eligible_esi ? "faa.question.#{insurance_kind}_eligible" : "faa.question.#{insurance_kind}"
l10n(term, short_name: EnrollRegistry[:enroll_app].setting(:short_name).item)
end

def insurance_kind_select_options(kind)
FinancialAssistance::Benefit.valid_insurance_kinds.map do |insurance_kind|
[hr_kind(kind, insurance_kind), insurance_kind, {:'data-esi' => display_esi_fields?(insurance_kind, kind), :'data-mvsq' => display_minimum_value_standard_question?(insurance_kind)}]
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
<% previous_year = calendar_year - 1 %>
<h1><%= l10n("faa.year_selection_header") %></h1>
<p><%= l10n("faa.year_selection_subheader") %></p>
<p><b><%= calendar_year %></b><br> <%= l10n("faa.non_oe_see_if_you_qualify_1", year: calendar_year) %><br><%= h(link_to l10n("faa.non_oe_learn_more"), FinancialAssistanceRegistry[:iap_year_selection_form].setting(:iap_year_sep_link).item, target: "_blank") %>.</p>
<p><b><%= calendar_year %></b><br> <%= l10n("faa.non_oe_see_if_you_qualify_1", year: calendar_year) %><br><%= link_to l10n("faa.non_oe_learn_more"), FinancialAssistanceRegistry[:iap_year_selection_form].setting(:iap_year_sep_link).item %>.</p>
<p><b><%= previous_year %></b><br> <%= l10n("faa.non_oe_see_if_you_qualify_2", calendar_year: calendar_year, previous_year: previous_year, site_short_name: EnrollRegistry[:enroll_app].setting(:short_name).item) %></p>
<fieldset class="mb-4">
<legend><%= l10n("faa.choose_a_plan_year") %></legend>
<div class="focus">
<label class="weight-n"><%= f.radio_button :assistance_year, calendar_year %> <%= calendar_year %></label>
<label class="weight-n"><%= f.radio_button :assistance_year, previous_year %> <%= previous_year %></label>
</div>
<label><%= f.radio_button :assistance_year, calendar_year %> <%= calendar_year %></label>
<label><%= f.radio_button :assistance_year, previous_year %> <%= previous_year %></label>
</fieldset>
<% content_for :submit_button do %>
<%= f.submit l10n("continue_next"), class: 'btn btn-continue', id: 'btn-continue', disabled: (local_assigns[:disabled].nil? ? false : disabled) %>
Expand All @@ -38,10 +36,8 @@
<p><b><%= calendar_year %></b><br> <%= l10n("faa.non_oe_see_if_you_qualify_1", year: calendar_year) %><br><%= link_to l10n("faa.non_oe_learn_more"), FinancialAssistanceRegistry[:iap_year_selection_form].setting(:iap_year_sep_link).item %>.</p>
<p><b><%= previous_year %></b><br> <%= l10n("faa.non_oe_see_if_you_qualify_2", calendar_year: calendar_year, previous_year: previous_year, site_short_name: EnrollRegistry[:enroll_app].setting(:short_name).item) %></p>
<h3><%= l10n("faa.choose_a_plan_year") %></h3>
<div class="focus">
<label><%= f.radio_button :assistance_year, calendar_year %> <%= calendar_year %></label><br>
<label><%= f.radio_button :assistance_year, previous_year %> <%= previous_year %></label>
</div>
<label><%= f.radio_button :assistance_year, calendar_year %> <%= calendar_year %></label><br>
<label><%= f.radio_button :assistance_year, previous_year %> <%= previous_year %></label>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
<% content_for :submit_button do %>
Expand Down
Loading

0 comments on commit 28c6dc1

Please sign in to comment.