Browse Source

fixup! CLDC-4136: Hide question on UI flow

remove from question list instead
CLDC-4136-remove-building-type
Samuel Young 2 days ago
parent
commit
c70119954a
  1. 4
      app/models/form/lettings/pages/property_building_type.rb
  2. 2
      app/models/form/lettings/subsections/property_information.rb
  3. 3
      app/services/csv/lettings_log_csv_service.rb

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

@ -2,9 +2,7 @@ class Form::Lettings::Pages::PropertyBuildingType < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "property_building_type"
@depends_on = [
{ "is_general_needs?" => true, "form.start_year_2026_or_later?" => false },
]
@depends_on = [{ "is_general_needs?" => true }]
end
def questions

2
app/models/form/lettings/subsections/property_information.rb

@ -15,7 +15,7 @@ class Form::Lettings::Subsections::PropertyInformation < ::Form::Subsection
(first_let_questions unless form.start_year_2025_or_later?),
number_of_times_relet,
Form::Lettings::Pages::PropertyUnitType.new(nil, nil, self),
Form::Lettings::Pages::PropertyBuildingType.new(nil, nil, self),
(Form::Lettings::Pages::PropertyBuildingType.new(nil, nil, self) unless form.start_year_2026_or_later?),
Form::Lettings::Pages::PropertyWheelchairAccessible.new(nil, nil, self),
Form::Lettings::Pages::PropertyNumberOfBedrooms.new(nil, nil, self),
Form::Lettings::Pages::RentValueCheck.new("beds_rent_value_check", nil, self),

3
app/services/csv/lettings_log_csv_service.rb

@ -264,8 +264,6 @@ module Csv
"uprn" => %w[uprn_known uprn],
}.freeze
IGNORED_ATTRIBUTES_2026 = %w[builtype].freeze
def attribute_mappings
if @year >= 2024
ATTRIBUTE_MAPPINGS.merge(ATTRIBUTE_MAPPINGS_2024)
@ -284,7 +282,6 @@ module Csv
ordered_questions = FormHandler.instance.ordered_questions_for_year(@year, "lettings")
soft_validations_attributes = soft_validations_attributes(ordered_questions)
ordered_questions.reject! { |q| q.id.match?(/age\d_known|nationality_all_group|rent_value_check/) }
ordered_questions.reject! { |q| IGNORED_ATTRIBUTES_2026.include?(q.id) } if @year >= 2026
attributes = insert_derived_and_related_attributes(ordered_questions)
order_address_fields_for_support(attributes)
final_attributes = non_question_fields + attributes + SCHEME_AND_LOCATION_ATTRIBUTES

Loading…
Cancel
Save