From 75b6baf414faeb485b7f12e6d1483abfa09cb9ee Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 17 Nov 2022 10:11:17 +0000 Subject: [PATCH] feat: add feature toggle to scheme and location status --- app/helpers/locations_helper.rb | 9 +++++++-- app/helpers/schemes_helper.rb | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/helpers/locations_helper.rb b/app/helpers/locations_helper.rb index 2a02ebc94..e4c017822 100644 --- a/app/helpers/locations_helper.rb +++ b/app/helpers/locations_helper.rb @@ -24,7 +24,7 @@ module LocationsHelper end def display_location_attributes(location) - [ + base_attributes = [ { name: "Postcode", value: location.postcode }, { name: "Local authority", value: location.location_admin_district }, { name: "Location name", value: location.name, edit: true }, @@ -33,7 +33,12 @@ module LocationsHelper { name: "Mobility type", value: location.mobility_type }, { name: "Code", value: location.location_code }, { name: "Availability", value: "Available from #{location.available_from.to_formatted_s(:govuk_date)}" }, - { name: "Status", value: location.status }, ] + + if FeatureToggle.location_toggle_enabled? + base_attributes.append({ name: "Status", value: location.status }) + end + + base_attributes end end diff --git a/app/helpers/schemes_helper.rb b/app/helpers/schemes_helper.rb index 0a042528b..6ef82c570 100644 --- a/app/helpers/schemes_helper.rb +++ b/app/helpers/schemes_helper.rb @@ -15,9 +15,12 @@ module SchemesHelper { name: "Level of support given", value: scheme.support_type }, { name: "Intended length of stay", value: scheme.intended_stay }, { name: "Availability", value: "Available from #{scheme.available_from.to_formatted_s(:govuk_date)}" }, - { name: "Status", value: scheme.status }, ] + if FeatureToggle.scheme_toggle_enabled? + base_attributes.append({ name: "Status", value: scheme.status }) + end + if scheme.arrangement_type_same? base_attributes.delete({ name: "Organisation providing support", value: scheme.managing_organisation&.name }) end