Browse Source

Update validation message: savings

pull/1584/head
Kat 3 years ago
parent
commit
a960f969b6
  1. 2
      app/controllers/form_controller.rb
  2. 12
      app/models/form/sales/pages/savings_value_check.rb
  3. 3
      config/locales/en.yml

2
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) 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)) 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(', ').downcase}" if previous_interruption_screen_page_id.present? flash[:notice] = "You have successfully updated #{@page.questions.map(&:check_answer_label).first.downcase}" if previous_interruption_screen_page_id.present?
redirect_to(successful_redirect_path) redirect_to(successful_redirect_path)
else else
mandatory_questions_with_no_response.map do |question| mandatory_questions_with_no_response.map do |question|

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

@ -8,8 +8,18 @@ class Form::Sales::Pages::SavingsValueCheck < ::Form::Page
] ]
@title_text = { @title_text = {
"translation" => "soft_validations.savings.title_text", "translation" => "soft_validations.savings.title_text",
"arguments" => [
{
"key" => "field_formatted_as_currency",
"arguments_for_key" => "savings",
"i18n_template" => "savings",
},
],
}
@informative_text = {
"translation" => "soft_validations.savings.hint_text",
"arguments" => [],
} }
@informative_text = {}
end end
def questions def questions

3
config/locales/en.yml

@ -578,7 +578,8 @@ en:
percentage_discount_value: percentage_discount_value:
title_text: "You told us that the percentage discount was %{discount}. This seems high for this type of property." title_text: "You told us that the percentage discount was %{discount}. This seems high for this type of property."
savings: savings:
title_text: "Are you sure the savings are higher than £100,000?" title_text: "You told us the buyer’s savings were %{savings}."
hint_text: "This is higher than we would expect."
deposit: deposit:
title_text: "Are you sure that the deposit is this much higher than the buyer's savings?" title_text: "Are you sure that the deposit is this much higher than the buyer's savings?"
grant: grant:

Loading…
Cancel
Save