Browse Source

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
pull/3339/head
Nat Dean-Lewis 2 days ago committed by GitHub
parent
commit
4367e80545
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      app/models/form/sales/questions/building_height_class.rb
  2. 5
      app/views/form/guidance/_building_height_class.html.erb
  3. 9
      config/locales/forms/2026/sales/guidance.en.yml
  4. 4
      config/locales/forms/2026/sales/property_information.en.yml
  5. 4
      spec/models/form/sales/questions/building_height_class_spec.rb

1
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

5
app/views/form/guidance/_building_height_class.html.erb

@ -0,0 +1,5 @@
<div class="govuk-body">
<%= 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 %>
</div>

9
config/locales/forms/2026/sales/guidance.en.yml

@ -55,3 +55,12 @@ en:
title: "What is a UPRN?"
content: "<p>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.</p>
<p>The UPRN may not be the same as the property reference assigned by your organisation.</p>"
building_height_class:
title: "What do these classifications mean?"
content: "<p>High-rise residential buildings are those containing 2 or more residential units and either:</p>
<ul class=\"govuk-list govuk-list--bullet\">
<li>have 7 or more stories</li>
<li>are at least 18 metres in height</li>
</ul>
<p>If unsure, answer based on the number of storeys.</p>"

4
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:

4
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

Loading…
Cancel
Save