From b8503aa0c663eb221c7b1a6ce84edfe0ca858f42 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:20:34 +0000 Subject: [PATCH] Remove old feature flags (#2862) --- app/controllers/lettings_logs_controller.rb | 2 +- app/controllers/organisations_controller.rb | 4 ++-- app/controllers/sales_logs_controller.rb | 2 +- app/services/feature_toggle.rb | 16 ---------------- app/views/locations/check_answers.html.erb | 2 +- app/views/locations/show.html.erb | 2 +- app/views/schemes/check_answers.html.erb | 2 +- app/views/schemes/show.html.erb | 2 +- app/views/users/show.html.erb | 2 +- 9 files changed, 9 insertions(+), 25 deletions(-) diff --git a/app/controllers/lettings_logs_controller.rb b/app/controllers/lettings_logs_controller.rb index af3a6c32f..7fef9499b 100644 --- a/app/controllers/lettings_logs_controller.rb +++ b/app/controllers/lettings_logs_controller.rb @@ -22,7 +22,7 @@ class LettingsLogsController < LogsController @total_count = all_logs.size @unresolved_count = all_logs.unresolved.assigned_to(current_user).count @filter_type = "lettings_logs" - @duplicate_sets_count = FeatureToggle.duplicate_summary_enabled? && !current_user.support? ? duplicate_sets_count(current_user, current_user.organisation) : 0 + @duplicate_sets_count = !current_user.support? ? duplicate_sets_count(current_user, current_user.organisation) : 0 render "logs/index" end diff --git a/app/controllers/organisations_controller.rb b/app/controllers/organisations_controller.rb index 93b667a99..a6d9fb61e 100644 --- a/app/controllers/organisations_controller.rb +++ b/app/controllers/organisations_controller.rb @@ -186,7 +186,7 @@ class OrganisationsController < ApplicationController @total_count = organisation_logs.size @log_type = :lettings @filter_type = "lettings_logs" - @duplicate_sets_count = FeatureToggle.duplicate_summary_enabled? ? duplicate_sets_count(current_user, @organisation) : 0 + @duplicate_sets_count = duplicate_sets_count(current_user, @organisation) render "logs", layout: "application" end @@ -218,7 +218,7 @@ class OrganisationsController < ApplicationController @total_count = organisation_logs.size @log_type = :sales @filter_type = "sales_logs" - @duplicate_sets_count = FeatureToggle.duplicate_summary_enabled? ? duplicate_sets_count(current_user, @organisation) : 0 + @duplicate_sets_count = duplicate_sets_count(current_user, @organisation) render "logs", layout: "application" end diff --git a/app/controllers/sales_logs_controller.rb b/app/controllers/sales_logs_controller.rb index 8799fe528..237fd94d7 100644 --- a/app/controllers/sales_logs_controller.rb +++ b/app/controllers/sales_logs_controller.rb @@ -24,7 +24,7 @@ class SalesLogsController < LogsController @searched = search_term.presence @total_count = all_logs.size @filter_type = "sales_logs" - @duplicate_sets_count = FeatureToggle.duplicate_summary_enabled? && !current_user.support? ? duplicate_sets_count(current_user, current_user.organisation) : 0 + @duplicate_sets_count = !current_user.support? ? duplicate_sets_count(current_user, current_user.organisation) : 0 render "logs/index" end diff --git a/app/services/feature_toggle.rb b/app/services/feature_toggle.rb index 065c3b54e..8c3fe9362 100644 --- a/app/services/feature_toggle.rb +++ b/app/services/feature_toggle.rb @@ -11,10 +11,6 @@ class FeatureToggle !Rails.env.development? end - def self.duplicate_summary_enabled? - true - end - def self.service_unavailable? false end @@ -23,18 +19,6 @@ class FeatureToggle false end - def self.delete_scheme_enabled? - true - end - - def self.delete_location_enabled? - true - end - - def self.delete_user_enabled? - true - end - def self.local_storage? Rails.env.development? end diff --git a/app/views/locations/check_answers.html.erb b/app/views/locations/check_answers.html.erb index 8cd8bde2a..7a3a72e13 100644 --- a/app/views/locations/check_answers.html.erb +++ b/app/views/locations/check_answers.html.erb @@ -42,7 +42,7 @@ <% if LocationPolicy.new(current_user, @location).create? %>
<%= govuk_button_to "Save and return to locations", scheme_location_confirm_path(@scheme, @location, route: params[:route]), method: :patch %> - <% if LocationPolicy.new(current_user, @location).delete? && FeatureToggle.delete_location_enabled? %> + <% if LocationPolicy.new(current_user, @location).delete? %> <%= delete_location_link(@location) %> <% end %> <%= govuk_button_link_to "Cancel", scheme_locations_path(@scheme), secondary: true %> diff --git a/app/views/locations/show.html.erb b/app/views/locations/show.html.erb index f9ba6496c..0cb09af8f 100644 --- a/app/views/locations/show.html.erb +++ b/app/views/locations/show.html.erb @@ -51,6 +51,6 @@ <%= toggle_location_link(@location) %> <% end %> -<% if LocationPolicy.new(current_user, @location).delete? && FeatureToggle.delete_location_enabled? %> +<% if LocationPolicy.new(current_user, @location).delete? %> <%= delete_location_link(@location) %> <% end %> diff --git a/app/views/schemes/check_answers.html.erb b/app/views/schemes/check_answers.html.erb index 3f8365f6e..a98c86a51 100644 --- a/app/views/schemes/check_answers.html.erb +++ b/app/views/schemes/check_answers.html.erb @@ -24,7 +24,7 @@ <%= f.govuk_submit button_label %> <% end %> - <% if SchemePolicy.new(current_user, @scheme).delete? && FeatureToggle.delete_scheme_enabled? %> + <% if SchemePolicy.new(current_user, @scheme).delete? %> <%= delete_scheme_link(@scheme) %> <% end %> <% end %> diff --git a/app/views/schemes/show.html.erb b/app/views/schemes/show.html.erb index 0aa25affc..58bcd521e 100644 --- a/app/views/schemes/show.html.erb +++ b/app/views/schemes/show.html.erb @@ -56,6 +56,6 @@ <%= toggle_scheme_link(@scheme) %> <% end %> -<% if SchemePolicy.new(current_user, @scheme).delete? && FeatureToggle.delete_scheme_enabled? %> +<% if SchemePolicy.new(current_user, @scheme).delete? %> <%= delete_scheme_link(@scheme) %> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index a43b03f82..d6f2c1e88 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -157,7 +157,7 @@ <% end %> <% end %> - <% if UserPolicy.new(current_user, @user).delete? && FeatureToggle.delete_user_enabled? %> + <% if UserPolicy.new(current_user, @user).delete? %> <%= delete_user_link(@user) %> <% end %>