Browse Source

CLDC-2279 Bulk upload split feature toggle by log type (#1552)

# Context

- https://digital.dclg.gov.uk/jira/browse/CLDC-2279

# Changes

- split bulk upload feature toggle by log type ie lettings and sales
- this allows us to toggle with finer granularity
- moved `FeatureToggle` from initializer to service class. not sure why it was an initializer in the first place? this means its available to zeitwerk and will be reloaded when needed
pull/1559/head v0.3.13
Phil Lee 2 years ago committed by GitHub
parent
commit
3029f51427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/services/feature_toggle.rb
  2. 8
      app/views/logs/index.html.erb

6
config/initializers/feature_toggle.rb → app/services/feature_toggle.rb

@ -36,7 +36,11 @@ class FeatureToggle
true
end
def self.bulk_upload_logs?
def self.bulk_upload_lettings_logs?
!Rails.env.production?
end
def self.bulk_upload_sales_logs?
!Rails.env.production?
end

8
app/views/logs/index.html.erb

@ -55,8 +55,12 @@
<%= govuk_button_to "Create a new sales log", sales_logs_path, class: "govuk-!-margin-right-6" %>
<% end %>
<% if FeatureToggle.bulk_upload_logs? %>
<%= govuk_button_link_to "Upload #{log_type_for_controller(controller)} logs in bulk", bulk_upload_path_for_controller(controller, id: "start"), secondary: true %>
<% if FeatureToggle.bulk_upload_lettings_logs? && log_type_for_controller(controller) == "lettings" %>
<%= govuk_button_link_to "Upload lettings logs in bulk", bulk_upload_path_for_controller(controller, id: "start"), secondary: true %>
<% end %>
<% if FeatureToggle.bulk_upload_sales_logs? && log_type_for_controller(controller) == "sales" %>
<%= govuk_button_link_to "Upload sales logs in bulk", bulk_upload_path_for_controller(controller, id: "start"), secondary: true %>
<% end %>
</div>
<% end %>

Loading…
Cancel
Save