Browse Source

feat: update validation messages

pull/1739/head
natdeanlewissoftwire 3 years ago
parent
commit
69fb64844a
  1. 2
      app/models/validations/shared_validations.rb
  2. 15
      config/locales/en.yml

2
app/models/validations/shared_validations.rb

@ -96,7 +96,7 @@ module Validations::SharedValidations
when :deactivated then open_deactivation.deactivation_date when :deactivated then open_deactivation.deactivation_date
end end
scope = date == :activating_soon ? "#{status}.#{status(scheme_location_validation_page(field))}" : status scope = %i[activating_soon reactivating_soon].include?(status) ? "#{status}.#{scheme_location_validation_page(field)}" : status
{ scope:, date: date&.to_formatted_s(:govuk_date), deactivation_date: closest_reactivation&.deactivation_date&.to_formatted_s(:govuk_date) } { scope:, date: date&.to_formatted_s(:govuk_date), deactivation_date: closest_reactivation&.deactivation_date&.to_formatted_s(:govuk_date) }
end end

15
config/locales/en.yml

@ -249,17 +249,22 @@ en:
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"
activating_soon: activating_soon:
date_page: "The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}" date_page: "The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}"
location_page: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date" location_page: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date"
scheme_page: "This scheme's only location %{postcode} is not available until %{date}. Select another scheme or edit the tenancy start date" scheme_page: "This scheme's only location %{postcode} is not available until %{date}. Select another scheme or edit the tenancy start date"
reactivating_soon:
date_page: "The location %{postcode} is not available until %{date}. Enter a tenancy start date after %{date}"
location_page: "The location %{postcode} is not available until %{date}. Select another location or edit the tenancy start date"
scheme_page: "This scheme's only location %{postcode} is not available until %{date}. Select another scheme or edit the tenancy start date"
scheme: scheme:
deactivated: "%{name} was deactivated on %{date} and was not available on the day you entered" deactivated: "The scheme %{name} was deactivated on %{date} and was not available on the day you entered"
reactivating_soon: "The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date"
activating_soon: activating_soon:
date_page: "%{name} is not available until %{date}. Enter a tenancy start date after %{date}" date_page: "The scheme %{name} is not available until %{date}. Enter a tenancy start date after %{date}"
scheme_page: "%{name} is not available until %{date}. Select another scheme or edit the tenancy start date" scheme_page: "The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date"
reactivating_soon:
date_page: "The scheme %{name} is not available until %{date}. Enter a tenancy start date after %{date}"
scheme_page: "The scheme %{name} is not available until %{date}. Select another scheme or edit the tenancy start date"
owning_organisation: owning_organisation:
invalid: "Please select the owning organisation or managing organisation that you belong to" invalid: "Please select the owning organisation or managing organisation that you belong to"
data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation." data_sharing_agreement_not_signed: "The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."

Loading…
Cancel
Save