diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5d96d7c16..a68b55f8d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,9 +7,15 @@ class ApplicationController < ActionController::Base before_action :set_paper_trail_whodunnit def check_maintenance_status - if FeatureToggle.service_unavailable? && !%w[service-unavailable accessibility-statement privacy-notice cookies].include?(request.fullpath.split("?")[0].delete("/")) - redirect_to service_unavailable_path - elsif !FeatureToggle.service_unavailable? && request.fullpath.split("?")[0].delete("/") == "service-unavailable" + if FeatureToggle.service_moved? + unless %w[service-moved accessibility-statement privacy-notice cookies].include?(request.fullpath.split("?")[0].delete("/")) + redirect_to service_moved_path + end + elsif FeatureToggle.service_unavailable? + unless %w[service-unavailable accessibility-statement privacy-notice cookies].include?(request.fullpath.split("?")[0].delete("/")) + redirect_to service_unavailable_path + end + elsif %w[service-moved service-unavailable].include?(request.fullpath.split("?")[0].delete("/")) redirect_back(fallback_location: root_path) end end diff --git a/app/controllers/maintenance_controller.rb b/app/controllers/maintenance_controller.rb index bb6ae1f80..26dd8188d 100644 --- a/app/controllers/maintenance_controller.rb +++ b/app/controllers/maintenance_controller.rb @@ -1,4 +1,10 @@ class MaintenanceController < ApplicationController + def service_moved + if current_user + sign_out + end + end + def service_unavailable if current_user sign_out diff --git a/app/services/feature_toggle.rb b/app/services/feature_toggle.rb index 94ad48906..2829c0958 100644 --- a/app/services/feature_toggle.rb +++ b/app/services/feature_toggle.rb @@ -41,4 +41,8 @@ class FeatureToggle def self.service_unavailable? false end + + def self.service_moved? + false + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2df4b9379..3b051a8bc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -91,7 +91,7 @@ navigation_classes: "govuk-header__navigation--end", ) do |component| component.product_name(name: t("service_name")) - unless FeatureToggle.service_unavailable? + unless FeatureToggle.service_moved? || FeatureToggle.service_unavailable? if current_user.nil? component.navigation_item(text: "Sign in", href: user_session_path) else diff --git a/app/views/maintenance/service_moved.html.erb b/app/views/maintenance/service_moved.html.erb new file mode 100644 index 000000000..30ee3a73e --- /dev/null +++ b/app/views/maintenance/service_moved.html.erb @@ -0,0 +1,9 @@ +
Submit social housing lettings and sales data (CORE) can now be found at <%= govuk_link_to "https://submit-social-housing-data.levellingup.gov.uk", "https://submit-social-housing-data.levellingup.gov.uk" %>. If you have bookmarked this page, you need to update it.
+