Skip to content

Commit

Permalink
bs4 home applications review (#3992)
Browse files Browse the repository at this point in the history
* upgrade to bs4 base

mc

* revert temp changes for design review to trunk

mc

* start moving FAA to use bootstrap 4 (#3855)

* 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]>

mc

* bs4 plan shopping family info & choose cov for HH pages (#3821)

* create account page plus additional translations

* immigration doc partials

* translations for other clients

* don't touch FAA yet

* app scan warnings

* app scan warnings

* app scan issues

* starting to rubocop

* navigation helper rubocop

* fix brakeman, other text changes

* app scan flags

* sanitize links

* fix link

* devise translations

* fix devise translations

* devise translations

* devise translations

* devise translations

* devise translations

* devise translations

* reformat devide translations

* reformat devide translations

* reformat devide translations

* reformat devide translations

* redo devise translations

* id bad bullets

* id bad bullet

* id bad bullet

* id bad bullet text

* previous and continue buttons dryed out

* properly sanitize link

* fix for no ssn info text

* sign in text fix

* header contact number not clickable (#3812)

add missing href attribute to link

* fix personal info step 3 content (#3819)

* fix duplicate for, fix missing asterisk for home address fields with introduction of form builder helper that builds a text field which abstracts out setting required field and asterisk append

* update helper method to allow callers to not specify class param, fix contact_info_for in other translations

* remove unrelated changes

* update race legend subtitle to be inline (#3833)

move parenthetical to inline with legend title

* remove disagree placeholder text (#3831)

remove disagree_placeholder_text div

* fix auth and consent previous button layout (#3825)

* wrap progress button in vertically aligned flex box

* combines prev and continue link partial into one partial, updates consumers of the old partials to use the new one and keep functionality

* remove unneeded div

* remove unneeded argument

* ssn number mask format (#3824)

* add mask for ssn, add mask-ssn class on text field

* update class name to not be repetitive

* use preexisting input mask for ssn

* phone number mask format (#3823)

* add script tag for phone number mask, add phone_number class on text field, update placeholder to match expected format

* replace new mask with a call to inputMasks

* add missing underscore prefix to partial (#3840)

* right align header account links (#3832)

* add ml-auto class to link column

* remove unneeded span

* adds newline for each span

* remove ml-auto class from span and adds align-items-end to both columns

* unbold demo info questions (#3836)

* localize incarcerated and citizen strings, remove asterisk from tribe_member_2 to allow space and non-space cases, add new selector to allow for unbold form labels and legends

* remove asterisk from tribal_name translation

* use weight-n instead of new class for enforcing non-bold titles in form

* add class for immigrant doc labels

* replace header content (#3838)

add new devise entry for bs4 welcome message, update controller to drive the flash message using bs4 flag

* remove repeated header text (#3839)

add translations for user roles, remove fallback on role check in portal helper, use new translation keys in portal helper

* rubocop

* give continue buttons shared selectors

* resolve ticket 187618984 previous button underlined

* ridp agreement text bold

* disabled dob on more info

* session warning pop up

* privacy spacing

* add not sure for is applying coverage

* duplicated *s for aiant question

* load correct ridp partials

* show help shopping button

* progress nav buttons cleanup

* auto build feature branch on new changes

* fix failed validation page

* start fixing rspec failures

* continuing spec work

* continuing spec work

* more spec fixes

* ridp admin actions

* rubocop fixes

* fix warning

* make bs4 layout more conditional for dc

* bs4 flag for layouts already using bs4 layout

* wlecome controller

* rubocop

* fix address and contact row spacing (#3843)

* use margin bottom 2 for first address and contact rows, wrap address hidden fields in span to lose input + label styling

* remove span, update selector to disregard hidden inputs

* fix contact method alert (#3851)

* adds localized string for contact options, update checkbox setup to use unique ids for each option and localize the label, adds missing class on BS4 checkbox span

* adds check for non-person which crashed on null check and stopped further validations in the call

* remove checked call in combined get

* unbold personal info immigration fields (#3852)

add weight-n to other status questions legend and all missing immigration doc labels

* remove extra personal info contact text (#3850)

* fix fonts, more ridp work started

* remove unneeded please provide disclaimer label

* remove weird merge tag

---------

Co-authored-by: Kristin Merbach <[email protected]>

* hide id in pre login (#3849)

update translation to just be id, update account display to only show id substring when present

* fix label for verified state (#3865)

update new verification helper to return the string matching legacy for valid case

* remove personal info step in consumer signup (#3863)

cherry pick old changes

* use warning banner for no match (#3861)

* update content for bs4, use warning banner

* padding updates

* rename translation key

* add text for missing immigrant status labels (#3864)

* adds hardcoded text for missing localized keys

* add translations for content

* move not sure link below radios (#3870)

* use grid for is_applying_for_cov elements

* remove rows and reorganize classes

* add asterisk to address line 1 and zip in personal info (#3820)

* add builder to use for DRYing creation of required text fields with asterisks

* update address 1, address 2, city, and zip fields to use the new text_field builder, update zip field to have asterisk

* localize city

* makes placeholder a required keyword param

* rename to RequirableFormBuilder, update helper to maintain both the field/select element and its label, moves asterisk to label per specs

* fixe merge order so that params override options

* remove formbuilder and hardcode asterisks in markup

* fix trailing whitespace, remove county translation

* restore add 1 class

* use required class for required fields

* add required attr for city

* add disabled class to continue link (#3872)

* add disabled class to link, remove extraneous if in button

* restores disabled if for button case

* fix missing document faq button (#3877)

* 187579400 update flash (#3854)

* add BS4 view to flash partial

* updates flash partial for bs4, updates progress and bs4 layouts to render new flash

* fix underscore on close button

* close icon work

* white space fix

* map legacy alert type to bs4, update flash layout to work well with larger messages, accessibility updates

* add success case, more whitespace cleanup

* update alert-error to use correct border and add error icon

* move container out of layout, update padding on header to match footer

* update padding and margins on flash

* simplify flash in progress layout now that we have flash in its own container

* unrelated fix for failed validations, replace old alert style, add missing legacy style in BS4 flash style map, add new alert style, update flash margin,

* adds @bs4 arguments for render_flash calls and restores horizontal status in bs4 layout

* rename flash type helper method

* update info step 1 banner (#3860)

* adds warning option to DOB error, updates error_messages partial to handle error option and use new UI

* remove left padding for list in alert

* remove unneeded classes

* remove padding style

* updates classes for error banner to match mockups

* move flash into content column for progress layout, remove mt class from flash to allow layouts to drive top margin

* ridp default select agree (#3878)

add selected args for radio buttons

* resolve spacing issues (#3875)

* fix spacing, style the info to match other info boxes

* more spacing

* consolidate spacing classes

* session modal styling (#3874)

* session modal styling

* remove unnecessary span

* consolidate spacing classes

* ridp waiting

* update upload doc verify identity modal (#3886)

* split modal partial for bs4, finish header

* add radios and upload/close buttons

* padding update

* update radio text to be blocked and centered with radio

* more padding and margin fixes

* padding update for info label

* use for to render radios

* add id

* remove unneeded value attr

* remove unneeded classes on button row

* refactor radio value and id

* use element name for legend

* removes for from legend

* remove row

* move btn-file selector to forms

* start moving FAA to use bootstrap 4 (#3855)

* 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]>

* improve ridp status badges (#3884)

* temp

* improve ridp status badges

* improve encapsulation

* rename of vars

* rename vars 2.0

* ridp fixes for previous and log out links (#3879)

* ridp link fixes

* button link hovers shouldn't have underline

* fix add mailing address functionality (#3876)

* fix mailing address js

* remove console log

* add button for existing mailing addresses

* help me sign up flow bs4 conversion started (#3887)

* help me sign up flow started

* translations and search input

* wave issues

* translations

---------

Signed-off-by: kristinmerbach <[email protected]>

* fix fonts, more ridp work started

* choose cov page wip

* plan shopping progress bars updated

* plan shopping nav refactoring

* remove debug line

* choose cov for hh progress, added pg nav buttons for first flow

* family information page progress

* family information conversion, fixed progress nav buttons

* translation fixes

* removed debugging code

* convert to html.erb

* rebase cleanup

* removed duped code  & unnecessary vars, erb convert for ps compare modal

* fix link_to CSS vunerabilities

* baseline post convrsion

* plan shopping progress refactor

* Bootstrap misc bugfixes (#3895)

fixes for 6 bug tickets

* pr feedback, small fixes

* upgrade to bs4 base

* revert temp changes for design review to trunk

* add feature flag and switch consumer role controler layout

* personal information page redo

* feature flags, faa layouts

* bs4 footer

* fix for dynamic footer

* header wip, stable

* header progress

* sticky footer fix

* header logo update, move styling to new file

* add bs4 upgrade icons, collapsed header tweaks

* started family information

* privacy page and personal information, button mixin

* registration process

* more work on consumer flow

* fix semicolon

* client specific files re-organized

* authorization & consent page

* footer updates

* footer phone # fix

* authority & consent ridp page

* progress nav accessibility

* fix fonts, more ridp work started

* added ME colors, revert app controller flag

* ridp flow

* add new progress layout

* create account page plus additional translations

* immigration doc partials

* translations for other clients

* don't touch FAA yet

* app scan warnings

* app scan warnings

* app scan issues

* starting to rubocop

* navigation helper rubocop

* fix brakeman, other text changes

* app scan flags

* sanitize links

* fix link

* devise translations

* fix devise translations

* devise translations

* devise translations

* devise translations

* devise translations

* devise translations

* reformat devide translations

* reformat devide translations

* reformat devide translations

* reformat devide translations

* redo devise translations

* id bad bullets

* id bad bullet

* id bad bullet

* id bad bullet text

* previous and continue buttons dryed out

* properly sanitize link

* fix for no ssn info text

* sign in text fix

* header contact number not clickable (#3812)

add missing href attribute to link

* fix personal info step 3 content (#3819)

* fix duplicate for, fix missing asterisk for home address fields with introduction of form builder helper that builds a text field which abstracts out setting required field and asterisk append

* update helper method to allow callers to not specify class param, fix contact_info_for in other translations

* remove unrelated changes

* update race legend subtitle to be inline (#3833)

move parenthetical to inline with legend title

* remove disagree placeholder text (#3831)

remove disagree_placeholder_text div

* fix auth and consent previous button layout (#3825)

* wrap progress button in vertically aligned flex box

* combines prev and continue link partial into one partial, updates consumers of the old partials to use the new one and keep functionality

* remove unneeded div

* remove unneeded argument

* ssn number mask format (#3824)

* add mask for ssn, add mask-ssn class on text field

* update class name to not be repetitive

* use preexisting input mask for ssn

* phone number mask format (#3823)

* add script tag for phone number mask, add phone_number class on text field, update placeholder to match expected format

* replace new mask with a call to inputMasks

* add missing underscore prefix to partial (#3840)

* right align header account links (#3832)

* add ml-auto class to link column

* remove unneeded span

* adds newline for each span

* remove ml-auto class from span and adds align-items-end to both columns

* unbold demo info questions (#3836)

* localize incarcerated and citizen strings, remove asterisk from tribe_member_2 to allow space and non-space cases, add new selector to allow for unbold form labels and legends

* remove asterisk from tribal_name translation

* use weight-n instead of new class for enforcing non-bold titles in form

* add class for immigrant doc labels

* replace header content (#3838)

add new devise entry for bs4 welcome message, update controller to drive the flash message using bs4 flag

* remove repeated header text (#3839)

add translations for user roles, remove fallback on role check in portal helper, use new translation keys in portal helper

* rubocop

* give continue buttons shared selectors

* resolve ticket 187618984 previous button underlined

* ridp agreement text bold

* disabled dob on more info

* session warning pop up

* privacy spacing

* add not sure for is applying coverage

* duplicated *s for aiant question

* load correct ridp partials

* show help shopping button

* progress nav buttons cleanup

* auto build feature branch on new changes

* fix failed validation page

* start fixing rspec failures

* continuing spec work

* continuing spec work

* more spec fixes

* ridp admin actions

* rubocop fixes

* fix warning

* make bs4 layout more conditional for dc

* bs4 flag for layouts already using bs4 layout

* wlecome controller

* rubocop

* fix address and contact row spacing (#3843)

* use margin bottom 2 for first address and contact rows, wrap address hidden fields in span to lose input + label styling

* remove span, update selector to disregard hidden inputs

* fix contact method alert (#3851)

* adds localized string for contact options, update checkbox setup to use unique ids for each option and localize the label, adds missing class on BS4 checkbox span

* adds check for non-person which crashed on null check and stopped further validations in the call

* remove checked call in combined get

* unbold personal info immigration fields (#3852)

add weight-n to other status questions legend and all missing immigration doc labels

* remove extra personal info contact text (#3850)

* fix fonts, more ridp work started

* remove unneeded please provide disclaimer label

* remove weird merge tag

---------

Co-authored-by: Kristin Merbach <[email protected]>

* hide id in pre login (#3849)

update translation to just be id, update account display to only show id substring when present

* fix label for verified state (#3865)

update new verification helper to return the string matching legacy for valid case

* remove personal info step in consumer signup (#3863)

cherry pick old changes

* use warning banner for no match (#3861)

* update content for bs4, use warning banner

* padding updates

* rename translation key

* add text for missing immigrant status labels (#3864)

* adds hardcoded text for missing localized keys

* add translations for content

* move not sure link below radios (#3870)

* use grid for is_applying_for_cov elements

* remove rows and reorganize classes

* add asterisk to address line 1 and zip in personal info (#3820)

* add builder to use for DRYing creation of required text fields with asterisks

* update address 1, address 2, city, and zip fields to use the new text_field builder, update zip field to have asterisk

* localize city

* makes placeholder a required keyword param

* rename to RequirableFormBuilder, update helper to maintain both the field/select element and its label, moves asterisk to label per specs

* fixe merge order so that params override options

* remove formbuilder and hardcode asterisks in markup

* fix trailing whitespace, remove county translation

* restore add 1 class

* use required class for required fields

* add required attr for city

* add disabled class to continue link (#3872)

* add disabled class to link, remove extraneous if in button

* restores disabled if for button case

* fix missing document faq button (#3877)

* 187579400 update flash (#3854)

* add BS4 view to flash partial

* updates flash partial for bs4, updates progress and bs4 layouts to render new flash

* fix underscore on close button

* close icon work

* white space fix

* map legacy alert type to bs4, update flash layout to work well with larger messages, accessibility updates

* add success case, more whitespace cleanup

* update alert-error to use correct border and add error icon

* move container out of layout, update padding on header to match footer

* update padding and margins on flash

* simplify flash in progress layout now that we have flash in its own container

* unrelated fix for failed validations, replace old alert style, add missing legacy style in BS4 flash style map, add new alert style, update flash margin,

* adds @bs4 arguments for render_flash calls and restores horizontal status in bs4 layout

* rename flash type helper method

* update info step 1 banner (#3860)

* adds warning option to DOB error, updates error_messages partial to handle error option and use new UI

* remove left padding for list in alert

* remove unneeded classes

* remove padding style

* updates classes for error banner to match mockups

* move flash into content column for progress layout, remove mt class from flash to allow layouts to drive top margin

* ridp default select agree (#3878)

add selected args for radio buttons

* resolve spacing issues (#3875)

* fix spacing, style the info to match other info boxes

* more spacing

* consolidate spacing classes

* session modal styling (#3874)

* session modal styling

* remove unnecessary span

* consolidate spacing classes

* ridp waiting

* update upload doc verify identity modal (#3886)

* split modal partial for bs4, finish header

* add radios and upload/close buttons

* padding update

* update radio text to be blocked and centered with radio

* more padding and margin fixes

* padding update for info label

* use for to render radios

* add id

* remove unneeded value attr

* remove unneeded classes on button row

* refactor radio value and id

* use element name for legend

* removes for from legend

* remove row

* move btn-file selector to forms

* start moving FAA to use bootstrap 4 (#3855)

* 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]>

* improve ridp status badges (#3884)

* temp

* improve ridp status badges

* improve encapsulation

* rename of vars

* rename vars 2.0

* ridp fixes for previous and log out links (#3879)

* ridp link fixes

* button link hovers shouldn't have underline

* fix add mailing address functionality (#3876)

* fix mailing address js

* remove console log

* add button for existing mailing addresses

* help me sign up flow bs4 conversion started (#3887)

* help me sign up flow started

* translations and search input

* wave issues

* translations

---------

Signed-off-by: kristinmerbach <[email protected]>

* Bootstrap misc bugfixes (#3895)

fixes for 6 bug tickets

* update bs4 content for dob personal info banner (#3883)

* update corner radius for bs4 alerts, localize dob error, switch on message when validating dob for bs4 flag

* use existing continue strings as substring in dob error

* add document list to verify identity (#3890)

* cleanup, move old list to bs4

* more list work

* layout cleanup

* more list work

* adds trash style

* destroy icon update

* adds js handling for delete

* add new js destroy

* indentation fixes

* adds aria

* use h6 for type

* fix header span

* indentation fixes, update fdish page with list changes as well

* add missing change from merge

* remove class

* refactor row classes to support mobile

* alpha tweak

* remove float-end

* remove align

* fix unmatched span

* remove align

* remove d-flex

* puts label and badge in col

* button refactor

* remove unneeded icon

* add remove padding

* margin fixes

* more layout fixes

* restore fdsh modal

* use insured modal for insured

* cleanup

* FAA eligibility results to bs4 (#3894)

* eligibility results

* waiting for eligibility

* wait for results

---------

Signed-off-by: kristinmerbach <[email protected]>

* add member to family fix

* main.scss brace fix, cleanup

* webpacker depreciation warning cleanup

* fix build error with calc

* revert sass depreciation fix attempt

* small transation & inline style fixes

* XSS fixes

---------

Signed-off-by: kristinmerbach <[email protected]>
Signed-off-by: Sarah Austin <[email protected]>
Co-authored-by: Kristin Merbach <[email protected]>
Co-authored-by: Charlie Parker <[email protected]>
Co-authored-by: kvootla <[email protected]>
Co-authored-by: Alec Turnbull <[email protected]>
Co-authored-by: kristinmerbach <[email protected]>
Co-authored-by: Alec Turnbull <[email protected]>

mc

* add bs4 UI for review, update helper to toggle edit button in applicant summary, update controller to render new UI for flag

* add application id

* fix button margins, init displayable service for review, update check on all_relationships to handle nil

* add breadcrumbs styles, add breadcrumbs for review

mc

* move progress nav styles into nav stylesheet

mc

* add translations for app detail

mc

* add family side nav partial to FA views, call from review page, update side nav list case for applications nav to handle applications and review actions for active selection

* update legacy review layout

* move review back to nav for flag off, add other subsections matching review and submit

* remove todo

* remove unneeded divs

* remove more unneeded divs

* sanitize back buttons

* restore nav from rebase

* rebase cleanup

mc

* rebase cleanup

* translation refactor

mc

* update partial from other PR

---------

Signed-off-by: kristinmerbach <[email protected]>
Co-authored-by: Sarah Austin <[email protected]>
Co-authored-by: kristinmerbach <[email protected]>
  • Loading branch information
3 people authored and bbodine1 committed Aug 10, 2024
1 parent ee13d79 commit 678f01d
Show file tree
Hide file tree
Showing 10 changed files with 606 additions and 362 deletions.
82 changes: 0 additions & 82 deletions app/javascript/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -169,88 +169,6 @@ dt {
padding-right: 1ch;
}

.progress-nav {
background-color: var(--grey-000);
border: 1px solid var(--grey-050);
border-radius: 5px;
padding: 15px 10px;
margin-bottom: $spacer;

a {
color: var(--default-font-color);
text-decoration: none;
}
}

.progress-wrapper {
padding: 0;

li {
padding: 0px;
list-style: none;
padding-right: 35px;
margin-bottom: 10px;

.vertical-line-progress {
background-color: #cacaca;
width: 2px;
height: 28px;
position: absolute;
right: 38px;
margin-top: 12px;
}

span.circle-progress {
border-radius: 50px;
background: var(--grey-000);
border: 2px solid #cacaca;
width: 12px;
height: 12px;
position: absolute;
right: 33px;
margin-top: 8px;
z-index: 5;
}

&.complete {
.vertical-line-progress {
background-color: var(--theme-primary-blue, #007bc4);
}

span.circle-progress {
background-color: var(--theme-primary-blue, #007bc4);
border: none;
width: 14px;
right: 32px;
height: 14px;
margin-top: 6px;
}
}

&.active {
font-weight: bold;
color: var(--theme-primary-blue, #007bc4);

.vertical-line-progress {
background-color: #cacaca;
}

span.circle-progress {
background-color: var(--grey-000);
border: 2px solid var(--theme-primary-blue, #007bc4);
width: 14px;
right: 32px;
height: 14px;
margin-top: 6px;
}
}

&:last-child .vertical-line-progress {
display: none;
}
}
}

#personal_info {
input:not([type='checkbox']):not([type='radio']),
select,
Expand Down
118 changes: 117 additions & 1 deletion app/javascript/css/nav.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// site header
header.navbar-primary {
font-size: 14px;
background-color: var(--grey-000);
Expand Down Expand Up @@ -87,6 +87,122 @@ header.navbar-primary {
}
}

// progress layout nav pane
.progress-nav {
background-color: var(--grey-000);
border: 1px solid var(--grey-050);
border-radius: 5px;
padding: 15px 10px;
margin-bottom: $spacer;

a {
color: var(--default-font-color);
text-decoration: none;
}
}

.progress-wrapper {
padding: 0;

li {
padding: 0px;
list-style: none;
padding-right: 35px;
margin-bottom: 10px;

.vertical-line-progress {
background-color: #cacaca;
width: 2px;
height: 28px;
position: absolute;
right: 38px;
margin-top: 12px;
}

span.circle-progress {
border-radius: 50px;
background: var(--grey-000);
border: 2px solid #cacaca;
width: 12px;
height: 12px;
position: absolute;
right: 33px;
margin-top: 8px;
z-index: 5;
}

&.complete {
.vertical-line-progress {
background-color: var(--theme-primary-blue, #007bc4);
}

span.circle-progress {
background-color: var(--theme-primary-blue, #007bc4);
border: none;
width: 14px;
right: 32px;
height: 14px;
margin-top: 6px;
}
}

&.active {
font-weight: bold;
color: var(--theme-primary-blue, #007bc4);

.vertical-line-progress {
background-color: #cacaca;
}

span.circle-progress {
background-color: var(--grey-000);
border: 2px solid var(--theme-primary-blue, #007bc4);
width: 14px;
right: 32px;
height: 14px;
margin-top: 6px;
}
}

&:last-child .vertical-line-progress {
display: none;
}
}

}

// breadcrumbs
ul.breadcrumbs {
padding: 0;
list-style: none;
margin-bottom: 3ch;
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 20px;

li {
display: inline;
a {
color: var(--text-secondary);
text-decoration: none;
}
}

li:last-of-type {
font-weight: bold;
a {
color: var(--text-primary);
}
}

li:not(:last-of-type):after {
padding: 1ch;
content: '/';
}
}

// family side nav
.portal-nav {
background: var(--primary-color);
color: var(--grey-000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ApplicationsController < FinancialAssistance::ApplicationController
before_action :set_current_person
before_action :set_family
before_action :find_application, :except => [:index, :index_with_filter, :new, :review, :raw_application]
before_action :enable_bs4_layout, only: [:application_year_selection, :application_checklist, :edit, :eligibility_results, :review_and_submit, :submit_your_application, :wait_for_eligibility_response, :preferences] if EnrollRegistry.feature_enabled?(:bs4_consumer_flow)
before_action :enable_bs4_layout, only: [:application_year_selection, :application_checklist, :edit, :eligibility_results, :review_and_submit, :review, :submit_your_application, :wait_for_eligibility_response, :preferences] if EnrollRegistry.feature_enabled?(:bs4_consumer_flow)

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

Expand All @@ -18,7 +18,7 @@ class ApplicationsController < FinancialAssistance::ApplicationController
require 'securerandom'

before_action :check_eligibility, only: [:copy]
before_action :init_cfl_service, only: [:review_and_submit, :raw_application]
before_action :init_cfl_service, only: [:review_and_submit, :review, :raw_application]
before_action :set_cache_headers, only: [:index, :relationships, :review_and_submit, :index_with_filter]

layout :resolve_layout
Expand Down Expand Up @@ -383,7 +383,7 @@ def enable_bs4_layout

def resolve_layout
case action_name
when "edit", "submit_your_application", "preferences", "review_and_submit", "step", "eligibility_response_error", "application_publish_error"
when "edit", "submit_your_application", "preferences", "review_and_submit", "review", "step", "eligibility_response_error", "application_publish_error"
EnrollRegistry.feature_enabled?(:bs4_consumer_flow) ? "financial_assistance_progress" : "financial_assistance_nav"
when "application_year_selection", "application_checklist"
EnrollRegistry.feature_enabled?(:bs4_consumer_flow) ? "financial_assistance_progress" : "financial_assistance"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ def review_benefits_esi_keys

include RowKeyTranslator

def applicant_summary_hashes(applicant)
def applicant_summary_hashes(applicant, can_edit)
def personal_info_hash(applicant)
hash = {age: applicant.age_of_the_applicant, gender: applicant.gender.humanize}
unless @all_relationships.empty?
if @all_relationships.present?
hash[:relationship] = applicant.relationship_kind_with_primary.humanize
end
hash[:status] = applicant.citizen_status.present? ? applicant.format_citizen : nil
Expand All @@ -134,7 +134,7 @@ def personal_info_hash(applicant)
return create_section_hash(title: l10n('personal_information'), rows: hash, :map => :personal_info_keys)
end

def tax_info_hash(applicant)
def tax_info_hash(applicant, can_edit)
helper = ApplicantDisplayableHelper.new(@cfl_service, applicant.id)

hash = {file_in_year: required_value(human_boolean(applicant.is_required_to_file_taxes))}
Expand All @@ -146,10 +146,16 @@ def tax_info_hash(applicant)
hash[:dependent_by] = @application.find_applicant(applicant.claimed_as_tax_dependent_by.to_s).full_name
end

return create_section_hash(title: l10n('faa.review.tax_info'), edit_link: go_to_step_application_applicant_path(@application, applicant, 1), rows: hash, :map => :tax_info_keys)
return create_section_hash(
title: l10n('faa.review.tax_info'),
can_edit: can_edit,
edit_link: go_to_step_application_applicant_path(@application, applicant, 1),
rows: hash,
:map => :tax_info_keys
)
end

def income_info_hash(applicant)
def income_info_hash(applicant, can_edit)
helper = ApplicantDisplayableHelper.new(@cfl_service, applicant.id)

hash = {from_employer: required_value(human_boolean(applicant.has_job_income))}
Expand Down Expand Up @@ -181,15 +187,26 @@ def income_info_hash(applicant)

hash[:other_sources] = required_value(human_boolean(applicant.has_other_income))

return create_section_hash(title: l10n('faa.evidence_type_income'), edit_link: application_applicant_incomes_path(@application, applicant), rows: hash, :map => :income_info_keys)
return create_section_hash(
title: l10n('faa.evidence_type_income'),
can_edit: can_edit,
edit_link: application_applicant_incomes_path(@application, applicant),
rows: hash,
:map => :income_info_keys
)
end

def deductions_info_hash(applicant)
def deductions_info_hash(applicant, can_edit)
row = {l10n('faa.deductions.income_adjustments', subject: l10n('faa.other_ques.this_person'), assistance_year: assistance_year) => required_value(human_boolean(applicant.has_deductions))}
create_section_hash(title: l10n('faa.review.income_adjustments'), edit_link: application_applicant_deductions_path(@application, applicant), rows: row)
create_section_hash(
title: l10n('faa.review.income_adjustments'),
can_edit: can_edit,
edit_link: application_applicant_deductions_path(@application, applicant),
rows: row
)
end

def coverage_info_hash(applicant)
def coverage_info_hash(applicant, can_edit)
hash = {
is_enrolled: {
value: human_boolean(applicant.has_enrolled_health_coverage),
Expand Down Expand Up @@ -236,10 +253,15 @@ def coverage_info_hash(applicant)
end
}

return create_section_hash(title: l10n('health_coverage'), edit_link: application_applicant_benefits_path(@application, applicant), rows: hash, :map => :coverage_info_keys)
return create_section_hash(
title: l10n('health_coverage'),
can_edit: can_edit,
edit_link: application_applicant_benefits_path(@application, applicant),
rows: hash,
:map => :coverage_info_keys)
end

def other_questions_hash(applicant)
def other_questions_hash(applicant, can_edit)
helper = ApplicantDisplayableHelper.new(@cfl_service, applicant.id)

hash = {}
Expand Down Expand Up @@ -296,10 +318,21 @@ def other_questions_hash(applicant)
hash[:disability_question] = human_boolean(applicant.is_physically_disabled)
end

return create_section_hash(title: l10n('faa.review.other_questions'), edit_link: other_questions_application_applicant_path(@application, applicant), rows: hash, :map => :other_questions_keys)
return create_section_hash(
title: l10n('faa.review.other_questions'),
can_edit: can_edit,
edit_link: other_questions_application_applicant_path(@application, applicant),
rows: hash,
:map => :other_questions_keys)
end

[personal_info_hash(applicant), tax_info_hash(applicant), income_info_hash(applicant), deductions_info_hash(applicant), coverage_info_hash(applicant), other_questions_hash(applicant)]
[
personal_info_hash(applicant),
tax_info_hash(applicant, can_edit),
income_info_hash(applicant, can_edit),
deductions_info_hash(applicant, can_edit),
coverage_info_hash(applicant, can_edit),
other_questions_hash(applicant, can_edit)]
end

def review_benefits_esi_hash(benefit)
Expand Down Expand Up @@ -394,8 +427,8 @@ def required_value(value)
{value: value, is_required: true}
end

def create_section_hash(title:, edit_link: nil, rows:, map: nil)
return {title: title, edit_link: edit_link, rows: map.nil? ? rows : translate_row_keys(rows, map)}
def create_section_hash(title:, can_edit: true, edit_link: nil, rows:, map: nil)
return {title: title, edit_link: can_edit ? edit_link : nil, rows: map.nil? ? rows : translate_row_keys(rows, map)}
end
end
end
Loading

0 comments on commit 678f01d

Please sign in to comment.