From 83877dae69f491451a2910ac5728896eae4a79f0 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:13:16 +0000 Subject: [PATCH] Extract lettings household needs copy (#2729) --- .../lettings/pages/type_of_access_needs.rb | 2 +- .../form/lettings/questions/armedforces.rb | 3 - .../lettings/questions/condition_effects.rb | 3 - .../form/lettings/questions/housingneeds.rb | 3 - .../lettings/questions/housingneeds_other.rb | 4 +- .../lettings/questions/housingneeds_type.rb | 4 +- app/models/form/lettings/questions/illness.rb | 3 - app/models/form/lettings/questions/leftreg.rb | 3 - .../form/lettings/questions/preg_occ.rb | 3 - .../form/lettings/questions/reservist.rb | 3 - .../lettings/subsections/household_needs.rb | 1 + .../2023/lettings/household_needs.en.yml | 58 +++++++++++++++++++ .../2024/lettings/household_needs.en.yml | 58 +++++++++++++++++++ 13 files changed, 120 insertions(+), 28 deletions(-) create mode 100644 config/locales/forms/2023/lettings/household_needs.en.yml create mode 100644 config/locales/forms/2024/lettings/household_needs.en.yml diff --git a/app/models/form/lettings/pages/type_of_access_needs.rb b/app/models/form/lettings/pages/type_of_access_needs.rb index 670e2ef89..25b4fe187 100644 --- a/app/models/form/lettings/pages/type_of_access_needs.rb +++ b/app/models/form/lettings/pages/type_of_access_needs.rb @@ -2,7 +2,7 @@ class Form::Lettings::Pages::TypeOfAccessNeeds < ::Form::Page def initialize(id, hsh, subsection) super @id = "type_of_access_needs" - @header = "Disabled access needs" + @copy_key = "lettings.household_needs.housingneeds_type" @depends_on = [{ "housingneeds" => 1 }] end diff --git a/app/models/form/lettings/questions/armedforces.rb b/app/models/form/lettings/questions/armedforces.rb index d7f8e44f2..25dbeff86 100644 --- a/app/models/form/lettings/questions/armedforces.rb +++ b/app/models/form/lettings/questions/armedforces.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question def initialize(id, hsh, page) super @id = "armedforces" - @check_answer_label = "Household links to UK armed forces" - @header = "Does anybody in the household have any links to the UK armed forces?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/condition_effects.rb b/app/models/form/lettings/questions/condition_effects.rb index de5c188f0..1821f6e98 100644 --- a/app/models/form/lettings/questions/condition_effects.rb +++ b/app/models/form/lettings/questions/condition_effects.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question def initialize(id, hsh, page) super @id = "condition_effects" - @check_answer_label = "How is person affected by condition or illness" - @header = "How is the person affected by their condition or illness?" @type = "checkbox" @check_answers_card_number = 0 - @hint_text = "Select all that apply." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/housingneeds.rb b/app/models/form/lettings/questions/housingneeds.rb index 3d3369d68..03c80d5cb 100644 --- a/app/models/form/lettings/questions/housingneeds.rb +++ b/app/models/form/lettings/questions/housingneeds.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question def initialize(id, hsh, page) super @id = "housingneeds" - @check_answer_label = "Anybody with disabled access needs" - @header = "Does anybody in the household have any disabled access needs?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/housingneeds_other.rb b/app/models/form/lettings/questions/housingneeds_other.rb index e8fa2c0f9..75834d3bb 100644 --- a/app/models/form/lettings/questions/housingneeds_other.rb +++ b/app/models/form/lettings/questions/housingneeds_other.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question def initialize(id, hsh, page) super @id = "housingneeds_other" - @check_answer_label = "Other disabled access needs" - @header = "Do they have any other disabled access needs?" + @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_other" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/housingneeds_type.rb b/app/models/form/lettings/questions/housingneeds_type.rb index a3de7223d..50b9c3742 100644 --- a/app/models/form/lettings/questions/housingneeds_type.rb +++ b/app/models/form/lettings/questions/housingneeds_type.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question def initialize(id, hsh, page) super @id = "housingneeds_type" - @check_answer_label = "Disabled access needs" - @header = "What type of access needs do they have?" + @copy_key = "lettings.household_needs.housingneeds_type.housingneeds_type" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/illness.rb b/app/models/form/lettings/questions/illness.rb index 20b76bec4..f92a7a04a 100644 --- a/app/models/form/lettings/questions/illness.rb +++ b/app/models/form/lettings/questions/illness.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Illness < ::Form::Question def initialize(id, hsh, page) super @id = "illness" - @check_answer_label = "Anybody in household with physical or mental health condition" - @header = "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/leftreg.rb b/app/models/form/lettings/questions/leftreg.rb index 3868d5ce7..9b90566cf 100644 --- a/app/models/form/lettings/questions/leftreg.rb +++ b/app/models/form/lettings/questions/leftreg.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question def initialize(id, hsh, page) super @id = "leftreg" - @check_answer_label = "Person still serving in UK armed forces" - @header = "Is the person still serving in the UK armed forces?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/preg_occ.rb b/app/models/form/lettings/questions/preg_occ.rb index a733fc806..1ad1bd1f5 100644 --- a/app/models/form/lettings/questions/preg_occ.rb +++ b/app/models/form/lettings/questions/preg_occ.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question def initialize(id, hsh, page) super @id = "preg_occ" - @check_answer_label = "Anybody in household pregnant" - @header = "Is anybody in the household pregnant?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/reservist.rb b/app/models/form/lettings/questions/reservist.rb index d411f96e7..023f1655d 100644 --- a/app/models/form/lettings/questions/reservist.rb +++ b/app/models/form/lettings/questions/reservist.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reservist < ::Form::Question def initialize(id, hsh, page) super @id = "reservist" - @check_answer_label = "Person seriously injured or ill as result of serving in UK armed forces" - @header = "Was the person seriously injured or ill as a result of serving in the UK armed forces?" @type = "radio" @check_answers_card_number = 0 - @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/subsections/household_needs.rb b/app/models/form/lettings/subsections/household_needs.rb index 2f6900f4f..3bfbbb336 100644 --- a/app/models/form/lettings/subsections/household_needs.rb +++ b/app/models/form/lettings/subsections/household_needs.rb @@ -2,6 +2,7 @@ class Form::Lettings::Subsections::HouseholdNeeds < ::Form::Subsection def initialize(id, hsh, section) super @id = "household_needs" + @copy_key = "lettings.household_needs.housingneeds_type" @label = "Household needs" @depends_on = [{ "non_location_setup_questions_completed?" => true }] end diff --git a/config/locales/forms/2023/lettings/household_needs.en.yml b/config/locales/forms/2023/lettings/household_needs.en.yml new file mode 100644 index 000000000..1e1a2823e --- /dev/null +++ b/config/locales/forms/2023/lettings/household_needs.en.yml @@ -0,0 +1,58 @@ +en: + forms: + 2023: + lettings: + household_needs: + armedforces: + page_header: "" + check_answer_label: "Household links to UK armed forces" + hint_text: "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." + question_text: "Does anybody in the household have any links to the UK armed forces?" + + leftreg: + page_header: "" + check_answer_label: "Person still serving in UK armed forces" + hint_text: "" + question_text: "Is the person still serving in the UK armed forces?" + + reservist: + page_header: "" + check_answer_label: "Person seriously injured or ill as result of serving in UK armed forces" + hint_text: "" + question_text: "Was the person seriously injured or ill as a result of serving in the UK armed forces?" + + preg_occ: + page_header: "" + check_answer_label: "Anybody in household pregnant" + hint_text: "" + question_text: "Is anybody in the household pregnant?" + + housingneeds: + page_header: "" + check_answer_label: "Anybody with disabled access needs" + hint_text: "" + question_text: "Does anybody in the household have any disabled access needs?" + + housingneeds_type: + page_header: "Disabled access needs" + housingneeds_type: + check_answer_label: "Disabled access needs" + hint_text: "" + question_text: "What type of access needs do they have?" + housingneeds_other: + check_answer_label: "Other disabled access needs" + hint_text: "" + question_text: "Do they have any other disabled access needs?" + + illness: + page_header: "" + check_answer_label: "Anybody in household with physical or mental health condition" + hint_text: "" + question_text: "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?" + + condition_effects: + page_header: "" + check_answer_label: "How is person affected by condition or illness" + hint_text: "Select all that apply." + question_text: "How is the person affected by their condition or illness?" + \ No newline at end of file diff --git a/config/locales/forms/2024/lettings/household_needs.en.yml b/config/locales/forms/2024/lettings/household_needs.en.yml new file mode 100644 index 000000000..d934be355 --- /dev/null +++ b/config/locales/forms/2024/lettings/household_needs.en.yml @@ -0,0 +1,58 @@ +en: + forms: + 2024: + lettings: + household_needs: + armedforces: + page_header: "" + check_answer_label: "Household links to UK armed forces" + hint_text: "This excludes national service.

If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner." + question_text: "Does anybody in the household have any links to the UK armed forces?" + + leftreg: + page_header: "" + check_answer_label: "Person still serving in UK armed forces" + hint_text: "" + question_text: "Is the person still serving in the UK armed forces?" + + reservist: + page_header: "" + check_answer_label: "Person seriously injured or ill as result of serving in UK armed forces" + hint_text: "" + question_text: "Was the person seriously injured or ill as a result of serving in the UK armed forces?" + + preg_occ: + page_header: "" + check_answer_label: "Anybody in household pregnant" + hint_text: "" + question_text: "Is anybody in the household pregnant?" + + housingneeds: + page_header: "" + check_answer_label: "Anybody with disabled access needs" + hint_text: "" + question_text: "Does anybody in the household have any disabled access needs?" + + housingneeds_type: + page_header: "Disabled access needs" + housingneeds_type: + check_answer_label: "Disabled access needs" + hint_text: "" + question_text: "What type of access needs do they have?" + housingneeds_other: + check_answer_label: "Other disabled access needs" + hint_text: "" + question_text: "Do they have any other disabled access needs?" + + illness: + page_header: "" + check_answer_label: "Anybody in household with physical or mental health condition" + hint_text: "" + question_text: "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?" + + condition_effects: + page_header: "" + check_answer_label: "How is person affected by condition or illness" + hint_text: "Select all that apply." + question_text: "How is the person affected by their condition or illness?" + \ No newline at end of file