Browse Source

Extract partner under 16 value check page and question copy to translation files

pull/2707/head
Kat 2 years ago
parent
commit
18a6886827
  1. 3
      app/models/form/sales/pages/multiple_partners_value_check.rb
  2. 3
      app/models/form/sales/questions/multiple_partners_value_check.rb
  3. 2
      config/locales/en.yml
  4. 6
      config/locales/forms/2023/sales/soft_validations.en.yml
  5. 6
      config/locales/forms/2024/sales/soft_validations.en.yml
  6. 7
      spec/models/form/sales/pages/multiple_partners_value_check_spec.rb

3
app/models/form/sales/pages/multiple_partners_value_check.rb

@ -6,9 +6,10 @@ class Form::Sales::Pages::MultiplePartnersValueCheck < Form::Sales::Pages::Perso
"multiple_partners?" => true,
},
]
@copy_key = "sales.soft_validations.multiple_partners_value_check"
@person_index = person_index
@title_text = {
"translation" => "soft_validations.multiple_partners_sales.title",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
@informative_text = {}

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

@ -2,7 +2,7 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question
def initialize(id, hsh, page, person_index:)
super(id, hsh, page)
@id = "multiple_partners_value_check"
@check_answer_label = "Multiple partners confirmation"
@copy_key = "sales.soft_validations.multiple_partners_value_check"
@type = "interruption_screen"
@answer_options = {
"0" => { "value" => "Yes" },
@ -19,6 +19,5 @@ class Form::Sales::Questions::MultiplePartnersValueCheck < ::Form::Question
],
}
@check_answers_card_number = person_index
@header = "Are you sure this is correct?"
end
end

2
config/locales/en.yml

@ -813,8 +813,6 @@ Make sure these answers are correct."
title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant."
multiple_partners_lettings:
title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant."
multiple_partners_sales:
title: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."
devise:
two_factor_authentication:

6
config/locales/forms/2023/sales/soft_validations.en.yml

@ -68,3 +68,9 @@ en:
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
multiple_partners_value_check:
page_header: ""
check_answer_label: "Multiple partners confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."

6
config/locales/forms/2024/sales/soft_validations.en.yml

@ -68,3 +68,9 @@ en:
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to buyer 1."
multiple_partners_value_check:
page_header: ""
check_answer_label: "Multiple partners confirmation"
hint_text: ""
question_text: "Are you sure this is correct?"
title_text: "You told us there are more than 1 persons with 'Partner' relationship to buyer 1."

7
spec/models/form/sales/pages/multiple_partners_value_check_spec.rb

@ -4,7 +4,8 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 }
let(:page_id) { "multiple_partners_value_check" }
@ -39,7 +40,7 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.multiple_partners_sales.title",
"translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text",
"arguments" => [],
})
end
@ -71,7 +72,7 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do
it "has correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.multiple_partners_sales.title",
"translation" => "forms.2024.sales.soft_validations.multiple_partners_value_check.title_text",
"arguments" => [],
})
end

Loading…
Cancel
Save