Browse Source

Update title texts

pull/1584/head
Kat 3 years ago
parent
commit
8412de5a21
  1. 4
      app/controllers/form_controller.rb
  2. 2
      app/helpers/interruption_screen_helper.rb
  3. 4
      app/models/form/lettings/pages/net_income_value_check.rb
  4. 3
      app/models/form/sales/pages/deposit_value_check.rb
  5. 1
      app/models/form/sales/pages/grant_value_check.rb
  6. 1
      app/models/form/sales/pages/household_wheelchair_check.rb
  7. 1
      app/models/form/sales/pages/mortgage_value_check.rb
  8. 3
      app/models/form/sales/pages/savings_value_check.rb
  9. 1
      app/views/form/_interruption_screen_question.html.erb
  10. 8
      config/forms/2022_2023.json
  11. 10
      config/locales/en.yml
  12. 2
      spec/models/form/lettings/pages/net_income_value_check_spec.rb

4
app/controllers/form_controller.rb

@ -11,7 +11,7 @@ class FormController < ApplicationController
mandatory_questions_with_no_response = mandatory_questions_with_no_response(responses_for_page)
if mandatory_questions_with_no_response.empty? && @log.update(responses_for_page.merge(updated_by: current_user))
flash[:notice] = "You have successfully updated #{@page.questions.map(&:check_answer_label).join(', ')}" if interruption_screen_referrer.present?
flash[:notice] = "You have successfully updated #{@page.questions.map(&:check_answer_label).join(', ').downcase}" if interruption_screen_referrer.present?
redirect_to(successful_redirect_path)
else
mandatory_questions_with_no_response.map do |question|
@ -47,7 +47,7 @@ class FormController < ApplicationController
def show_page
if request.params["referrer"] == "interruption_screen"
@interruption_page_id = request.headers["HTTP_REFERER"].split("/")[-1].underscore
@interruption_page_id = request.headers["HTTP_REFERER"].split("/")[-1].split("?")[0].underscore
end
if @log

2
app/helpers/interruption_screen_helper.rb

@ -30,7 +30,7 @@ module InterruptionScreenHelper
end
def soft_validation_affected_questions(question, log)
question.page.affected_question_ids.map { |question_id| log.form.get_question(question_id, log) }
question.page.affected_question_ids.map { |question_id| log.form.get_question(question_id, log) }.compact
end
def interruption_action_href(log, page_id)

4
app/models/form/lettings/pages/net_income_value_check.rb

@ -8,8 +8,8 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page
"translation" => "soft_validations.net_income.hint_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
"arguments_for_key" => "ecstat1",
"key" => "ecstat1",
"label" => true,
"i18n_template" => "ecstat1",
},
{

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

@ -7,6 +7,9 @@ class Form::Sales::Pages::DepositValueCheck < ::Form::Page
},
]
@informative_text = {}
@title_text = {
"translation" => "soft_validations.deposit.title_text",
}
end
def questions

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

@ -7,6 +7,7 @@ class Form::Sales::Pages::GrantValueCheck < ::Form::Page
"grant_outside_common_range?" => true,
},
]
@title_text = { "translation" => "soft_validations.grant.title_text" }
@informative_text = {}
end

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

@ -7,6 +7,7 @@ class Form::Sales::Pages::HouseholdWheelchairCheck < ::Form::Page
},
]
@informative_text = {}
@title_text = { "translation" => "soft_validations.wheelchair.title_text" }
end
def questions

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

@ -4,6 +4,7 @@ class Form::Sales::Pages::MortgageValueCheck < ::Form::Page
@depends_on = depends_on
@informative_text = {}
@person_index = person_index
@title_text = { "translation" => "soft_validations.mortgage.title_text" }
end
def questions

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

@ -6,6 +6,9 @@ class Form::Sales::Pages::SavingsValueCheck < ::Form::Page
"savings_over_soft_max?" => true,
},
]
@title_text = {
"translation" => "soft_validations.savings.title_text",
}
@informative_text = {}
end

1
app/views/form/_interruption_screen_question.html.erb

@ -4,7 +4,6 @@
) do %>
<p class="govuk-heading-l"><%= display_title_text(title_text, lettings_log) %></p>
<p class="govuk-body-l"><%= display_informative_text(informative_text, lettings_log) %></p>
<p class="govuk-body-l"><%= question.header %></p>
<p class="govuk-body-l"><%= question.hint_text&.html_safe %></p>
<% end %>
<% end %>

8
config/forms/2022_2023.json

@ -8324,8 +8324,8 @@
}
]
},
"header": "This rent is lower than expected for this property type, in this area. Check:",
"hint_text": "<ul><li>the decimal point is not missing (£X.XX)</li><li>the frequency is correct, for example weekly, monthly</li><li>the rent type is correct, for example affordable or social rent</li></ul><p>Are you sure this is correct?</p>",
"header": "Are you sure this is correct?",
"hint_text": "This rent is lower than expected for this property type, in this area. Check:<ul><li>the decimal point is not missing (£X.XX)</li><li>the frequency is correct, for example weekly, monthly</li><li>the rent type is correct, for example affordable or social rent</li></ul>",
"type": "interruption_screen",
"answer_options": {
"0": {
@ -8369,8 +8369,8 @@
}
]
},
"header": "This rent is higher than expected for this property type, in this area. Check:",
"hint_text": "<ul><li>the decimal point is not missing (£X.XX)</li><li>the frequency is correct, for example weekly, monthly</li><li>the rent type is correct, for example affordable or social rent</li></ul><p>Are you sure this is correct?</p>",
"header": "Are you sure this is correct?",
"hint_text": "This rent is higher than expected for this property type, in this area. Check:<ul><li>the decimal point is not missing (£X.XX)</li><li>the frequency is correct, for example weekly, monthly</li><li>the rent type is correct, for example affordable or social rent</li></ul>",
"type": "interruption_screen",
"answer_options": {
"0": {

10
config/locales/en.yml

@ -569,6 +569,16 @@ en:
title_text: "You told us that buyer 2 will not live in the property. For %{ownership_scheme} types, the buyer usually lives in the property."
percentage_discount_value:
title_text: "You told us that the percentage discount was %{discount}. This seems high for this type of property."
savings:
title_text: "Are you sure the savings are higher than £100,000?"
deposit:
title_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
grant:
title_text: "Are you sure? Grants are usually £9,000 - £16,000"
wheelchair:
title_text: "Are you sure? You said previously that somebody in household uses a wheelchair"
mortgage:
title_text: "Are you sure that the mortgage is more than 5 times the income used for the mortgage application?"
devise:
two_factor_authentication:

2
spec/models/form/lettings/pages/net_income_value_check_spec.rb

@ -33,7 +33,7 @@ RSpec.describe Form::Lettings::Pages::NetIncomeValueCheck, type: :model do
it "has the correct informative_text" do
expect(page.informative_text).to eq({
"arguments" => [{ "arguments_for_key" => "ecstat1", "i18n_template" => "ecstat1", "key" => "field_formatted_as_currency" }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }],
"arguments" => [{ "label" => true, "i18n_template" => "ecstat1", "key" => "ecstat1" }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }],
"translation" => "soft_validations.net_income.hint_text",
})
end

Loading…
Cancel
Save