From 6ff7db39f1d2262bdb0b0309f517cacc9c9c41a7 Mon Sep 17 00:00:00 2001 From: baarkerlounger <5101747+baarkerlounger@users.noreply.github.com> Date: Wed, 24 Aug 2022 09:49:13 +0100 Subject: [PATCH] Remove schemes feature flag (#841) --- app/components/primary_navigation_component.rb | 1 - app/models/derived_variables/case_log_variables.rb | 6 ------ app/models/form/setup/pages/location.rb | 1 - app/models/form/setup/pages/needs_type.rb | 1 - app/models/form/setup/pages/rent_type.rb | 1 - app/models/form/setup/pages/scheme.rb | 1 - app/models/form/setup/questions/needs_type.rb | 1 - app/models/form/setup/questions/scheme_id.rb | 1 - config/initializers/feature_toggle.rb | 4 ---- spec/models/case_log_spec.rb | 7 ------- spec/models/form/setup/pages/location_spec.rb | 1 - spec/models/form/setup/pages/needs_type_spec.rb | 4 ---- spec/models/form/setup/pages/rent_type_spec.rb | 4 ---- spec/models/form/setup/pages/scheme_spec.rb | 4 ---- 14 files changed, 37 deletions(-) diff --git a/app/components/primary_navigation_component.rb b/app/components/primary_navigation_component.rb index 82a12e447..0389d30b3 100644 --- a/app/components/primary_navigation_component.rb +++ b/app/components/primary_navigation_component.rb @@ -3,7 +3,6 @@ class PrimaryNavigationComponent < ViewComponent::Base def initialize(items:) @items = items - FeatureToggle.supported_housing_schemes_enabled? ? @items : @items.reject! { |nav_item| nav_item.text.include?("Schemes") } super end diff --git a/app/models/derived_variables/case_log_variables.rb b/app/models/derived_variables/case_log_variables.rb index ea4df8009..3bf227b6f 100644 --- a/app/models/derived_variables/case_log_variables.rb +++ b/app/models/derived_variables/case_log_variables.rb @@ -1,10 +1,6 @@ module DerivedVariables::CaseLogVariables RENT_TYPE_MAPPING = { 0 => 1, 1 => 2, 2 => 2, 3 => 3, 4 => 3, 5 => 3 }.freeze - def supported_housing_schemes_enabled? - FeatureToggle.supported_housing_schemes_enabled? - end - def scheme_has_multiple_locations? return false unless scheme @@ -15,8 +11,6 @@ module DerivedVariables::CaseLogVariables def set_derived_fields! # TODO: Remove once we support parent/child relationships self.managing_organisation_id ||= owning_organisation_id - # TODO: Remove once we support supported housing logs - self.needstype = 1 unless supported_housing_schemes_enabled? if rsnvac.present? self.newprop = has_first_let_vacancy_reason? ? 1 : 2 end diff --git a/app/models/form/setup/pages/location.rb b/app/models/form/setup/pages/location.rb index 4a86c9a9a..7acbc1bbe 100644 --- a/app/models/form/setup/pages/location.rb +++ b/app/models/form/setup/pages/location.rb @@ -4,7 +4,6 @@ class Form::Setup::Pages::Location < ::Form::Page @header = "" @description = "" @depends_on = [{ - "supported_housing_schemes_enabled?" => true, "needstype" => 2, "scheme_has_multiple_locations?" => true, }] diff --git a/app/models/form/setup/pages/needs_type.rb b/app/models/form/setup/pages/needs_type.rb index 0db6ef1c2..2625d6cda 100644 --- a/app/models/form/setup/pages/needs_type.rb +++ b/app/models/form/setup/pages/needs_type.rb @@ -4,7 +4,6 @@ class Form::Setup::Pages::NeedsType < ::Form::Page @id = "needs_type" @header = "" @description = "" - @depends_on = [{ "supported_housing_schemes_enabled?" => true }] @subsection = subsection end diff --git a/app/models/form/setup/pages/rent_type.rb b/app/models/form/setup/pages/rent_type.rb index 9c927c9af..5e112c3c6 100644 --- a/app/models/form/setup/pages/rent_type.rb +++ b/app/models/form/setup/pages/rent_type.rb @@ -3,7 +3,6 @@ class Form::Setup::Pages::RentType < ::Form::Page super("rent_type", hsh, subsection) @header = "" @description = "" - @depends_on = [{ "supported_housing_schemes_enabled?" => true }] @derived = true end diff --git a/app/models/form/setup/pages/scheme.rb b/app/models/form/setup/pages/scheme.rb index 2b9cc5dbf..e71a8d424 100644 --- a/app/models/form/setup/pages/scheme.rb +++ b/app/models/form/setup/pages/scheme.rb @@ -4,7 +4,6 @@ class Form::Setup::Pages::Scheme < ::Form::Page @header = "" @description = "" @depends_on = [{ - "supported_housing_schemes_enabled?" => true, "needstype" => 2, }] end diff --git a/app/models/form/setup/questions/needs_type.rb b/app/models/form/setup/questions/needs_type.rb index 4222cbb37..01c52b8cc 100644 --- a/app/models/form/setup/questions/needs_type.rb +++ b/app/models/form/setup/questions/needs_type.rb @@ -7,7 +7,6 @@ class Form::Setup::Questions::NeedsType < ::Form::Question @hint_text = "General needs housing includes both self-contained and shared housing without support or specific adaptations. Supported housing can include direct access hostels, group homes, residential care and nursing homes." @type = "radio" @answer_options = ANSWER_OPTIONS - @derived = true unless FeatureToggle.supported_housing_schemes_enabled? @page = page end diff --git a/app/models/form/setup/questions/scheme_id.rb b/app/models/form/setup/questions/scheme_id.rb index 3c4985de1..4686878da 100644 --- a/app/models/form/setup/questions/scheme_id.rb +++ b/app/models/form/setup/questions/scheme_id.rb @@ -6,7 +6,6 @@ class Form::Setup::Questions::SchemeId < ::Form::Question @hint_text = "Enter scheme name or postcode" @type = "select" @answer_options = answer_options - @derived = true unless FeatureToggle.supported_housing_schemes_enabled? @guidance_position = GuidancePosition::BOTTOM @guidance_partial = "scheme_selection" end diff --git a/config/initializers/feature_toggle.rb b/config/initializers/feature_toggle.rb index ffb6c6623..50501fb65 100644 --- a/config/initializers/feature_toggle.rb +++ b/config/initializers/feature_toggle.rb @@ -1,8 +1,4 @@ class FeatureToggle - def self.supported_housing_schemes_enabled? - true - end - def self.startdate_two_week_validation_enabled? true end diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index fbf7643ee..cbe1666cf 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -2285,13 +2285,6 @@ RSpec.describe CaseLog do end end - describe "supported_housing_schemes_enabled?" do - it "returns true for the case log if the environment is not production" do - case_log = FactoryBot.create(:case_log) - expect(case_log.supported_housing_schemes_enabled?).to eq(true) - end - end - describe "csv download" do let(:scheme) { FactoryBot.create(:scheme) } let(:location) { FactoryBot.create(:location, :export, scheme:, type_of_unit: 6, postcode: "SE11TE") } diff --git a/spec/models/form/setup/pages/location_spec.rb b/spec/models/form/setup/pages/location_spec.rb index b3c1d06a9..10db3d331 100644 --- a/spec/models/form/setup/pages/location_spec.rb +++ b/spec/models/form/setup/pages/location_spec.rb @@ -29,7 +29,6 @@ RSpec.describe Form::Setup::Pages::Location, type: :model do it "has the correct depends_on" do expect(page.depends_on).to eq([{ - "supported_housing_schemes_enabled?" => true, "needstype" => 2, "scheme_has_multiple_locations?" => true, }]) diff --git a/spec/models/form/setup/pages/needs_type_spec.rb b/spec/models/form/setup/pages/needs_type_spec.rb index 88b10fd64..772c2a11d 100644 --- a/spec/models/form/setup/pages/needs_type_spec.rb +++ b/spec/models/form/setup/pages/needs_type_spec.rb @@ -26,8 +26,4 @@ RSpec.describe Form::Setup::Pages::NeedsType, type: :model do it "has the correct description" do expect(page.description).to eq("") end - - it "has the correct depends_on" do - expect(page.depends_on).to eq([{ "supported_housing_schemes_enabled?" => true }]) - end end diff --git a/spec/models/form/setup/pages/rent_type_spec.rb b/spec/models/form/setup/pages/rent_type_spec.rb index 981ca4bf6..d558ea75c 100644 --- a/spec/models/form/setup/pages/rent_type_spec.rb +++ b/spec/models/form/setup/pages/rent_type_spec.rb @@ -26,8 +26,4 @@ RSpec.describe Form::Setup::Pages::RentType, type: :model do it "has the correct description" do expect(page.description).to eq("") end - - it "has the correct depends_on" do - expect(page.depends_on).to eq([{ "supported_housing_schemes_enabled?" => true }]) - end end diff --git a/spec/models/form/setup/pages/scheme_spec.rb b/spec/models/form/setup/pages/scheme_spec.rb index 841516fe5..7c3566009 100644 --- a/spec/models/form/setup/pages/scheme_spec.rb +++ b/spec/models/form/setup/pages/scheme_spec.rb @@ -26,8 +26,4 @@ RSpec.describe Form::Setup::Pages::Scheme, type: :model do it "has the correct description" do expect(page.description).to eq("") end - - it "has the correct depends_on" do - expect(page.depends_on).to eq([{ "needstype" => 2, "supported_housing_schemes_enabled?" => true }]) - end end