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

[GYR] Reorder life situations checkboxes and remove must select one logic #5595

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 0 additions & 9 deletions app/forms/life_situations_form.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
class LifeSituationsForm < QuestionsForm
set_attributes_for :intake, :was_full_time_student, :primary_us_citizen, :primary_visa, :had_disability, :was_blind
set_attributes_for :confirmation, :no_life_situations_apply
validates :no_life_situations_apply, at_least_one_or_none_of_the_above_selected: true

def at_least_one_selected
was_full_time_student == "yes" ||
primary_us_citizen == "yes" ||
had_disability == "yes" ||
was_blind == "yes" ||
primary_visa == "yes"
end

def save
modified_attributes = attributes_for(:intake)
Expand Down
6 changes: 3 additions & 3 deletions app/views/questions/life_situations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<%=t('views.questions.life_situations.help_text') %>
</p>
<div class="form-card__stacked-checkboxes spacing-above-0">
<%= f.cfa_checkbox(:had_disability, t('views.questions.life_situations.options.had_disability'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:was_blind, t('views.questions.life_situations.options.was_blind'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:was_full_time_student, t('views.questions.life_situations.options.was_full_time_student'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:primary_us_citizen, t('views.questions.life_situations.options.was_citizen'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:primary_visa, t('views.questions.life_situations.options.was_on_visa'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:was_full_time_student, t('views.questions.life_situations.options.was_full_time_student'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:was_blind, t('views.questions.life_situations.options.was_blind'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:had_disability, t('views.questions.life_situations.options.had_disability'), options: { checked_value: "yes", unchecked_value: "no" }) %>
<%= f.cfa_checkbox(:no_life_situations_apply, t("general.none_of_the_above"), options: { id: "none__checkbox", checked_value: "yes", unchecked_value: "no" }) %>
</div>

Expand Down
Loading