Browse Source

feat: tweaks

CLDC-allow-23-24-form-new
natdeanlewissoftwire 2 years ago
parent
commit
8cadac0f86
  1. 7
      config/initializers/feature_toggle.rb
  2. 30
      config/locales/en.yml
  3. 2
      spec/features/form/accessible_autocomplete_spec.rb
  4. 2
      spec/features/form/progressive_total_field_spec.rb

7
config/initializers/feature_toggle.rb

@ -1,17 +1,18 @@
class FeatureToggle class FeatureToggle
# Disable check on preview apps to allow for testing of future forms # Disable collection window checks on preview apps to allow for testing of future forms
def self.saledate_collection_window_validation_enabled? def self.saledate_collection_window_validation_enabled?
Rails.env.production? || Rails.env.test? || Rails.env.staging? Rails.env.production? || Rails.env.test? || Rails.env.staging?
end end
def self.startdate_two_week_validation_enabled? def self.startdate_collection_window_validation_enabled?
Rails.env.production? || Rails.env.test? || Rails.env.staging? Rails.env.production? || Rails.env.test? || Rails.env.staging?
end end
def self.startdate_collection_window_validation_enabled? def self.startdate_two_week_validation_enabled?
Rails.env.production? || Rails.env.test? || Rails.env.staging? Rails.env.production? || Rails.env.test? || Rails.env.staging?
end end
def self.sales_log_enabled? def self.sales_log_enabled?
!Rails.env.production? !Rails.env.production?
end end

30
config/locales/en.yml

@ -44,25 +44,25 @@ en:
forms/bulk_upload_lettings/year: forms/bulk_upload_lettings/year:
attributes: attributes:
year: year:
blank: You must select a collection period to upload for blank: "You must select a collection period to upload for"
forms/bulk_upload_sales/year: forms/bulk_upload_sales/year:
attributes: attributes:
year: year:
blank: You must select a collection period to upload for blank: "You must select a collection period to upload for"
forms/bulk_upload_lettings/upload_your_file: forms/bulk_upload_lettings/upload_your_file:
attributes: attributes:
file: file:
blank: Select which file to upload blank: "Select which file to upload"
not_csv: Your file must be in CSV format not_csv: "Your file must be in CSV format"
forms/bulk_upload_sales/upload_your_file: forms/bulk_upload_sales/upload_your_file:
attributes: attributes:
file: file:
blank: Select which file to upload blank: "Select which file to upload"
not_csv: Your file must be in CSV format not_csv: "Your file must be in CSV format"
forms/bulk_upload_lettings/needstype: forms/bulk_upload_lettings/needstype:
attributes: attributes:
needstype: needstype:
blank: You must answer needs type blank: "You must answer needs type"
activerecord: activerecord:
errors: errors:
@ -136,7 +136,7 @@ en:
above_min: "%{field} must be at least %{min}" above_min: "%{field} must be at least %{min}"
date: date:
invalid_date: "Enter a date in the correct format, for example 31 1 2022" invalid_date: "Enter a date in the correct format, for example 31 1 2022"
outside_collection_window: Enter a date within the 22/23 financial year, which is between 1st April 2022 and 31st March 2023 outside_collection_window: "Enter a date within the 22/23 financial year, which is between 1st April 2022 and 31st March 2023"
postcode: "Enter a postcode in the correct format, for example AA1 1AA" postcode: "Enter a postcode in the correct format, for example AA1 1AA"
location_admin_district: "Select a local authority" location_admin_district: "Select a local authority"
email: email:
@ -151,16 +151,20 @@ en:
blank: "Enter name of other intermediate rent product" blank: "Enter name of other intermediate rent product"
saledate: saledate:
current_financial_year: current_financial_year:
Enter a date within the %{current_start_year_short}/%{current_end_year_short} financial year, which is between %{current_start_year_long} and %{current_end_year_long} "Enter a date within the %{current_start_year_short}/%{current_end_year_short} financial year, which is between %{current_start_year_long} and %{current_end_year_long}"
previous_and_current_financial_year: previous_and_current_financial_year:
"Enter a date within the %{previous_start_year_short}/%{previous_end_year_short} or %{previous_end_year_short}/%{current_end_year_short} financial years, which is between %{previous_start_year_long} and %{current_end_year_long}" "Enter a date within the %{previous_start_year_short}/%{previous_end_year_short} or %{previous_end_year_short}/%{current_end_year_short} financial years, which is between %{previous_start_year_long} and %{current_end_year_long}"
startdate: startdate:
current_financial_year:
"Enter a date within the %{current_start_year_short}/%{current_end_year_short} financial year, which is between %{current_start_year_long} and %{current_end_year_long}"
previous_and_current_financial_year:
"Enter a date within the %{previous_start_year_short}/%{previous_end_year_short} or %{previous_end_year_short}/%{current_end_year_short} financial years, which is between %{previous_start_year_long} and %{current_end_year_long}"
later_than_14_days_after: "The tenancy start date must not be later than 14 days from today’s date" later_than_14_days_after: "The tenancy start date must not be later than 14 days from today’s date"
before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme" before_scheme_end_date: "The tenancy start date must be before the end date for this supported housing scheme"
after_void_date: "Enter a tenancy start date that is after the void date" after_void_date: "Enter a tenancy start date that is after the void date"
after_major_repair_date: "Enter a tenancy start date that is after the major repair date" after_major_repair_date: "Enter a tenancy start date that is after the major repair date"
year_not_two_digits: Tenancy start year must be 2 digits year_not_two_digits: "Tenancy start year must be 2 digits"
location: location:
deactivated: "The location %{postcode} was deactivated on %{date} and was not available on the day you entered." deactivated: "The location %{postcode} was deactivated on %{date} and was not available on the day you entered."
reactivating_soon: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date" reactivating_soon: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date"
@ -176,8 +180,8 @@ en:
created_by: created_by:
invalid: "Please select owning organisation or managing organisation that you belong to" invalid: "Please select owning organisation or managing organisation that you belong to"
lettype: lettype:
general_needs_mismatch: Lettings type must be a general needs type because you selected general needs when uploading the file general_needs_mismatch: "Lettings type must be a general needs type because you selected general needs when uploading the file"
supported_housing_mismatch: Lettings type must be a supported housing type because you selected supported housing when uploading the file supported_housing_mismatch: "Lettings type must be a supported housing type because you selected supported housing when uploading the file"
property: property:
mrcdate: mrcdate:
@ -377,7 +381,7 @@ en:
other_homeless: "Answer cannot be internal transfer as the tenant was considered homeless by their landlord" other_homeless: "Answer cannot be internal transfer as the tenant was considered homeless by their landlord"
prevten_invalid: "Answer cannot be internal transfer as the household situation immediately before this letting was %{prevten}" prevten_invalid: "Answer cannot be internal transfer as the household situation immediately before this letting was %{prevten}"
reason_permanently_decanted: "Answer must be internal transfer as the tenant was permanently decanted from another property owned by this landlord" reason_permanently_decanted: "Answer must be internal transfer as the tenant was permanently decanted from another property owned by this landlord"
nominated_by_local_ha_but_la: The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority nominated_by_local_ha_but_la: "The source of the referral cannot be Nominated by local housing authority as your organisation is a local authority"
la_general_needs: la_general_needs:
internal_transfer: "Answer cannot be internal transfer as it’s the same landlord on the tenancy agreement and the household had either a fixed-term or lifetime local authority general needs tenancy immediately before this letting" internal_transfer: "Answer cannot be internal transfer as it’s the same landlord on the tenancy agreement and the household had either a fixed-term or lifetime local authority general needs tenancy immediately before this letting"
prp_referred_by_la: "The source of the referral cannot be referred by local authority housing department for a general needs log" prp_referred_by_la: "The source of the referral cannot be referred by local authority housing department for a general needs log"

2
spec/features/form/accessible_autocomplete_spec.rb

@ -1,7 +1,7 @@
require "rails_helper" require "rails_helper"
require_relative "helpers" require_relative "helpers"
RSpec.describe "Accessible Automcomplete" do RSpec.describe "Accessible Autocomplete" do
include Helpers include Helpers
let(:user) { FactoryBot.create(:user) } let(:user) { FactoryBot.create(:user) }
let(:lettings_log) do let(:lettings_log) do

2
spec/features/form/progressive_total_field_spec.rb

@ -1,7 +1,7 @@
require "rails_helper" require "rails_helper"
require_relative "helpers" require_relative "helpers"
RSpec.describe "Accessible Automcomplete" do RSpec.describe "Accessible Autocomplete" do
include Helpers include Helpers
let(:user) { FactoryBot.create(:user) } let(:user) { FactoryBot.create(:user) }
let(:lettings_log) do let(:lettings_log) do

Loading…
Cancel
Save