Browse Source

CLDC-3659: Pull sales household situation questions copy into translation file (#2701)

* CLDC-3659: Pull sales household situation questions copy into translation file

* Fix header->question_text
pull/2731/head
Rachael Booth 3 months ago committed by GitHub
parent
commit
a00489b7d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      app/models/form/sales/pages/last_accommodation.rb
  2. 1
      app/models/form/sales/pages/last_accommodation_la.rb
  3. 2
      app/models/form/sales/questions/buyer1_previous_tenure.rb
  4. 3
      app/models/form/sales/questions/buyer2_living_in.rb
  5. 7
      app/models/form/sales/questions/buyers_organisations.rb
  6. 4
      app/models/form/sales/questions/previous_la_known.rb
  7. 3
      app/models/form/sales/questions/previous_postcode.rb
  8. 4
      app/models/form/sales/questions/previous_postcode_known.rb
  9. 3
      app/models/form/sales/questions/previous_tenure_buyer2.rb
  10. 3
      app/models/form/sales/questions/prevloc.rb
  11. 50
      config/locales/forms/2023/sales/household_situation.en.yml
  12. 50
      config/locales/forms/2024/sales/household_situation.en.yml

1
app/models/form/sales/pages/last_accommodation.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodation < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "last_accommodation" @id = "last_accommodation"
@copy_key = "sales.household_situation.last_accommodation"
end end
def questions def questions

1
app/models/form/sales/pages/last_accommodation_la.rb

@ -2,6 +2,7 @@ class Form::Sales::Pages::LastAccommodationLa < ::Form::Page
def initialize(id, hsh, subsection) def initialize(id, hsh, subsection)
super super
@id = "last_accommodation_la" @id = "last_accommodation_la"
@copy_key = "sales.household_situation.last_accommodation_la"
@depends_on = [{ @depends_on = [{
"is_previous_la_inferred" => false, "is_previous_la_inferred" => false,
}] }]

2
app/models/form/sales/questions/buyer1_previous_tenure.rb

@ -2,8 +2,6 @@ class Form::Sales::Questions::Buyer1PreviousTenure < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevten" @id = "prevten"
@check_answer_label = "Buyer 1’s previous tenure"
@header = "What was buyer 1’s previous tenure?"
@type = "radio" @type = "radio"
@answer_options = answer_options @answer_options = answer_options
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]

3
app/models/form/sales/questions/buyer2_living_in.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buy2living" @id = "buy2living"
@check_answer_label = "Buyer 2 living at the same address"
@header = "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
@type = "radio" @type = "radio"
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

7
app/models/form/sales/questions/buyers_organisations.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "buyers_organisations" @id = "buyers_organisations"
@check_answer_label = "Organisations buyers were registered with"
@header = "What organisations were the buyers registered with?"
@type = "checkbox" @type = "checkbox"
@hint_text = "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end
@ -27,9 +24,5 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question
} }
end end
def unanswered_error_message
"At least one option must be selected of these four"
end
QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze QUESTION_NUMBER_FROM_YEAR = { 2023 => 59, 2024 => 61 }.freeze
end end

4
app/models/form/sales/questions/previous_la_known.rb

@ -2,11 +2,9 @@ class Form::Sales::Questions::PreviousLaKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "previous_la_known" @id = "previous_la_known"
@check_answer_label = "Local authority of buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation_la.previous_la_known"
@header = "Do you know the local authority of buyer 1’s last settled accommodation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hint_text = "This is also known as the household’s 'last settled home'"
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

3
app/models/form/sales/questions/previous_postcode.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PreviousPostcode < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppostcode_full" @id = "ppostcode_full"
@check_answer_label = "Postcode of buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation.ppostcode_full"
@header = "Postcode"
@type = "text" @type = "text"
@width = 5 @width = 5
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{

4
app/models/form/sales/questions/previous_postcode_known.rb

@ -2,14 +2,12 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "ppcodenk" @id = "ppcodenk"
@check_answer_label = "Buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation.ppcodenk"
@header = "Do you know the postcode of buyer 1’s last settled accommodation?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@conditional_for = { @conditional_for = {
"ppostcode_full" => [0], "ppostcode_full" => [0],
} }
@hint_text = "This is also known as the household’s 'last settled home'"
@hidden_in_check_answers = { @hidden_in_check_answers = {
"depends_on" => [ "depends_on" => [
{ {

3
app/models/form/sales/questions/previous_tenure_buyer2.rb

@ -2,10 +2,7 @@ class Form::Sales::Questions::PreviousTenureBuyer2 < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevtenbuy2" @id = "prevtenbuy2"
@check_answer_label = "Buyer 2’s previous tenure"
@header = "What was buyer 2’s previous tenure?"
@type = "radio" @type = "radio"
@hint_text = ""
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

3
app/models/form/sales/questions/prevloc.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::Prevloc < ::Form::Question
def initialize(id, hsh, page) def initialize(id, hsh, page)
super super
@id = "prevloc" @id = "prevloc"
@check_answer_label = "Local authority of buyer 1’s last settled accommodation" @copy_key = "sales.household_situation.last_accommodation_la.prevloc"
@header = "Select a local authority"
@type = "select" @type = "select"
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {

50
config/locales/forms/2023/sales/household_situation.en.yml

@ -0,0 +1,50 @@
en:
forms:
2023:
sales:
household_situation:
prevten:
page_header: ""
check_answer_label: "Buyer 1’s previous tenure"
hint_text: ""
question_text: "What was buyer 1’s previous tenure?"
last_accommodation:
page_header: ""
ppcodenk:
check_answer_label: "Buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the postcode of buyer 1’s last settled accommodation?"
ppostcode_full:
check_answer_label: "Postcode of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Postcode"
last_accommodation_la:
page_header: ""
previous_la_known:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the local authority of buyer 1’s last settled accommodation?"
prevloc:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Select a local authority"
buyers_organisations:
page_header: ""
check_answer_label: "Organisations buyers were registered with"
hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
question_text: "What organisations were the buyers registered with?"
buy2living:
page_header: ""
check_answer_label: "Buyer 2 living at the same address"
hint_text: ""
header: "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
prevtenbuy2:
page_header: ""
check_answer_label: "Buyer 2’s previous tenure"
hint_text: ""
question_text: "What was buyer 2’s previous tenure?"

50
config/locales/forms/2024/sales/household_situation.en.yml

@ -0,0 +1,50 @@
en:
forms:
2024:
sales:
household_situation:
prevten:
page_header: ""
check_answer_label: "Buyer 1’s previous tenure"
hint_text: ""
question_text: "What was buyer 1’s previous tenure?"
last_accommodation:
page_header: ""
ppcodenk:
check_answer_label: "Buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the postcode of buyer 1’s last settled accommodation?"
ppostcode_full:
check_answer_label: "Postcode of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Postcode"
last_accommodation_la:
page_header: ""
previous_la_known:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: "This is also known as the household’s 'last settled home'"
question_text: "Do you know the local authority of buyer 1’s last settled accommodation?"
prevloc:
check_answer_label: "Local authority of buyer 1’s last settled accommodation"
hint_text: ""
question_text: "Select a local authority"
buyers_organisations:
page_header: ""
check_answer_label: "Organisations buyers were registered with"
hint_text: "Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue."
question_text: "What organisations were the buyers registered with?"
buy2living:
page_header: ""
check_answer_label: "Buyer 2 living at the same address"
hint_text: ""
question_text: "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
prevtenbuy2:
page_header: ""
check_answer_label: "Buyer 2’s previous tenure"
hint_text: ""
question_text: "What was buyer 2’s previous tenure?"
Loading…
Cancel
Save