diff --git a/config/initializers/feature_toggle.rb b/app/services/feature_toggle.rb similarity index 91% rename from config/initializers/feature_toggle.rb rename to app/services/feature_toggle.rb index 9986af543..eed6244d1 100644 --- a/config/initializers/feature_toggle.rb +++ b/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 diff --git a/app/views/logs/index.html.erb b/app/views/logs/index.html.erb index 2d88c9bd6..04209be73 100644 --- a/app/views/logs/index.html.erb +++ b/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 %> <% end %>