Browse Source

feat: add feature toggle to scheme and location status

pull/1001/head
natdeanlewissoftwire 2 years ago
parent
commit
75b6baf414
  1. 9
      app/helpers/locations_helper.rb
  2. 5
      app/helpers/schemes_helper.rb

9
app/helpers/locations_helper.rb

@ -24,7 +24,7 @@ module LocationsHelper
end end
def display_location_attributes(location) def display_location_attributes(location)
[ base_attributes = [
{ name: "Postcode", value: location.postcode }, { name: "Postcode", value: location.postcode },
{ name: "Local authority", value: location.location_admin_district }, { name: "Local authority", value: location.location_admin_district },
{ name: "Location name", value: location.name, edit: true }, { name: "Location name", value: location.name, edit: true },
@ -33,7 +33,12 @@ module LocationsHelper
{ name: "Mobility type", value: location.mobility_type }, { name: "Mobility type", value: location.mobility_type },
{ name: "Code", value: location.location_code }, { name: "Code", value: location.location_code },
{ name: "Availability", value: "Available from #{location.available_from.to_formatted_s(:govuk_date)}" }, { 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
end end

5
app/helpers/schemes_helper.rb

@ -15,9 +15,12 @@ module SchemesHelper
{ name: "Level of support given", value: scheme.support_type }, { name: "Level of support given", value: scheme.support_type },
{ name: "Intended length of stay", value: scheme.intended_stay }, { name: "Intended length of stay", value: scheme.intended_stay },
{ name: "Availability", value: "Available from #{scheme.available_from.to_formatted_s(:govuk_date)}" }, { 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? if scheme.arrangement_type_same?
base_attributes.delete({ name: "Organisation providing support", value: scheme.managing_organisation&.name }) base_attributes.delete({ name: "Organisation providing support", value: scheme.managing_organisation&.name })
end end

Loading…
Cancel
Save