Browse Source

feat: correct date and add notice

pull/980/head
natdeanlewissoftwire 2 years ago
parent
commit
757a908901
  1. 1
      app/controllers/schemes_controller.rb
  2. 4
      app/views/schemes/toggle_active.html.erb

1
app/controllers/schemes_controller.rb

@ -26,6 +26,7 @@ class SchemesController < ApplicationController
if @scheme.update!(deactivation_date:)
# update the logs
end
flash[:notice] = "#{@scheme.service_name} has been deactivated"
redirect_to scheme_details_path(@scheme)
return
elsif deactivation_date.present?

4
app/views/schemes/toggle_active.html.erb

@ -16,11 +16,11 @@
<%#= f.govuk_error_summary %>
<%= f.govuk_radio_buttons_fieldset :deactivation_date,
legend: nil,
hint: { text: "If the date is before 5 April 2022, select ‘From the start of the current collection period’ because the previous period has now closed."} do %>
hint: { text: "If the date is before 1 April 2022, select ‘From the start of the current collection period’ because the previous period has now closed."} do %>
<%= govuk_warning_text text: "It will not be possible to add logs with this scheme if their tenancy start date is on or after the date you enter. Any existing logs may be affected." %>
<%= f.govuk_radio_button :deactivation_date,
Time.utc(2022, 4, 1),
label: { text: "From the start of the current collection period (5 April 2022)" } %>
label: { text: "From the start of the current collection period (1 April 2022)" } %>
<%= f.govuk_radio_button :deactivation_date,
"other",

Loading…
Cancel
Save