Skip to content

Commit

Permalink
Merge pull request #7517 from ministryofjustice/ap-5383-remove-mtr-2a…
Browse files Browse the repository at this point in the history
…-feature-flag

AP-5383: Remove MTR 2A feature flag
  • Loading branch information
agoldstone93 authored Dec 17, 2024
2 parents 826203b + 769b088 commit 1cd1337
Show file tree
Hide file tree
Showing 52 changed files with 267 additions and 1,181 deletions.
1 change: 0 additions & 1 deletion app/controllers/admin/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def form_params
:linked_applications,
:collect_hmrc_data,
:special_childrens_act,
:means_test_review_a,
:public_law_family)
end

Expand Down
2 changes: 0 additions & 2 deletions app/forms/settings/setting_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class SettingForm < BaseForm
:linked_applications,
:collect_hmrc_data,
:special_childrens_act,
:means_test_review_a,
:public_law_family

validates :mock_true_layer_data,
Expand All @@ -19,7 +18,6 @@ class SettingForm < BaseForm
:linked_applications,
:collect_hmrc_data,
:special_childrens_act,
:means_test_review_a,
:public_law_family,
presence: true
end
Expand Down
4 changes: 0 additions & 4 deletions app/models/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ def self.special_childrens_act?
setting.special_childrens_act
end

def self.means_test_review_a?
setting.means_test_review_a && Time.zone.today >= Rails.configuration.x.mtr_a_start_date
end

def self.public_law_family?
setting.public_law_family
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module ProviderCapital
if application.own_capital?
:restrictions
elsif application.capture_policy_disregards?
Setting.means_test_review_a? ? :capital_disregards_mandatory : :policy_disregards
:capital_disregards_mandatory
else
application.passported? ? :check_passported_answers : :check_capital_answers
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ module Steps
module ProviderCapital
PolicyDisregardsStep = Step.new(
path: ->(application) { Steps.urls.providers_legal_aid_application_means_policy_disregards_path(application) },
forward: lambda do |application|
if Setting.means_test_review_a?
:capital_disregards_discretionary
else
application.passported? ? :check_passported_answers : :check_capital_answers
end
end,
forward: :capital_disregards_discretionary,
check_answers: ->(application) { application.provider_checking_or_checked_citizens_means_answers? ? :check_capital_answers : :check_passported_answers },
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module ProviderCapital
path: ->(application) { Steps.urls.providers_legal_aid_application_means_restrictions_path(application) },
forward: lambda do |application|
if application.capture_policy_disregards?
Setting.means_test_review_a? ? :capital_disregards_mandatory : :policy_disregards
:capital_disregards_mandatory
else
application.passported? ? :check_passported_answers : :check_capital_answers
end
Expand Down
10 changes: 0 additions & 10 deletions app/views/admin/settings/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@
legend: { text: t(".labels.special_childrens_act") },
) %>

<%= form.govuk_collection_radio_buttons(
:means_test_review_a,
yes_no_options,
:value,
:label,
inline: true,
hint: { text: t(".hints.means_test_review_a", date: Rails.configuration.x.mtr_a_start_date.to_fs) },
legend: { text: t(".labels.means_test_review_a") },
) %>

<%= form.govuk_collection_radio_buttons(
:public_law_family,
yes_no_options,
Expand Down
5 changes: 2 additions & 3 deletions app/views/providers/means/own_homes/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<% prefix = Setting.means_test_review_a? ? "" : ".legacy"
heading = @legal_aid_application.applicant.has_partner_with_no_contrary_interest? ? "#{prefix}.h1_heading_with_partner" : "#{prefix}.h1_heading" %>
<% heading = @legal_aid_application.applicant.has_partner_with_no_contrary_interest? ? ".h1_heading_with_partner" : ".h1_heading" %>
<%= form_with(
model: @form,
url: providers_legal_aid_application_means_own_home_path(@legal_aid_application),
Expand All @@ -18,7 +17,7 @@

<%= form.govuk_collection_radio_buttons(:own_home, options, :first, :second,
legend: { size: "xl", tag: "h1", text: content_for(:page_title) },
hint: { text: Setting.means_test_review_a? ? t(".hint") : "" }) %>
hint: { text: t(".hint") }) %>

<%= next_action_buttons(show_draft: true, form:) %>
<% end %>
Expand Down
5 changes: 2 additions & 3 deletions app/views/providers/means/property_details/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
method: :patch,
local: true,
) do |form| %>
<% prefix = Setting.means_test_review_a? ? "" : "legacy."
individual = @legal_aid_application.applicant.has_partner_with_no_contrary_interest? ? "partner" : "client" %>
<% individual = @legal_aid_application.applicant.has_partner_with_no_contrary_interest? ? "partner" : "client" %>

<%= page_template page_title: t(".h1-heading"), form:, template: :basic do %>

<%= form.govuk_fieldset legend: { size: "xl", tag: "h1", text: t(".h1-heading") } do %>

<%= form.govuk_text_field :property_value,
label: { text: t(".values_question.#{prefix}#{individual}"), tag: "h2", size: "m" },
label: { text: t(".values_question.#{individual}"), tag: "h2", size: "m" },
hint: { text: t(".values_hint") },
prefix_text: t("currency.gbp"),
classes: "govuk-!-margin-top-6",
Expand Down
10 changes: 4 additions & 6 deletions app/views/shared/check_answers/_assets.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,10 @@

<%# capital disregards %>
<section class="print-no-break">
<% if Setting.means_test_review_a? %>
<% if means_report %>
<%= render("providers/means_reports/capital_disregards", read_only:, individual:) %>
<% else %>
<%= render("shared/check_answers/capital_disregards", read_only:, individual:) %>
<% end %>
<% if means_report %>
<%= render("providers/means_reports/capital_disregards", read_only:, individual:) %>
<% else %>
<%= render("shared/check_answers/capital_disregards", read_only:, individual:) %>
<% end %>
</section>
</section>
4 changes: 2 additions & 2 deletions app/views/shared/check_answers/_property.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
html_attributes: { id: "property-question" },
) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__own_home" }) do |row| %>
<%= row.with_key(text: t("shared.check_answers.assets.property#{'.legacy' unless Setting.means_test_review_a?}.own_home#{individual}"), classes: "govuk-!-width-one-half") %>
<%= row.with_key(text: t("shared.check_answers.assets.property.own_home#{individual}"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.own_home.blank? ? "" : t("shared.forms.own_home_form.#{@legal_aid_application.own_home}") } %>
<%= row.with_action(
text: t("generic.change"),
Expand All @@ -25,7 +25,7 @@
html_attributes: { id: "property-details-questions" },
) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__property_value" }) do |row| %>
<%= row.with_key(text: t("shared.check_answers.assets.property#{'.legacy' unless Setting.means_test_review_a?}.property_value#{individual}"), classes: "govuk-!-width-one-half") %>
<%= row.with_key(text: t("shared.check_answers.assets.property.property_value#{individual}"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { gds_number_to_currency(@legal_aid_application.property_value) } %>
<%= row.with_action(
text: t("generic.change"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
<% end %>
</ul>

<% mtra_scope = Setting.means_test_review_a? ? :mtra : :pre_mtra %>

<h2 class="govuk-heading-m"><%= t("shared.disregarded_benefits.#{mtra_scope}.header") %></h2>
<p class="govuk-body"><%= t("shared.disregarded_benefits.#{mtra_scope}.text") %></p>
<h2 class="govuk-heading-m"><%= t("shared.disregarded_benefits.header") %></h2>
<p class="govuk-body"><%= t("shared.disregarded_benefits.text") %></p>

<% %w[carer_disability low_income other].each do |category| %>
<h3 class="govuk-heading-s"><%= t("shared.disregarded_benefits.#{mtra_scope}.#{category}.heading") %></h3>
<h3 class="govuk-heading-s"><%= t("shared.disregarded_benefits.#{category}.heading") %></h3>
<ul class="govuk-list govuk-list--bullet">
<% t("shared.disregarded_benefits.#{mtra_scope}.#{category}.list_html").each do |item| %>
<% t("shared.disregarded_benefits.#{category}.list_html").each do |item| %>
<li><%= item %></li>
<% end %>
</ul>
Expand Down
3 changes: 0 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ class Application < Rails::Application

config.x.maintenance_mode = ENV.fetch("MAINTENANCE_MODE", nil)&.downcase&.eql?("true")

# TODO: Remove with Setting.means_test_review_a feature flag #
config.x.mtr_a_start_date = Date.parse(ENV.fetch("MTR_A_START_DATE", "2024-11-20"))

# automatically include locale in the query string when generating urls with url_helpers
Rails.application.routes.default_url_options[:locale] = I18n.locale
config.i18n.default_locale = :en
Expand Down
2 changes: 0 additions & 2 deletions config/locales/en/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ en:
linked_applications: Enable linking and copying cases
collect_hmrc_data: Collect HMRC data
special_childrens_act: Enable Special Childrens Act
means_test_review_a: Enable Means Test Review (MTR) A
public_law_family: Enable Public Law Family
hints:
mock_true_layer_data: Select Yes and TrueLayer data will be replaced by mock data from %{bank_transaction_filename}
Expand All @@ -88,7 +87,6 @@ en:
linked_applications: Select Yes to enable the linking and copying cases feature for solicitors
collect_hmrc_data: Select Yes to enable calls to HMRC for employment data
special_childrens_act: Select Yes to enable the special childrens act matter type
means_test_review_a: Select Yes to enable the Means Test Review (MTR) A feature after %{date}
public_law_family: Select Yes to enable Public Law Family feature

update:
Expand Down
6 changes: 0 additions & 6 deletions config/locales/en/providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1110,9 +1110,6 @@ en:
h1_heading: Does your client own the home they usually live in?
h1_heading_with_partner: Does your client or their partner own the home your client usually lives in?
hint: This is where your client normally lives, even if they have temporarily left their home due to domestic abuse.
legacy:
h1_heading: Does your client own the home that they live in?
h1_heading_with_partner: Does your client or their partner own the home your client lives in?
mortgage: Yes, with a mortgage or loan
'no': 'No'
owned_outright: Yes, owned outright
Expand All @@ -1122,9 +1119,6 @@ en:
values_question:
client: How much is the home they usually live in worth?
partner: How much is the home worth where your client and their partner usually live?
legacy:
client: How much is the home your client lives in worth?
partner: How much is the home your client and their partner live in worth?
values_hint: You can use property websites to find the estimated value.
mortgage_question: How much is left to pay on the mortgage?
mortgage_hint:
Expand Down
124 changes: 40 additions & 84 deletions config/locales/en/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,85 +222,46 @@ en:
- Energy Bills Support Scheme (EBSS)
- Payments for those who are not served by mains gas
disregarded_benefits:
mtra:
header: Disregarded benefits and payments
text: The following are disregarded from the financial eligibility calculation. They are known as mandatory disregards.
carer_disability:
heading: Carer and disability
list_html:
- Attendance Allowance
- Carer's Allowance
- Community Care Direct Payments
- Constant Attendance Allowance
- Disability Living Allowance
- Exceptionally Severe Disablement Allowance
- Independent Living Fund
- Payments on account of benefit
- Personal Independence Payments (PIP)
- Severe Disablement Allowance
- Special Education Needs (SEN) Direct Payment
- Welsh Independent Living Grant
low_income:
heading: Low income
list_html:
- Budgeting Advance
- Housing Benefit
- Social Fund Funeral Payment
- Social Fund payments
- Universal Credit advance payments
other:
heading: Other
list_html:
- Armed Forces Independence Payment
- Compensation for miscarriage of justice
- Foster Carers Allowance
- Grenfell Tower Residents' Discretionary Fund
- Grenfell Tower fire victims payments
- "Infected Blood Support Scheme<br>Includes Infected Blood Interim Compensation Payment Scheme, Infected Blood Further Interim Compensation Scheme, Infected Blood Compensation Scheme, arrangements made under section 56(1) of the Victims and Prisoners Act 2024 or earlier support schemes"
- Modern Slavery Victim Care Contract (MSVCC) payments
- Scotland and Northern Ireland Redress Schemes for historical child abuse payment
- War Pensions Scheme payments
- War Widow(er) Pension
- Windrush Compensation Scheme Payments
pre_mtra:
header: Disregarded benefits
text: The following benefits are disregarded from the financial eligibility calculation. They are known as mandatory disregards.
carer_disability:
heading: Carer and disability benefits
list_html:
- Attendance Allowance
- Carer's Allowance
- Community Care Direct Payments
- Constant Attendance Allowance
- Disability Living Allowance
- Exceptionally Severe Disablement Allowance
- Independent Living Fund
- Payments on account of benefit
- Personal Independence Payments (PIP)
- Severe Disablement Allowance
- Special Education Needs (SEN) Direct Payment
- Welsh Independent Living Grant
low_income:
heading: Low income benefits
list_html:
- Benefit Transfer Advance (Universal Credit)
- Budgeting Advance
- Council Tax Reduction
- Earnings Top-up (ETU)
- Housing Benefit
- Social Fund Funeral Payment
- Social Fund payments
other:
heading: Other benefits
list_html:
- Armed Forces Independence Payment
- Foster Carers Allowance
- Grenfell Tower Residents' Discretionary Fund
- Grenfell Tower fire victims payments
- War Pensions Scheme payments
- War Widow(er) Pension
- Widow's Pension lump sum payments
- Windrush Compensation Scheme Payments
header: Disregarded benefits and payments
text: The following are disregarded from the financial eligibility calculation. They are known as mandatory disregards.
carer_disability:
heading: Carer and disability
list_html:
- Attendance Allowance
- Carer's Allowance
- Community Care Direct Payments
- Constant Attendance Allowance
- Disability Living Allowance
- Exceptionally Severe Disablement Allowance
- Independent Living Fund
- Payments on account of benefit
- Personal Independence Payments (PIP)
- Severe Disablement Allowance
- Special Education Needs (SEN) Direct Payment
- Welsh Independent Living Grant
low_income:
heading: Low income
list_html:
- Budgeting Advance
- Housing Benefit
- Social Fund Funeral Payment
- Social Fund payments
- Universal Credit advance payments
other:
heading: Other
list_html:
- Armed Forces Independence Payment
- Compensation for miscarriage of justice
- Foster Carers Allowance
- Grenfell Tower Residents' Discretionary Fund
- Grenfell Tower fire victims payments
- "Infected Blood Support Scheme<br>Includes Infected Blood Interim Compensation Payment Scheme, Infected Blood Further Interim Compensation Scheme, Infected Blood Compensation Scheme, arrangements made under section 56(1) of the Victims and Prisoners Act 2024 or earlier support schemes"
- Modern Slavery Victim Care Contract (MSVCC) payments
- Scotland and Northern Ireland Redress Schemes for historical child abuse payment
- War Pensions Scheme payments
- War Widow(er) Pension
- Windrush Compensation Scheme Payments

means_report:
income_details:
total_income: Total income
Expand Down Expand Up @@ -390,11 +351,6 @@ en:
own_home_with_partner: Does your client or their partner own the home your client usually lives in?
property_value: How much is the home they usually live in worth?
property_value_with_partner: How much is the home your client and their partner usually live in worth?
legacy:
own_home: Does your client own the home that they live in?
own_home_with_partner: Does your client or their partner own the home that they live in?
property_value: How much is the home your client lives in worth?
property_value_with_partner: How much is the home your client and their partner live in worth?
outstanding_mortgage: How much is left to pay on the mortgage?
shared_ownership: Does your client own the home with anyone else?
shared_ownership_with_partner: Does your client or their partner own the home with anyone else?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class RemoveMeansTestReviewAFromSettings < ActiveRecord::Migration[7.2]
def change
safety_assured do
remove_column :settings, :means_test_review_a, :boolean, null: false, default: false
end
end
end
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_12_11_093840) do
ActiveRecord::Schema[7.2].define(version: 2024_12_12_085816) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand Down Expand Up @@ -1015,7 +1015,6 @@
t.boolean "linked_applications", default: false, null: false
t.boolean "collect_hmrc_data", default: false, null: false
t.boolean "special_childrens_act", default: false, null: false
t.boolean "means_test_review_a", default: false, null: false
t.boolean "public_law_family", default: false, null: false
end

Expand Down
Loading

0 comments on commit 1cd1337

Please sign in to comment.