Browse Source

Move question details to translation files

pull/2694/head
Manny Dinssa 8 months ago
parent
commit
d8731a7892
  1. 2
      app/models/form/sales/pages/property_local_authority.rb
  2. 3
      app/models/form/sales/questions/about_price_value_check.rb
  3. 3
      app/models/form/sales/questions/address_line1.rb
  4. 3
      app/models/form/sales/questions/address_line1_for_address_matcher.rb
  5. 2
      app/models/form/sales/questions/address_line2.rb
  6. 3
      app/models/form/sales/questions/buyer1_income_value_check.rb
  7. 3
      app/models/form/sales/questions/buyer2_income_value_check.rb
  8. 3
      app/models/form/sales/questions/combined_income_value_check.rb
  9. 3
      app/models/form/sales/questions/county.rb
  10. 3
      app/models/form/sales/questions/monthly_charges_value_check.rb
  11. 2
      app/models/form/sales/questions/no_address_found.rb
  12. 2
      app/models/form/sales/questions/postcode_for_address_matcher.rb
  13. 3
      app/models/form/sales/questions/postcode_for_full_address.rb
  14. 3
      app/models/form/sales/questions/property_building_type.rb
  15. 3
      app/models/form/sales/questions/property_local_authority.rb
  16. 4
      app/models/form/sales/questions/property_number_of_bedrooms.rb
  17. 3
      app/models/form/sales/questions/property_unit_type.rb
  18. 3
      app/models/form/sales/questions/property_wheelchair_accessible.rb
  19. 3
      app/models/form/sales/questions/town_or_city.rb
  20. 3
      app/models/form/sales/questions/uprn.rb
  21. 3
      app/models/form/sales/questions/uprn_confirmation.rb
  22. 6
      app/models/form/sales/questions/uprn_known.rb
  23. 3
      app/models/form/sales/questions/uprn_selection.rb
  24. 4
      app/models/form/sales/subsections/property_information.rb
  25. 117
      config/locales/forms/2023/sales/property.en.yml
  26. 142
      config/locales/forms/2024/sales/property.en.yml

2
app/models/form/sales/pages/property_local_authority.rb

@ -15,7 +15,7 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page
].compact
end
def la_known_question
def la_known_question #TODO: Pre 2023, could be removed? Only used here.
if form.start_date.year < 2023
Form::Sales::Questions::PropertyLocalAuthorityKnown.new(nil, nil, self)
end

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::AboutPriceValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "value_value_check"
@check_answer_label = "Purchase price confirmation"
@header = "Are you sure?"
@copy_key = "sales.property.value_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line1"
@header = "Address line 1"
@copy_key = "sales.property.address.address_line1"
@error_label = "Address line 1"
@type = "text"
@plain_label = true
@check_answer_label = "Address lines 1 and 2"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true

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

@ -2,11 +2,10 @@ class Form::Sales::Questions::AddressLine1ForAddressMatcher < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line1_input"
@header = "Address line 1"
@copy_key = "sales.property.address_matcher.address_line1_input"
@error_label = "Address line 1"
@type = "text"
@plain_label = true
@check_answer_label = "Find address"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@hide_question_number_on_page = true
end

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::AddressLine2 < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_line2"
@header = "Address line 2 (optional)"
@copy_key = "sales.property.address.address_line2"
@type = "text"
@plain_label = true
@disable_clearing_if_not_routed_or_dynamic_answer_options = true

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer1IncomeValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page)
@id = "income1_value_check"
@check_answer_label = "Buyer 1 income confirmation"
@header = "Are you sure this is correct?"
@copy_key = "sales.property.income1_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Buyer2IncomeValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page)
@id = "income2_value_check"
@check_answer_label = "Buyer 2 income confirmation"
@header = "Are you sure this is correct?"
@copy_key = "soft_validations.income2_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::CombinedIncomeValueCheck < ::Form::Question
def initialize(id, hsh, page, check_answers_card_number:)
super(id, hsh, page)
@id = "combined_income_value_check"
@check_answer_label = "Combined income confirmation"
@header = "Are you sure this is correct?"
@copy_key = "sales.property.combined_income_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,10 +2,9 @@ class Form::Sales::Questions::County < ::Form::Question
def initialize(id, hsh, page)
super
@id = "county"
@header = "County (optional)"
@copy_key = "sales.property.address.county"
@type = "text"
@plain_label = true
@check_answer_label = "County"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::MonthlyChargesValueCheck < ::Form::Question
def initialize(id, hsh, page)
super
@id = "monthly_charges_value_check"
@check_answer_label = "Monthly charges confirmation"
@header = "Are you sure this is correct?"
@copy_key = "sales.property.monthly_charges_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::NoAddressFound < ::Form::Question
def initialize(id, hsh, page)
super
@id = "address_search_value_check"
@header = "No address found"
@copy_key = "sales.property.address_search_value_check"
@type = "interruption_screen"
@hidden_in_check_answers = true
end

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForAddressMatcher < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full_input"
@header = "Postcode"
@copy_key = "sales.property.address_matcher.postcode_full_input"
@type = "text"
@width = 5
@plain_label = true

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question
def initialize(id, hsh, page)
super
@id = "postcode_full"
@header = "Postcode"
@copy_key = "sales.property.address.postcode_full"
@type = "text"
@width = 5
@inferred_check_answers_value = [{
@ -17,7 +17,6 @@ class Form::Sales::Questions::PostcodeForFullAddress < ::Form::Question
},
}
@plain_label = true
@check_answer_label = "Postcode"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyBuildingType < ::Form::Question
def initialize(id, hsh, page)
super
@id = "builtype"
@check_answer_label = "Type of building"
@header = "What type of building is the property?"
@copy_key = "sales.property.builtype"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@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/property_local_authority.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyLocalAuthority < ::Form::Question
def initialize(id, hsh, page)
super
@id = "la"
@check_answer_label = "Local authority"
@header = "What is the property’s local authority?"
@copy_key = "sales.property.la"
@type = "select"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@disable_clearing_if_not_routed_or_dynamic_answer_options = true

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

@ -2,9 +2,7 @@ class Form::Sales::Questions::PropertyNumberOfBedrooms < ::Form::Question
def initialize(id, hsh, page)
super
@id = "beds"
@check_answer_label = "Number of bedrooms"
@header = "How many bedrooms does the property have?"
@hint_text = "A bedsit has 1 bedroom"
@copy_key = "sales.property.beds"
@type = "numeric"
@width = 2
@min = 1

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyUnitType < ::Form::Question
def initialize(id, hsh, page)
super
@id = "proptype"
@check_answer_label = "Type of unit"
@header = "What type of unit is the property?"
@copy_key = "sales.property.proptype"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@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/property_wheelchair_accessible.rb

@ -2,8 +2,7 @@ class Form::Sales::Questions::PropertyWheelchairAccessible < ::Form::Question
def initialize(id, hsh, page)
super
@id = "wchair"
@check_answer_label = "Property built or adapted to wheelchair-user standards"
@header = "Is the property built or adapted to wheelchair-user standards?"
@copy_key = "sales.property.wchair"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@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/town_or_city.rb

@ -2,10 +2,9 @@ class Form::Sales::Questions::TownOrCity < ::Form::Question
def initialize(id, hsh, page)
super
@id = "town_or_city"
@header = "Town or city"
@copy_key = "sales.property.address.town_or_city"
@type = "text"
@plain_label = true
@check_answer_label = "Town or city"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@hide_question_number_on_page = true

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

@ -2,8 +2,7 @@ class Form::Sales::Questions::Uprn < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn"
@check_answer_label = "UPRN"
@header = "What is the property's UPRN?"
@copy_key = "sales.property.uprn"
@type = "text"
@width = 10
@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/uprn_confirmation.rb

@ -2,9 +2,8 @@ class Form::Sales::Questions::UprnConfirmation < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn_confirmed"
@header = "Is this the property address?"
@type = "radio"
@check_answer_label = "Is this the right address?"
@copy_key = "sales.property.uprn_confirmed"
end
def answer_options

6
app/models/form/sales/questions/uprn_known.rb

@ -2,13 +2,9 @@ class Form::Sales::Questions::UprnKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn_known"
@check_answer_label = "UPRN known?"
@header = "Do you know the property's UPRN?"
@copy_key = "sales.property.uprn_known"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hint_text = "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you dont know the UPRN you can enter the address of the property instead on the next screen."
@conditional_for = { "uprn" => [1] }
@inferred_check_answers_value = [
{

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

@ -2,9 +2,8 @@ class Form::Sales::Questions::UprnSelection < ::Form::Question
def initialize(id, hsh, page)
super
@id = "uprn_selection"
@header = "Select the correct address"
@copy_key = "sales.property.uprn_selection"
@type = "radio"
@check_answer_label = "Select the correct address"
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end

4
app/models/form/sales/subsections/property_information.rb

@ -16,7 +16,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
Form::Sales::Pages::PercentageDiscountValueCheck.new("percentage_discount_proptype_value_check", nil, self),
Form::Sales::Pages::PropertyBuildingType.new(nil, nil, self),
(uprn_questions if form.start_date.year == 2023),
(postcode_and_la_questions if form.start_date.year < 2023),
(postcode_and_la_questions if form.start_date.year < 2023), #TODO: Pre 2023, could be removed?
Form::Sales::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
].flatten.compact
end
@ -50,7 +50,7 @@ class Form::Sales::Subsections::PropertyInformation < ::Form::Subsection
end
end
def postcode_and_la_questions
def postcode_and_la_questions #TODO: Pre 2023, could be removed?
[
Form::Sales::Pages::Postcode.new(nil, nil, self),
Form::Sales::Pages::PropertyLocalAuthority.new(nil, nil, self),

117
config/locales/forms/2023/sales/property.en.yml

@ -0,0 +1,117 @@
en:
forms:
2023:
sales:
property:
uprn:
page_header: "What is the property's UPRN?"
check_answer_label: "UPRN"
hint_text: ""
question_text: ""
uprn_known:
page_header: "Do you know the property's UPRN?"
check_answer_label: "UPRN known?"
hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you don’t know the UPRN you can enter the address of the property instead on the next screen."
question_text: ""
uprn_confirmed:
page_header: "Is this the property address?"
check_answer_label: "Is this the right address?"
hint_text: ""
question_text: ""
address:
address_line1:
page_header: "Address line 1"
check_answer_label: "Address lines 1 and 2"
hint_text: ""
question_text: ""
address_line2:
page_header: "Address line 2 (optional)"
check_answer_label: ""
hint_text: ""
question_text: ""
town_or_city:
page_header: "Town or city"
check_answer_label: "Town or city"
hint_text: ""
question_text: ""
county:
page_header: "County (optional)"
check_answer_label: "County"
hint_text: ""
question_text: ""
postcode_full:
page_header: "Postcode"
check_answer_label: "Postcode"
hint_text: ""
question_text: ""
la:
page_header: "What is the property’s local authority?"
check_answer_label: "Local authority"
hint_text: ""
question_text: ""
income1_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Buyer 1 income confirmation"
hint_text: ""
question_text: ""
income2_value_check":
page_header: "Are you sure this is correct?"
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
question_text: ""
combined_income_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Combined income confirmation"
hint_text: ""
question_text: ""
value_value_check:
page_header: "Are you sure?"
check_answer_label: "Purchase price confirmation"
hint_text: ""
question_text: ""
beds:
page_header: "How many bedrooms does the property have?"
check_answer_label: "Number of bedrooms"
hint_text: "A bedsit has 1 bedroom."
question_text: ""
proptype:
page_header: "What type of unit is the property?"
check_answer_label: "Type of unit"
hint_text: ""
question_text: ""
monthly_charges_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Monthly charges confirmation"
hint_text: ""
question_text: ""
percentage_discount_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Percentage discount confirmation"
hint_text: ""
question_text: ""
builtype:
page_header: "What type of building is the property?"
check_answer_label: "Type of building"
hint_text: ""
question_text: ""
wchair:
page_header: "Is the property built or adapted to wheelchair-user standards?"
check_answer_label: "Property built or adapted to wheelchair-user standards"
hint_text: ""
question_text: ""

142
config/locales/forms/2024/sales/property.en.yml

@ -0,0 +1,142 @@
en:
forms:
2024:
sales:
property:
uprn:
page_header: "What is the property's UPRN?"
check_answer_label: "UPRN"
hint_text: ""
question_text: ""
uprn_known:
page_header: "Do you know the property's UPRN?"
check_answer_label: "UPRN known?"
hint_text: "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.<br><br>
The UPRN may not be the same as the property reference assigned by your organisation.<br><br>
If you don’t know the UPRN you can enter the address of the property instead on the next screen."
question_text: ""
uprn_confirmed:
page_header: "Is this the property address?"
check_answer_label: "Is this the right address?"
hint_text: ""
question_text: ""
address_matcher:
address_line1_input:
page_header: "Address line 1"
check_answer_label: "Find address"
hint_text: ""
question_text: ""
postcode_full_input:
page_header: "Postcode"
check_answer_label: ""
hint_text: ""
question_text: ""
address_search_value_check:
page_header: "No address found"
check_answer_label: ""
hint_text: ""
question_text: ""
uprn_selection:
page_header: "Select the correct address"
check_answer_label: "Select the correct address"
hint_text: ""
question_text: ""
address:
address_line1:
page_header: "Address line 1"
check_answer_label: "Address lines 1 and 2"
hint_text: ""
question_text: ""
address_line2:
page_header: "Address line 2 (optional)"
check_answer_label: ""
hint_text: ""
question_text: ""
town_or_city:
page_header: "Town or city"
check_answer_label: "Town or city"
hint_text: ""
question_text: ""
county:
page_header: "County (optional)"
check_answer_label: "County"
hint_text: ""
question_text: ""
postcode_full:
page_header: "Postcode"
check_answer_label: "Postcode"
hint_text: ""
question_text: ""
la:
page_header: "What is the property’s local authority?"
check_answer_label: "Local authority"
hint_text: ""
question_text: ""
income1_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Buyer 1 income confirmation"
hint_text: ""
question_text: ""
income2_value_check":
page_header: "Are you sure this is correct?"
check_answer_label: "Buyer 2 income confirmation"
hint_text: ""
question_text: ""
combined_income_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Combined income confirmation"
hint_text: ""
question_text: ""
value_value_check:
page_header: "Are you sure?"
check_answer_label: "Purchase price confirmation"
hint_text: ""
question_text: ""
beds:
page_header: "How many bedrooms does the property have?"
check_answer_label: "Number of bedrooms"
hint_text: "A bedsit has 1 bedroom."
question_text: ""
proptype:
page_header: "What type of unit is the property?"
check_answer_label: "Type of unit"
hint_text: ""
question_text: ""
monthly_charges_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Monthly charges confirmation"
hint_text: ""
question_text: ""
percentage_discount_value_check:
page_header: "Are you sure this is correct?"
check_answer_label: "Percentage discount confirmation"
hint_text: ""
question_text: ""
builtype:
page_header: "What type of building is the property?"
check_answer_label: "Type of building"
hint_text: ""
question_text: ""
wchair:
page_header: "Is the property built or adapted to wheelchair-user standards?"
check_answer_label: "Property built or adapted to wheelchair-user standards"
hint_text: ""
question_text: ""
Loading…
Cancel
Save