From 4367e80545eb27b0d6722241f4a6313c99b75d27 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Wed, 29 Apr 2026 12:14:03 +0100 Subject: [PATCH] CLDC-4352: Update building height class hint text as dropdown (#3335) * CLDC-4352: update hint text as dropdown * CLDC-4352: update spec * CLDC-4352: refactoring --- app/models/form/sales/questions/building_height_class.rb | 1 + app/views/form/guidance/_building_height_class.html.erb | 5 +++++ config/locales/forms/2026/sales/guidance.en.yml | 9 +++++++++ .../locales/forms/2026/sales/property_information.en.yml | 4 ++-- .../form/sales/questions/building_height_class_spec.rb | 4 ++++ 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 app/views/form/guidance/_building_height_class.html.erb diff --git a/app/models/form/sales/questions/building_height_class.rb b/app/models/form/sales/questions/building_height_class.rb index 51e2c3623..c84470c60 100644 --- a/app/models/form/sales/questions/building_height_class.rb +++ b/app/models/form/sales/questions/building_height_class.rb @@ -3,6 +3,7 @@ class Form::Sales::Questions::BuildingHeightClass < ::Form::Question super @id = "buildheightclass" @type = "radio" + @top_guidance_partial = "building_height_class" @answer_options = ANSWER_OPTIONS @question_number = get_question_number_from_hash(QUESTION_NUMBER_FROM_YEAR) end diff --git a/app/views/form/guidance/_building_height_class.html.erb b/app/views/form/guidance/_building_height_class.html.erb new file mode 100644 index 000000000..f538ae151 --- /dev/null +++ b/app/views/form/guidance/_building_height_class.html.erb @@ -0,0 +1,5 @@ +
+ <%= govuk_details(summary_text: I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.building_height_class.title")) do %> + <%= I18n.t("forms.#{@log.form.start_date.year}.sales.guidance.building_height_class.content").html_safe %> + <% end %> +
diff --git a/config/locales/forms/2026/sales/guidance.en.yml b/config/locales/forms/2026/sales/guidance.en.yml index bc40e2a7b..f5863b3af 100644 --- a/config/locales/forms/2026/sales/guidance.en.yml +++ b/config/locales/forms/2026/sales/guidance.en.yml @@ -55,3 +55,12 @@ en: title: "What is a UPRN?" content: "

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 is 0010457355.

The UPRN may not be the same as the property reference assigned by your organisation.

" + + building_height_class: + title: "What do these classifications mean?" + content: "

High-rise residential buildings are those containing 2 or more residential units and either:

+ +

If unsure, answer based on the number of storeys.

" diff --git a/config/locales/forms/2026/sales/property_information.en.yml b/config/locales/forms/2026/sales/property_information.en.yml index b63ea755c..16f9625c8 100644 --- a/config/locales/forms/2026/sales/property_information.en.yml +++ b/config/locales/forms/2026/sales/property_information.en.yml @@ -60,10 +60,10 @@ en: question_text: "What type of unit is the property?" buildheightclass: - page_header: "" + page_header: "Building height classification" check_answer_label: "Building height classification" check_answer_prompt: "" - hint_text: "High-rise residential buildings are those containing 2 or more residential units and either have 7 or more storeys or are at least 18 metres in height. If unsure, answer based on the number of storeys." + hint_text: "" question_text: "What is the building height classification?" builtype: diff --git a/spec/models/form/sales/questions/building_height_class_spec.rb b/spec/models/form/sales/questions/building_height_class_spec.rb index e7ab032d4..704739d37 100644 --- a/spec/models/form/sales/questions/building_height_class_spec.rb +++ b/spec/models/form/sales/questions/building_height_class_spec.rb @@ -36,4 +36,8 @@ RSpec.describe Form::Sales::Questions::BuildingHeightClass, type: :model do it "has the correct question_number" do expect(question.question_number).to eq(17) end + + it "has correct guidance partial" do + expect(question.top_guidance_partial).to eq("building_height_class") + end end