From a960f969b6f2b480bc174397963f0446e1ba6d3c Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 2 May 2023 10:53:35 +0100 Subject: [PATCH] Update validation message: savings --- app/controllers/form_controller.rb | 2 +- app/models/form/sales/pages/savings_value_check.rb | 12 +++++++++++- config/locales/en.yml | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index 687ff163a..511ce7f39 100644 --- a/app/controllers/form_controller.rb +++ b/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(', ').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) else mandatory_questions_with_no_response.map do |question| diff --git a/app/models/form/sales/pages/savings_value_check.rb b/app/models/form/sales/pages/savings_value_check.rb index c4e7620b3..6a45a1929 100644 --- a/app/models/form/sales/pages/savings_value_check.rb +++ b/app/models/form/sales/pages/savings_value_check.rb @@ -8,8 +8,18 @@ class Form::Sales::Pages::SavingsValueCheck < ::Form::Page ] @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 def questions diff --git a/config/locales/en.yml b/config/locales/en.yml index 585419d87..6c8e2ff3c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -578,7 +578,8 @@ en: 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?" + title_text: "You told us the buyer’s savings were %{savings}." + hint_text: "This is higher than we would expect." deposit: title_text: "Are you sure that the deposit is this much higher than the buyer's savings?" grant: