diff --git a/app/models/finder_schema.rb b/app/models/finder_schema.rb index bbd0c13eb..46f8657ea 100644 --- a/app/models/finder_schema.rb +++ b/app/models/finder_schema.rb @@ -6,7 +6,7 @@ class FinderSchema define_model_callbacks :update - after_update :override_signup_copy, :remove_empty_related_links, :remove_empty_organisations + after_update :remove_empty_related_links, :remove_empty_organisations # Pluralized names of all document types def self.schema_names @@ -30,6 +30,7 @@ def self.load_from_schema(type) attribute :editing_organisations, default: [] attribute :email_filter_by attribute :email_filter_facets, default: [] + attribute :email_filter_options attribute :facets, default: [] attribute :filter attribute :format_name @@ -42,7 +43,6 @@ def self.load_from_schema(type) attribute :related attribute :show_summaries, :boolean, default: false attribute :signup_content_id - attribute :signup_copy attribute :signup_link attribute :subscription_list_title_prefix attribute :summary, default: "" @@ -64,12 +64,6 @@ def format filter["format"] end - def override_signup_copy - if signup_copy.present? - _assign_attribute(:signup_copy, "You'll get an email each time a #{document_noun} is updated or a new #{document_noun} is published.") - end - end - def remove_empty_organisations organisations.reject!(&:blank?) end diff --git a/app/presenters/finder_signup_content_item_presenter.rb b/app/presenters/finder_signup_content_item_presenter.rb index 510761602..2334ba3e1 100644 --- a/app/presenters/finder_signup_content_item_presenter.rb +++ b/app/presenters/finder_signup_content_item_presenter.rb @@ -1,7 +1,7 @@ class FinderSignupContentItemPresenter attr_reader :schema, :timestamp - def initialize(schema, timestamp) + def initialize(schema, timestamp = Time.zone.now) @schema = schema @timestamp = timestamp end @@ -12,7 +12,6 @@ def to_json(*_args) title:, schema_name:, document_type:, - description:, public_updated_at:, update_type:, publishing_app:, @@ -27,8 +26,64 @@ def content_id schema.fetch("signup_content_id") end + def email_filter_facets + return [] if email_filter_by.nil? + + map_facets_to_email_facets(select_relevant_facets) + end + private + def email_filter_by + email_filter_options.fetch("email_filter_by", nil) + end + + def email_filter_options + schema.fetch("email_filter_options", {}) + end + + def select_relevant_facets + facets = schema.fetch("facets", []) + if email_filter_by == "all_selected_facets" + facets.select do |facet| + facet["filterable"] && + facet["allowed_values"] && + !(email_filter_options["all_selected_facets_except_for"] || []).include?(facet["key"]) + end + else + facets.select { |facet| facet.fetch("key") == email_filter_by } + end + end + + def map_facets_to_email_facets(facets) + facets.map do |facet| + overridden_topic_names = email_filter_options["email_alert_topic_name_overrides"]&.fetch(facet["key"], nil) || [] + + { + facet_id: facet["key"], + facet_name: facet["name"], + required: email_filter_by == "all_selected_facets" ? nil : true, + facet_choices: facet["allowed_values"].map do |allowed_value| + overridden_topic_name = overridden_topic_names.find { |override| override["facet_option_key"] == allowed_value["value"] }&.fetch("topic_name_override") + topic_name = if overridden_topic_name + overridden_topic_name + elsif email_filter_options["downcase_email_alert_topic_names"] + allowed_value["label"].downcase + else + allowed_value["label"] + end + + { + key: allowed_value["value"], + radio_button_name: allowed_value["label"], + topic_name:, + prechecked: (email_filter_options["pre_checked_email_alert_checkboxes"] || []).include?(allowed_value["value"]), + } + end, + }.compact + end + end + def locale "en" end @@ -41,10 +96,6 @@ def base_path "#{schema.fetch('base_path')}/email-signup" end - def description - schema.fetch("signup_copy", nil) - end - def document_type "finder_email_signup" end @@ -71,9 +122,8 @@ def routes def details { "beta" => schema.fetch("signup_beta", false), - "email_filter_facets" => schema.fetch("email_filter_facets", []), - # TODO: Remove email_filter_by once finder-frontend doesn't use it. - "email_filter_by" => schema.fetch("email_filter_by", nil), + "email_filter_facets" => email_filter_facets, + "email_filter_by" => email_filter_by, "filter" => schema.fetch("filter", nil), "subscription_list_title_prefix" => schema.fetch("subscription_list_title_prefix", {}), } diff --git a/lib/documents/schemas/algorithmic_transparency_records.json b/lib/documents/schemas/algorithmic_transparency_records.json index da2c3b358..223faaa06 100644 --- a/lib/documents/schemas/algorithmic_transparency_records.json +++ b/lib/documents/schemas/algorithmic_transparency_records.json @@ -21,88 +21,13 @@ ], "show_summaries": true, "signup_content_id": "99f5bacb-d1ef-4b93-87ef-bae129fed396", - "signup_copy": "You'll get an email each time a record is updated or a new record is published.", "subscription_list_title_prefix": { "singular": "Algorithmic transparency records with the following function: ", - "plural": "Algorithmic transparency records with the following functions: ", - "many": "Algorithmic transparency records: " + "plural": "Algorithmic transparency records with the following functions: " + }, + "email_filter_options": { + "email_filter_by": "algorithmic_transparency_record_function" }, - "email_filter_by": "algorithmic_transparency_record_function", - "email_filter_facets": [ - { - "facet_id": "algorithmic_transparency_record_function", - "facet_name": "Function", - "required": true, - "facet_choices": [ - { - "key": "general-public-services", - "radio_button_name": "General public services", - "topic_name": "General public services", - "prechecked": false - }, - { - "key": "defence", - "radio_button_name": "Defence", - "topic_name": "Defence", - "prechecked": false - }, - { - "key": "public-order-and-safety", - "radio_button_name": "Public order and safety", - "topic_name": "Public order and safety", - "prechecked": false - }, - { - "key": "economic-affairs", - "radio_button_name": "Economic affairs", - "topic_name": "Economic affairs", - "prechecked": false - }, - { - "key": "environmental-protection", - "radio_button_name": "Environmental protection", - "topic_name": "Environmental protection", - "prechecked": false - }, - { - "key": "housing-and-community-amenities", - "radio_button_name": "Housing and community amenities", - "topic_name": "Housing and community amenities", - "prechecked": false - }, - { - "key": "health", - "radio_button_name": "Health", - "topic_name": "Health", - "prechecked": false - }, - { - "key": "recreation-culture-and-religion", - "radio_button_name": "Recreation culture and religion", - "topic_name": "Recreation culture and religion", - "prechecked": false - }, - { - "key": "education", - "radio_button_name": "Education", - "topic_name": "Education", - "prechecked": false - }, - { - "key": "social-protection", - "radio_button_name": "Social protection", - "topic_name": "Social protection", - "prechecked": false - }, - { - "key": "regulation", - "radio_button_name": "Regulation", - "topic_name": "Regulation", - "prechecked": false - } - ] - } - ], "summary": "
Find algorithmic transparency records from UK public sector organisations with information on algorithmic tools used in decision making. These are completed in accordance with the Algorithmic Transparency Recording Standard.
Let us know what you think of this service: [feedback form]
", "document_noun": "record", "document_title": "Algorithmic transparency record", diff --git a/lib/documents/schemas/animal_disease_cases.json b/lib/documents/schemas/animal_disease_cases.json index 8f4da71ad..157a1f999 100644 --- a/lib/documents/schemas/animal_disease_cases.json +++ b/lib/documents/schemas/animal_disease_cases.json @@ -21,7 +21,6 @@ "5fa8f693-7631-11e4-a3cb-005056011aef" ], "signup_content_id": "e39c8c6e-b4c2-4dec-84fd-7f3d77f96a7d", - "signup_copy": "You'll get an email each time a case is updated or a new case is published.", "subscription_list_title_prefix": "Notifiable animal disease cases and control zones", "summary": "Find notifiable exotic animal disease cases and control zone declarations for England.
Read our guidance on notifiable diseases in animals.
", "document_noun": "case", diff --git a/lib/documents/schemas/asylum_support_decisions.json b/lib/documents/schemas/asylum_support_decisions.json index e5517cd30..57a95259a 100644 --- a/lib/documents/schemas/asylum_support_decisions.json +++ b/lib/documents/schemas/asylum_support_decisions.json @@ -21,7 +21,6 @@ "e1d2032c-6a59-4a1a-919c-dc149847dffb" ], "signup_content_id": "307ea825-594c-4d88-85c9-0809fdc9c79e", - "signup_copy": "You'll get an email each time a decision is updated or a new decision is published.", "subscription_list_title_prefix": "First-tier Tribunal (Asylum Support) decisions", "summary": "Find decisions on appeals against the Home Office heard by the First-tier Tribunal (Asylum Support).
", "document_noun": "decision", diff --git a/lib/documents/schemas/business_finance_support_schemes.json b/lib/documents/schemas/business_finance_support_schemes.json index fbaff1938..44a869bc4 100644 --- a/lib/documents/schemas/business_finance_support_schemes.json +++ b/lib/documents/schemas/business_finance_support_schemes.json @@ -10,7 +10,6 @@ }, "show_summaries": true, "signup_content_id": "32e87f32-8e37-4186-bc0c-fbed4c0f0239", - "signup_copy": "You'll get an email each time a scheme is updated or a new scheme is published.", "organisations": [ "aa750cdf-7925-429d-a2b3-0d9fa47d2c48" ], diff --git a/lib/documents/schemas/cma_cases.json b/lib/documents/schemas/cma_cases.json index ac27aa727..653a2b28f 100644 --- a/lib/documents/schemas/cma_cases.json +++ b/lib/documents/schemas/cma_cases.json @@ -13,7 +13,6 @@ "46708567-70a6-4f20-8257-6c222b3d8cb3" ], "signup_content_id": "43dd2b13-93ec-4ca6-a7a4-e2eb5f5d485a", - "signup_copy": "You'll get an email each time a case is updated or a new case is published.", "organisations": [ "957eb4ec-089b-4f71-ba2a-dc69ac8919ea" ], @@ -29,91 +28,20 @@ ], "subscription_list_title_prefix": { "singular": "CMA cases with the following case type: ", - "plural": "CMA cases with the following case types: ", - "many": "Competition and Markets Authority (CMA) cases: " + "plural": "CMA cases with the following case types: " }, - "email_filter_by": "case_type", - "email_filter_facets": [ - { - "facet_id": "case_type", - "facet_name": "Case type", - "required": true, - "facet_choices": [ - { - "key": "ca98-and-civil-cartels", - "radio_button_name": "CA98 and civil cartels", - "topic_name": "CA98 and civil cartels", - "prechecked": false - }, - { - "key": "competition-disqualification", - "radio_button_name": "Competition disqualification", - "topic_name": "competition disqualification", - "prechecked": false - }, - { - "key": "criminal-cartels", - "radio_button_name": "Criminal cartels", - "topic_name": "criminal cartels", - "prechecked": false - }, - { - "key": "digital-markets-unit", - "radio_button_name": "Digital Markets Unit", - "topic_name": "digital markets unit", - "prechecked": false - }, - { - "key": "information-and-advice-to-government", - "radio_button_name": "Information and advice to government", - "topic_name": "information and advice to government", - "prechecked": false - }, - { - "key": "markets", - "radio_button_name": "Markets", - "topic_name": "markets", - "prechecked": false - }, - { - "key": "mergers", - "radio_button_name": "Mergers", - "topic_name": "mergers", - "prechecked": false - }, - { - "key": "oim-project", - "radio_button_name": "OIM Project", - "topic_name": "oim project", - "prechecked": false - }, - { - "key": "consumer-enforcement", - "radio_button_name": "Consumer enforcement", - "topic_name": "consumer enforcement", - "prechecked": false - }, - { - "key": "regulatory-references-and-appeals", - "radio_button_name": "Regulatory references and appeals", - "topic_name": "regulatory references and appeals", - "prechecked": false - }, - { - "key": "review-of-orders-and-undertakings", - "radio_button_name": "Reviews of orders and undertakings", - "topic_name": "reviews of orders and undertakings", - "prechecked": false - }, - { - "key": "sau-referral", - "radio_button_name": "SAU referral", - "topic_name": "sau referral", - "prechecked": false + "email_filter_options": { + "email_filter_by": "case_type", + "downcase_email_alert_topic_names": true, + "email_alert_topic_name_overrides": { + "case_type": [ + { + "facet_option_key": "ca98-and-civil-cartels", + "topic_name_override": "CA98 and civil cartels" } ] } - ], + }, "document_noun": "case", "document_title": "CMA Case", "facets": [ diff --git a/lib/documents/schemas/employment_appeal_tribunal_decisions.json b/lib/documents/schemas/employment_appeal_tribunal_decisions.json index 073ba353f..591285a7f 100644 --- a/lib/documents/schemas/employment_appeal_tribunal_decisions.json +++ b/lib/documents/schemas/employment_appeal_tribunal_decisions.json @@ -21,7 +21,6 @@ "357110bb-cbc5-4708-9711-1b26e6c63e86" ], "signup_content_id": "1f5911f4-417a-4380-a5a0-674ebff332df", - "signup_copy": "You'll get an email each time a decision is updated or a new decision is published.", "subscription_list_title_prefix": "Employment Appeal Tribunal decisions", "summary": "Find decisions on appeals against employment tribunals heard by the Employment Appeal Tribunal.
Includes decisions after December 2015. Find details of older cases.
", "document_noun": "decision", diff --git a/lib/documents/schemas/employment_tribunal_decisions.json b/lib/documents/schemas/employment_tribunal_decisions.json index a628f0a3b..bbcbf90d0 100644 --- a/lib/documents/schemas/employment_tribunal_decisions.json +++ b/lib/documents/schemas/employment_tribunal_decisions.json @@ -21,345 +21,26 @@ "357110bb-cbc5-4708-9711-1b26e6c63e86" ], "signup_content_id": "6d7ace06-f437-4fb3-b948-8534ff34540f", - "signup_copy": "You'll get an email each time a decision is updated or a new decision is published.", "subscription_list_title_prefix": "Employment tribunal decisions", "summary": "Find decisions on Employment Tribunal cases in England, Wales and Scotland from February 2017 onwards.
For enquiries about Employment Tribunal judgments in England and Wales prior to February 2017 contact Bury St Edmunds County Court. Please note that we are currently experiencing technical difficulties with the system used to search for judgments. Unfortunately, we are unable to confirm when this issue will be resolved and there may be a delay to you receiving the judgment you have requested.
If the decision was made before February 2017 in Scotland, contact Glasgow Tribunals Centre.
Decisions are not affected by GDPR rules and cannot be removed from GOV.UK.
", "document_noun": "decision", "document_title": "ET Decision", - "email_filter_by": "tribunal_decision_categories", - "email_filter_facets": [ - { - "facet_id": "tribunal_decision_categories", - "facet_name": "Jurisdiction codes", - "required": true, - "facet_choices": [ - { - "radio_button_name": "Age Discrimination", - "topic_name": "age discrimination", - "key": "age-discrimination", - "prechecked": false - }, - { - "radio_button_name": "Agency Workers", - "topic_name": "agency workers", - "key": "agency-workers", - "prechecked": false - }, - { - "radio_button_name": "Blacklisting Regulations", - "topic_name": "blacklisting regulations", - "key": "blacklisting-regulations", - "prechecked": false - }, - { - "radio_button_name": "Breach of Contract", - "topic_name": "breach of contract", - "key": "breach-of-contract", - "prechecked": false - }, - { - "radio_button_name": "Central Arbitration Committee (CAC)", - "topic_name": "central arbitration committee (CAC)", - "key": "central-arbitration-committee-cac", - "prechecked": false - }, - { - "radio_button_name": "Certification Officer", - "topic_name": "certification officer", - "key": "certification-officer", - "prechecked": false - }, - { - "radio_button_name": "Contract of Employment", - "topic_name": "contract of employment", - "key": "contract-of-employment", - "prechecked": false - }, - { - "radio_button_name": "Disability Discrimination", - "topic_name": "disability discrimination", - "key": "disability-discrimination", - "prechecked": false - }, - { - "radio_button_name": "Employment Agencies Act 1973", - "topic_name": "employment agencies act 1973", - "key": "employment-agencies-act-1973", - "prechecked": false - }, - { - "radio_button_name": "Equal Pay Act", - "topic_name": "equal pay act", - "key": "equal-pay-act", - "prechecked": false - }, - { - "radio_button_name": "European Material", - "topic_name": "european material", - "key": "european-material", - "prechecked": false - }, - { - "radio_button_name": "Fixed Term Regulations", - "topic_name": "fixed term regulations", - "key": "fixed-term-regulations", - "prechecked": false - }, - { - "radio_button_name": "Flexible Working", - "topic_name": "flexible working", - "key": "flexible-working", - "prechecked": false - }, + "email_filter_options": { + "email_filter_by": "tribunal_decision_categories", + "downcase_email_alert_topic_names": true, + "email_alert_topic_name_overrides": { + "tribunal_decision_categories": [ { - "radio_button_name": "Harassment", - "topic_name": "harassment", - "key": "harassment", - "prechecked": false + "facet_option_key": "central-arbitration-committee-cac", + "topic_name_override": "central arbitration committee (CAC)" }, { - "radio_button_name": "Health & Safety", - "topic_name": "health & safety", - "key": "health-safety", - "prechecked": false - }, - { - "radio_button_name": "Human Rights", - "topic_name": "human rights", - "key": "human-rights", - "prechecked": false - }, - { - "radio_button_name": "Improvement Notice", - "topic_name": "improvement notice", - "key": "improvement-notice", - "prechecked": false - }, - { - "radio_button_name": "Interim Relief", - "topic_name": "interim relief", - "key": "interim-relief", - "prechecked": false - }, - { - "radio_button_name": "Jurisdictional Points", - "topic_name": "jurisdictional points", - "key": "jurisdictional-points", - "prechecked": false - }, - { - "radio_button_name": "Maternity and Pregnancy Rights", - "topic_name": "maternity and pregnancy rights", - "key": "maternity-and-pregnancy-rights", - "prechecked": false - }, - { - "radio_button_name": "National Minimum Wage", - "topic_name": "national minimum wage", - "key": "national-minimum-wage", - "prechecked": false - }, - { - "radio_button_name": "National Security", - "topic_name": "national security", - "key": "national-security", - "prechecked": false - }, - { - "radio_button_name": "Notice Appeal", - "topic_name": "notice appeal", - "key": "notice-appeal", - "prechecked": false - }, - { - "radio_button_name": "Parental and Maternity Leave", - "topic_name": "parental and maternity leave", - "key": "parental-and-maternity-leave", - "prechecked": false - }, - { - "radio_button_name": "Part Time Workers", - "topic_name": "part time workers", - "key": "part-time-workers", - "prechecked": false - }, - { - "radio_button_name": "Pension", - "topic_name": "pension", - "key": "pension", - "prechecked": false - }, - { - "radio_button_name": "Practice and Procedure Issues", - "topic_name": "practice and procedure issues", - "key": "practice-and-procedure-issues", - "prechecked": false - }, - { - "radio_button_name": "Protective Award", - "topic_name": "protective award", - "key": "protective-award", - "prechecked": false - }, - { - "radio_button_name": "Public Interest Disclosure", - "topic_name": "public interest disclosure", - "key": "public-interest-disclosure", - "prechecked": false - }, - { - "radio_button_name": "Race Discrimination", - "topic_name": "race discrimination", - "key": "race-discrimination", - "prechecked": false - }, - { - "radio_button_name": "Redundancy", - "topic_name": "redundancy", - "key": "redundancy", - "prechecked": false - }, - { - "radio_button_name": "Religion or Belief Discrimination", - "topic_name": "religion or belief discrimination", - "key": "religion-or-belief-discrimination", - "prechecked": false - }, - { - "radio_button_name": "Remuneration", - "topic_name": "renumeration", - "key": "renumeration", - "prechecked": false - }, - { - "radio_button_name": "Reorganisation", - "topic_name": "reorganisation", - "key": "reorganisation", - "prechecked": false - }, - { - "radio_button_name": "Reserved Forces Act", - "topic_name": "reserved forces act", - "key": "reserved-forces-act", - "prechecked": false - }, - { - "radio_button_name": "Right To Be Accompanied", - "topic_name": "right to be accompanied", - "key": "right-to-be-accompanied", - "prechecked": false - }, - { - "radio_button_name": "Rights on Insolvency", - "topic_name": "rights on insolvency", - "key": "rights-on-insolvency", - "prechecked": false - }, - { - "radio_button_name": "Sex Discrimination", - "topic_name": "sex discrimination", - "key": "sex-discrimination", - "prechecked": false - }, - { - "radio_button_name": "Sexual Orientation Discrimination/Transexualism", - "topic_name": "sexual orientation discrimination/transexualism", - "key": "sexual-orientation-discrimination-transexualism", - "prechecked": false - }, - { - "radio_button_name": "Statutory Discipline and Grievance Procedures", - "topic_name": "statutory discipline and grievance procedures", - "key": "statutory-discipline-and-grievance-procedures", - "prechecked": false - }, - { - "radio_button_name": "Tax", - "topic_name": "tax", - "key": "tax", - "prechecked": false - }, - { - "radio_button_name": "Temporary Employment", - "topic_name": "temporary employment", - "key": "temporary-employment", - "prechecked": false - }, - { - "radio_button_name": "Time Limits", - "topic_name": "time limits", - "key": "time-limits", - "prechecked": false - }, - { - "radio_button_name": "Time Off", - "topic_name": "time off", - "key": "time-off", - "prechecked": false - }, - { - "radio_button_name": "Time to Train", - "topic_name": "time to train", - "key": "time-to-train", - "prechecked": false - }, - { - "radio_button_name": "Trade Union Membership", - "topic_name": "trade union membership", - "key": "trade-union-membership", - "prechecked": false - }, - { - "radio_button_name": "Trade Union Rights", - "topic_name": "trade union rights", - "key": "trade-union-rights", - "prechecked": false - }, - { - "radio_button_name": "Transfer of Undertakings", - "topic_name": "transfer of undertakings", - "key": "transfer-of-undertakings", - "prechecked": false - }, - { - "radio_button_name": "Unfair Dismissal", - "topic_name": "unfair dismissal", - "key": "unfair-dismissal", - "prechecked": false - }, - { - "radio_button_name": "Unlawful Deduction from Wages", - "topic_name": "unlawful deduction from wages", - "key": "unlawful-deduction-from-wages", - "prechecked": false - }, - { - "radio_button_name": "Victimisation Discrimination", - "topic_name": "victimisation discrimination", - "key": "victimisation-discrimination", - "prechecked": false - }, - { - "radio_button_name": "Working Time Regulations", - "topic_name": "working time regulations", - "key": "working-time-regulations", - "prechecked": false - }, - { - "radio_button_name": "Written Pay Statement", - "topic_name": "written pay statement", - "key": "written-pay-statement", - "prechecked": false - }, - { - "radio_button_name": "Written Statements", - "topic_name": "written statements", - "key": "written-statements", - "prechecked": false + "facet_option_key": "renumeration", + "topic_name_override": "renumeration" } ] } - ], + }, "facets": [ { "key": "tribunal_decision_country", diff --git a/lib/documents/schemas/esi_funds.json b/lib/documents/schemas/esi_funds.json index 830a87981..026ff92ee 100644 --- a/lib/documents/schemas/esi_funds.json +++ b/lib/documents/schemas/esi_funds.json @@ -12,7 +12,6 @@ }, "default_order": "-closing_date", "signup_content_id": "a4815714-e5d5-4e1b-8543-3ce10139988f", - "signup_copy": "You'll get an email each time a fund is updated or a new fund is published.", "organisations": [ "2e7868a8-38f5-4ff6-b62f-9a15d1c22d28", "b548a09f-8b35-4104-89f4-f1a40bf3136d", @@ -24,73 +23,12 @@ ], "subscription_list_title_prefix": { "singular": "European Structural and Investment Fund with the following location: ", - "plural": "European Structural and Investment Funds with the following locations: ", - "many": "European Structural and Investment Funds: " + "plural": "European Structural and Investment Funds with the following locations: " + }, + "email_filter_options": { + "email_filter_by": "location", + "downcase_email_alert_topic_names": true }, - "email_filter_by": "location", - "email_filter_facets": [ - { - "facet_id": "location", - "facet_name": "Locations", - "required": true, - "facet_choices": [ - { - "key": "north-east", - "radio_button_name": "North East", - "topic_name": "north east", - "prechecked": false - }, - { - "key": "north-west", - "radio_button_name": "North West", - "topic_name": "north west", - "prechecked": false - }, - { - "key": "yorkshire-and-humber", - "radio_button_name": "Yorkshire and Humber", - "topic_name": "yorkshire and humber", - "prechecked": false - }, - { - "key": "east-midlands", - "radio_button_name": "East Midlands", - "topic_name": "east midlands", - "prechecked": false - }, - { - "key": "west-midlands", - "radio_button_name": "West Midlands", - "topic_name": "west midlands", - "prechecked": false - }, - { - "key": "east-of-england", - "radio_button_name": "East of England", - "topic_name": "east of england", - "prechecked": false - }, - { - "key": "south-east", - "radio_button_name": "South East", - "topic_name": "south east", - "prechecked": false - }, - { - "key": "south-west", - "radio_button_name": "South West", - "topic_name": "south west", - "prechecked": false - }, - { - "key": "london", - "radio_button_name": "London", - "topic_name": "london", - "prechecked": false - } - ] - } - ], "document_noun": "call", "document_title": "ESI Fund", "facets": [ diff --git a/lib/documents/schemas/export_health_certificates.json b/lib/documents/schemas/export_health_certificates.json index ac51ac806..d3655d18f 100644 --- a/lib/documents/schemas/export_health_certificates.json +++ b/lib/documents/schemas/export_health_certificates.json @@ -13,1409 +13,21 @@ "4ad67f14-6f9c-4fa4-80ab-687b6d81ea6f" ], "signup_content_id": "9a5260d2-07e7-45dc-a24a-791b02e4a9da", - "signup_copy": "You'll get an email each time an export health certificate is updated or a new export health certificate is published.", "subscription_list_title_prefix": "Export health certificates", - "email_filter_by": "all_selected_facets", - "email_filter_facets": [ - { - "facet_id": "destination_country", - "facet_name": "destination country", - "facet_choices": [ - { - "key": "afghanistan", - "radio_button_name": "Afghanistan", - "topic_name": "Afghanistan", - "prechecked": false - }, - { - "key": "albania", - "radio_button_name": "Albania", - "topic_name": "Albania", - "prechecked": false - }, - { - "key": "algeria", - "radio_button_name": "Algeria", - "topic_name": "Algeria", - "prechecked": false - }, - { - "key": "andean-community-of-peru-bolivia-colombia-ecuador", - "radio_button_name": "Andean Community of Peru, Bolivia, Colombia, Ecuador", - "topic_name": "Andean Community of Peru, Bolivia, Colombia, Ecuador", - "prechecked": false - }, - { - "key": "angola", - "radio_button_name": "Angola", - "topic_name": "Angola", - "prechecked": false - }, - { - "key": "anguilla", - "radio_button_name": "Anguilla", - "topic_name": "Anguilla", - "prechecked": false - }, - { - "key": "antigua", - "radio_button_name": "Antigua", - "topic_name": "Antigua", - "prechecked": false - }, - { - "key": "argentina", - "radio_button_name": "Argentina", - "topic_name": "Argentina", - "prechecked": false - }, - { - "key": "armenia", - "radio_button_name": "Armenia", - "topic_name": "Armenia", - "prechecked": false - }, - { - "key": "ascension-island", - "radio_button_name": "Ascension Island", - "topic_name": "Ascension Island", - "prechecked": false - }, - { - "key": "australia", - "radio_button_name": "Australia", - "topic_name": "Australia", - "prechecked": false - }, - { - "key": "austria", - "radio_button_name": "Austria", - "topic_name": "Austria", - "prechecked": false - }, - { - "key": "azerbaijan", - "radio_button_name": "Azerbaijan", - "topic_name": "Azerbaijan", - "prechecked": false - }, - { - "key": "bahamas", - "radio_button_name": "Bahamas", - "topic_name": "Bahamas", - "prechecked": false - }, - { - "key": "bahrain", - "radio_button_name": "Bahrain", - "topic_name": "Bahrain", - "prechecked": false - }, - { - "key": "bangladesh", - "radio_button_name": "Bangladesh", - "topic_name": "Bangladesh", - "prechecked": false - }, - { - "key": "barbados", - "radio_button_name": "Barbados", - "topic_name": "Barbados", - "prechecked": false - }, - { - "key": "belarus", - "radio_button_name": "Belarus", - "topic_name": "Belarus", - "prechecked": false - }, - { - "key": "belgium", - "radio_button_name": "Belgium", - "topic_name": "Belgium", - "prechecked": false - }, - { - "key": "belize", - "radio_button_name": "Belize", - "topic_name": "Belize", - "prechecked": false - }, - { - "key": "benin", - "radio_button_name": "Benin", - "topic_name": "Benin", - "prechecked": false - }, - { - "key": "bermuda", - "radio_button_name": "Bermuda", - "topic_name": "Bermuda", - "prechecked": false - }, - { - "key": "bhutan", - "radio_button_name": "Bhutan", - "topic_name": "Bhutan", - "prechecked": false - }, - { - "key": "bolivia", - "radio_button_name": "Bolivia", - "topic_name": "Bolivia", - "prechecked": false - }, - { - "key": "bosnia-and-herzegovina", - "radio_button_name": "Bosnia and Herzegovina", - "topic_name": "Bosnia and Herzegovina", - "prechecked": false - }, - { - "key": "botswana", - "radio_button_name": "Botswana", - "topic_name": "Botswana", - "prechecked": false - }, - { - "key": "brazil", - "radio_button_name": "Brazil", - "topic_name": "Brazil", - "prechecked": false - }, - { - "key": "british-virgin-islands", - "radio_button_name": "British Virgin Islands", - "topic_name": "British Virgin Islands", - "prechecked": false - }, - { - "key": "brunei", - "radio_button_name": "Brunei", - "topic_name": "Brunei", - "prechecked": false - }, - { - "key": "bulgaria", - "radio_button_name": "Bulgaria", - "topic_name": "Bulgaria", - "prechecked": false - }, - { - "key": "burkina-faso", - "radio_button_name": "Burkina Faso", - "topic_name": "Burkina Faso", - "prechecked": false - }, - { - "key": "burundi", - "radio_button_name": "Burundi", - "topic_name": "Burundi", - "prechecked": false - }, - { - "key": "cambodia", - "radio_button_name": "Cambodia", - "topic_name": "Cambodia", - "prechecked": false - }, - { - "key": "cameroon", - "radio_button_name": "Cameroon", - "topic_name": "Cameroon", - "prechecked": false - }, - { - "key": "canada", - "radio_button_name": "Canada", - "topic_name": "Canada", - "prechecked": false - }, - { - "key": "cape-verde", - "radio_button_name": "Cape Verde", - "topic_name": "Cape Verde", - "prechecked": false - }, - { - "key": "cayman-islands", - "radio_button_name": "Cayman Islands", - "topic_name": "Cayman Islands", - "prechecked": false - }, - { - "key": "central-african-republic", - "radio_button_name": "Central African Republic", - "topic_name": "Central African Republic", - "prechecked": false - }, - { - "key": "chad", - "radio_button_name": "Chad", - "topic_name": "Chad", - "prechecked": false - }, - { - "key": "chile", - "radio_button_name": "Chile", - "topic_name": "Chile", - "prechecked": false - }, - { - "key": "china", - "radio_button_name": "China", - "topic_name": "China", - "prechecked": false - }, - { - "key": "colombia", - "radio_button_name": "Colombia", - "topic_name": "Colombia", - "prechecked": false - }, - { - "key": "comoros", - "radio_button_name": "Comoros", - "topic_name": "Comoros", - "prechecked": false - }, - { - "key": "congo-democratic-republic-of", - "radio_button_name": "Congo, Democratic Republic of", - "topic_name": "Congo, Democratic Republic of", - "prechecked": false - }, - { - "key": "congo-republic-of", - "radio_button_name": "Congo, Republic of", - "topic_name": "Congo, Republic of", - "prechecked": false - }, - { - "key": "costa-rica", - "radio_button_name": "Costa Rica", - "topic_name": "Costa Rica", - "prechecked": false - }, - { - "key": "cote-d-ivoire", - "radio_button_name": "Cote d'Ivoire", - "topic_name": "Cote d'Ivoire", - "prechecked": false - }, - { - "key": "croatia", - "radio_button_name": "Croatia", - "topic_name": "Croatia", - "prechecked": false - }, - { - "key": "cuba", - "radio_button_name": "Cuba", - "topic_name": "Cuba", - "prechecked": false - }, - { - "key": "cyprus", - "radio_button_name": "Cyprus", - "topic_name": "Cyprus", - "prechecked": false - }, - { - "key": "czech-republic", - "radio_button_name": "Czech Republic", - "topic_name": "Czech Republic", - "prechecked": false - }, - { - "key": "denmark", - "radio_button_name": "Denmark", - "topic_name": "Denmark", - "prechecked": false - }, - { - "key": "djibouti", - "radio_button_name": "Djibouti", - "topic_name": "Djibouti", - "prechecked": false - }, - { - "key": "dominica", - "radio_button_name": "Dominica", - "topic_name": "Dominica", - "prechecked": false - }, - { - "key": "dominican-republic", - "radio_button_name": "Dominican Republic", - "topic_name": "Dominican Republic", - "prechecked": false - }, - { - "key": "east-timor", - "radio_button_name": "East Timor", - "topic_name": "East Timor", - "prechecked": false - }, - { - "key": "ecuador", - "radio_button_name": "Ecuador", - "topic_name": "Ecuador", - "prechecked": false - }, - { - "key": "egypt", - "radio_button_name": "Egypt", - "topic_name": "Egypt", - "prechecked": false - }, - { - "key": "el-salvador", - "radio_button_name": "El Salvador", - "topic_name": "El Salvador", - "prechecked": false - }, - { - "key": "equatorial-guinea", - "radio_button_name": "Equatorial Guinea", - "topic_name": "Equatorial Guinea", - "prechecked": false - }, - { - "key": "eritrea", - "radio_button_name": "Eritrea", - "topic_name": "Eritrea", - "prechecked": false - }, - { - "key": "estonia", - "radio_button_name": "Estonia", - "topic_name": "Estonia", - "prechecked": false - }, - { - "key": "eswatini-previously-swaziland", - "radio_button_name": "Eswatini (previously Swaziland)", - "topic_name": "Eswatini (previously Swaziland)", - "prechecked": false - }, - { - "key": "ethiopia", - "radio_button_name": "Ethiopia", - "topic_name": "Ethiopia", - "prechecked": false - }, - { - "key": "eu", - "radio_button_name": "EU", - "topic_name": "EU", - "prechecked": false - }, - { - "key": "eurasian-customs-union", - "radio_button_name": "Eurasian Economic Union", - "topic_name": "Eurasian Customs Union", - "prechecked": false - }, - { - "key": "falkland-islands", - "radio_button_name": "Falkland Islands", - "topic_name": "Falkland Islands", - "prechecked": false - }, - { - "key": "faroe-islands", - "radio_button_name": "Faroe Islands", - "topic_name": "Faroe Islands", - "prechecked": false - }, - { - "key": "federated-states-of-micronesia", - "radio_button_name": "Federated States of Micronesia", - "topic_name": "Federated States of Micronesia", - "prechecked": false - }, - { - "key": "fiji", - "radio_button_name": "Fiji", - "topic_name": "Fiji", - "prechecked": false - }, - { - "key": "finland", - "radio_button_name": "Finland", - "topic_name": "Finland", - "prechecked": false - }, - { - "key": "france", - "radio_button_name": "France", - "topic_name": "France", - "prechecked": false - }, - { - "key": "french-polynesia", - "radio_button_name": "French Polynesia", - "topic_name": "French Polynesia", - "prechecked": false - }, - { - "key": "gabon", - "radio_button_name": "Gabon", - "topic_name": "Gabon", - "prechecked": false - }, - { - "key": "gambia", - "radio_button_name": "Gambia", - "topic_name": "Gambia", - "prechecked": false - }, - { - "key": "georgia", - "radio_button_name": "Georgia", - "topic_name": "Georgia", - "prechecked": false - }, - { - "key": "germany", - "radio_button_name": "Germany", - "topic_name": "Germany", - "prechecked": false - }, - { - "key": "ghana", - "radio_button_name": "Ghana", - "topic_name": "Ghana", - "prechecked": false - }, - { - "key": "gibraltar", - "radio_button_name": "Gibraltar", - "topic_name": "Gibraltar", - "prechecked": false - }, - { - "key": "great-britain", - "radio_button_name": "Great Britain", - "topic_name": "Great Britain", - "prechecked": false - }, - { - "key": "greece", - "radio_button_name": "Greece", - "topic_name": "Greece", - "prechecked": false - }, - { - "key": "grenada", - "radio_button_name": "Grenada", - "topic_name": "Grenada", - "prechecked": false - }, - { - "key": "guam", - "radio_button_name": "Guam", - "topic_name": "Guam", - "prechecked": false - }, - { - "key": "guatemala", - "radio_button_name": "Guatemala", - "topic_name": "Guatemala", - "prechecked": false - }, - { - "key": "guernsey", - "radio_button_name": "Guernsey", - "topic_name": "Guernsey", - "prechecked": false - }, - { - "key": "guinea", - "radio_button_name": "Guinea", - "topic_name": "Guinea", - "prechecked": false - }, - { - "key": "guinea-bissau", - "radio_button_name": "Guinea-Bissau", - "topic_name": "Guinea-Bissau", - "prechecked": false - }, - { - "key": "guyana", - "radio_button_name": "Guyana", - "topic_name": "Guyana", - "prechecked": false - }, - { - "key": "haiti", - "radio_button_name": "Haiti", - "topic_name": "Haiti", - "prechecked": false - }, - { - "key": "hawaii", - "radio_button_name": "Hawaii", - "topic_name": "Hawaii", - "prechecked": false - }, - { - "key": "honduras", - "radio_button_name": "Honduras", - "topic_name": "Honduras", - "prechecked": false - }, - { - "key": "hong-kong", - "radio_button_name": "Hong Kong", - "topic_name": "Hong Kong", - "prechecked": false - }, - { - "key": "hungary", - "radio_button_name": "Hungary", - "topic_name": "Hungary", - "prechecked": false - }, - { - "key": "iceland", - "radio_button_name": "Iceland", - "topic_name": "Iceland", - "prechecked": false - }, - { - "key": "india", - "radio_button_name": "India", - "topic_name": "India", - "prechecked": false - }, - { - "key": "indonesia", - "radio_button_name": "Indonesia", - "topic_name": "Indonesia", - "prechecked": false - }, - { - "key": "iran", - "radio_button_name": "Iran", - "topic_name": "Iran", - "prechecked": false - }, - { - "key": "iraq", - "radio_button_name": "Iraq", - "topic_name": "Iraq", - "prechecked": false - }, - { - "key": "isle-of-man", - "radio_button_name": "Isle Of Man", - "topic_name": "Isle Of Man", - "prechecked": false - }, - { - "key": "israel", - "radio_button_name": "Israel", - "topic_name": "Israel", - "prechecked": false - }, - { - "key": "italy", - "radio_button_name": "Italy", - "topic_name": "Italy", - "prechecked": false - }, - { - "key": "jamaica", - "radio_button_name": "Jamaica", - "topic_name": "Jamaica", - "prechecked": false - }, - { - "key": "japan", - "radio_button_name": "Japan", - "topic_name": "Japan", - "prechecked": false - }, - { - "key": "jersey", - "radio_button_name": "Jersey", - "topic_name": "Jersey", - "prechecked": false - }, - { - "key": "jordan", - "radio_button_name": "Jordan", - "topic_name": "Jordan", - "prechecked": false - }, - { - "key": "kazakhstan", - "radio_button_name": "Kazakhstan", - "topic_name": "Kazakhstan", - "prechecked": false - }, - { - "key": "kenya", - "radio_button_name": "Kenya", - "topic_name": "Kenya", - "prechecked": false - }, - { - "key": "kiribati", - "radio_button_name": "Kiribati", - "topic_name": "Kiribati", - "prechecked": false - }, - { - "key": "kosovo", - "radio_button_name": "Kosovo", - "topic_name": "Kosovo", - "prechecked": false - }, - { - "key": "kuwait", - "radio_button_name": "Kuwait", - "topic_name": "Kuwait", - "prechecked": false - }, - { - "key": "kyrgyzstan", - "radio_button_name": "Kyrgyzstan", - "topic_name": "Kyrgyzstan", - "prechecked": false - }, - { - "key": "laos", - "radio_button_name": "Laos", - "topic_name": "Laos", - "prechecked": false - }, - { - "key": "latvia", - "radio_button_name": "Latvia", - "topic_name": "Latvia", - "prechecked": false - }, - { - "key": "lebanon", - "radio_button_name": "Lebanon", - "topic_name": "Lebanon", - "prechecked": false - }, - { - "key": "lesotho", - "radio_button_name": "Lesotho", - "topic_name": "Lesotho", - "prechecked": false - }, - { - "key": "liberia", - "radio_button_name": "Liberia", - "topic_name": "Liberia", - "prechecked": false - }, - { - "key": "libya", - "radio_button_name": "Libya", - "topic_name": "Libya", - "prechecked": false - }, - { - "key": "liechtenstein", - "radio_button_name": "Liechtenstein", - "topic_name": "Liechtenstein", - "prechecked": false - }, - { - "key": "lithuania", - "radio_button_name": "Lithuania", - "topic_name": "Lithuania", - "prechecked": false - }, - { - "key": "luxembourg", - "radio_button_name": "Luxembourg", - "topic_name": "Luxembourg", - "prechecked": false - }, - { - "key": "macao", - "radio_button_name": "Macao", - "topic_name": "Macao", - "prechecked": false - }, - { - "key": "madagascar", - "radio_button_name": "Madagascar", - "topic_name": "Madagascar", - "prechecked": false - }, - { - "key": "malawi", - "radio_button_name": "Malawi", - "topic_name": "Malawi", - "prechecked": false - }, - { - "key": "malaysia", - "radio_button_name": "Malaysia", - "topic_name": "Malaysia", - "prechecked": false - }, - { - "key": "maldives", - "radio_button_name": "Maldives", - "topic_name": "Maldives", - "prechecked": false - }, - { - "key": "mali", - "radio_button_name": "Mali", - "topic_name": "Mali", - "prechecked": false - }, - { - "key": "malta", - "radio_button_name": "Malta", - "topic_name": "Malta", - "prechecked": false - }, - { - "key": "marshall-islands", - "radio_button_name": "Marshall Islands", - "topic_name": "Marshall Islands", - "prechecked": false - }, - { - "key": "mauritania", - "radio_button_name": "Mauritania", - "topic_name": "Mauritania", - "prechecked": false - }, - { - "key": "mauritius", - "radio_button_name": "Mauritius", - "topic_name": "Mauritius", - "prechecked": false - }, - { - "key": "mexico", - "radio_button_name": "Mexico", - "topic_name": "Mexico", - "prechecked": false - }, - { - "key": "moldova", - "radio_button_name": "Moldova", - "topic_name": "Moldova", - "prechecked": false - }, - { - "key": "mongolia", - "radio_button_name": "Mongolia", - "topic_name": "Mongolia", - "prechecked": false - }, - { - "key": "montenegro", - "radio_button_name": "Montenegro", - "topic_name": "Montenegro", - "prechecked": false - }, - { - "key": "montserrat", - "radio_button_name": "Montserrat", - "topic_name": "Montserrat", - "prechecked": false - }, - { - "key": "morocco", - "radio_button_name": "Morocco", - "topic_name": "Morocco", - "prechecked": false - }, - { - "key": "mozambique", - "radio_button_name": "Mozambique", - "topic_name": "Mozambique", - "prechecked": false - }, - { - "key": "myanmar", - "radio_button_name": "Myanmar", - "topic_name": "Myanmar", - "prechecked": false - }, - { - "key": "namibia", - "radio_button_name": "Namibia", - "topic_name": "Namibia", - "prechecked": false - }, - { - "key": "nauru", - "radio_button_name": "Nauru", - "topic_name": "Nauru", - "prechecked": false - }, - { - "key": "nepal", - "radio_button_name": "Nepal", - "topic_name": "Nepal", - "prechecked": false - }, - { - "key": "netherlands", - "radio_button_name": "Netherlands", - "topic_name": "Netherlands", - "prechecked": false - }, - { - "key": "new-caledonia", - "radio_button_name": "New Caledonia", - "topic_name": "New Caledonia", - "prechecked": false - }, - { - "key": "new-zealand", - "radio_button_name": "New Zealand", - "topic_name": "New Zealand", - "prechecked": false - }, - { - "key": "nicaragua", - "radio_button_name": "Nicaragua", - "topic_name": "Nicaragua", - "prechecked": false - }, - { - "key": "niger", - "radio_button_name": "Niger", - "topic_name": "Niger", - "prechecked": false - }, - { - "key": "nigeria", - "radio_button_name": "Nigeria", - "topic_name": "Nigeria", - "prechecked": false - }, - { - "key": "north-korea", - "radio_button_name": "North Korea", - "topic_name": "North Korea", - "prechecked": false - }, - { - "key": "north-macedonia", - "radio_button_name": "North Macedonia", - "topic_name": "North Macedonia", - "prechecked": false - }, - { - "key": "north-sudan", - "radio_button_name": "North Sudan", - "topic_name": "North Sudan", - "prechecked": false - }, - { - "key": "northern-cyprus", - "radio_button_name": "Northern Cyprus", - "topic_name": "Northern Cyprus", - "prechecked": false - }, - { - "key": "northern-ireland", - "radio_button_name": "Northern Ireland", - "topic_name": "Northern Ireland", - "prechecked": false - }, - { - "key": "norway", - "radio_button_name": "Norway", - "topic_name": "Norway", - "prechecked": false - }, - { - "key": "oman", - "radio_button_name": "Oman", - "topic_name": "Oman", - "prechecked": false - }, - { - "key": "pakistan", - "radio_button_name": "Pakistan", - "topic_name": "Pakistan", - "prechecked": false - }, - { - "key": "palau", - "radio_button_name": "Palau", - "topic_name": "Palau", - "prechecked": false - }, - { - "key": "palestine", - "radio_button_name": "Palestine", - "topic_name": "Palestine", - "prechecked": false - }, - { - "key": "panama", - "radio_button_name": "Panama", - "topic_name": "Panama", - "prechecked": false - }, - { - "key": "papua-new-guinea", - "radio_button_name": "Papua New Guinea", - "topic_name": "Papua New Guinea", - "prechecked": false - }, - { - "key": "paraguay", - "radio_button_name": "Paraguay", - "topic_name": "Paraguay", - "prechecked": false - }, - { - "key": "peru", - "radio_button_name": "Peru", - "topic_name": "Peru", - "prechecked": false - }, - { - "key": "philippines", - "radio_button_name": "Philippines", - "topic_name": "Philippines", - "prechecked": false - }, - { - "key": "poland", - "radio_button_name": "Poland", - "topic_name": "Poland", - "prechecked": false - }, - { - "key": "portugal", - "radio_button_name": "Portugal", - "topic_name": "Portugal", - "prechecked": false - }, - { - "key": "qatar", - "radio_button_name": "Qatar", - "topic_name": "Qatar", - "prechecked": false - }, - { - "key": "republic-of-ireland", - "radio_button_name": "Republic of Ireland", - "topic_name": "Republic of Ireland", - "prechecked": false - }, - { - "key": "romania", - "radio_button_name": "Romania", - "topic_name": "Romania", - "prechecked": false - }, - { - "key": "russia", - "radio_button_name": "Russia", - "topic_name": "Russia", - "prechecked": false - }, - { - "key": "rwanda", - "radio_button_name": "Rwanda", - "topic_name": "Rwanda", - "prechecked": false - }, - { - "key": "samoa", - "radio_button_name": "Samoa", - "topic_name": "Samoa", - "prechecked": false - }, - { - "key": "san-marino", - "radio_button_name": "San Marino", - "topic_name": "San Marino", - "prechecked": false - }, - { - "key": "sao-tome-and-principe", - "radio_button_name": "São Tomé and Principe", - "topic_name": "São Tomé and Principe", - "prechecked": false - }, - { - "key": "saudi-arabia", - "radio_button_name": "Saudi Arabia", - "topic_name": "Saudi Arabia", - "prechecked": false - }, - { - "key": "senegal", - "radio_button_name": "Senegal", - "topic_name": "Senegal", - "prechecked": false - }, - { - "key": "serbia", - "radio_button_name": "Serbia", - "topic_name": "Serbia", - "prechecked": false - }, - { - "key": "seychelles", - "radio_button_name": "Seychelles", - "topic_name": "Seychelles", - "prechecked": false - }, - { - "key": "sierra-leone", - "radio_button_name": "Sierra Leone", - "topic_name": "Sierra Leone", - "prechecked": false - }, - { - "key": "singapore", - "radio_button_name": "Singapore", - "topic_name": "Singapore", - "prechecked": false - }, - { - "key": "sint-maarten", - "radio_button_name": "Sint Maarten", - "topic_name": "Sint Maarten", - "prechecked": false - }, - { - "key": "slovakia", - "radio_button_name": "Slovakia", - "topic_name": "Slovakia", - "prechecked": false - }, - { - "key": "slovenia", - "radio_button_name": "Slovenia", - "topic_name": "Slovenia", - "prechecked": false - }, - { - "key": "solomon-islands", - "radio_button_name": "Solomon Islands", - "topic_name": "Solomon Islands", - "prechecked": false - }, - { - "key": "somalia", - "radio_button_name": "Somalia", - "topic_name": "Somalia", - "prechecked": false - }, - { - "key": "south-africa", - "radio_button_name": "South Africa", - "topic_name": "South Africa", - "prechecked": false - }, - { - "key": "south-korea", - "radio_button_name": "South Korea", - "topic_name": "South Korea", - "prechecked": false - }, - { - "key": "south-sudan", - "radio_button_name": "South Sudan", - "topic_name": "South Sudan", - "prechecked": false - }, - { - "key": "spain", - "radio_button_name": "Spain", - "topic_name": "Spain", - "prechecked": false - }, - { - "key": "sri-lanka", - "radio_button_name": "Sri Lanka", - "topic_name": "Sri Lanka", - "prechecked": false - }, - { - "key": "st-helena", - "radio_button_name": "St Helena", - "topic_name": "St Helena", - "prechecked": false - }, - { - "key": "st-kitts-and-nevis", - "radio_button_name": "St Kitts and Nevis", - "topic_name": "St Kitts and Nevis", - "prechecked": false - }, - { - "key": "st-lucia", - "radio_button_name": "St Lucia", - "topic_name": "St Lucia", - "prechecked": false - }, - { - "key": "st-vincent-and-the-grenadines", - "radio_button_name": "St Vincent and The Grenadines", - "topic_name": "St Vincent and The Grenadines", - "prechecked": false - }, - { - "key": "sudan", - "radio_button_name": "Sudan", - "topic_name": "Sudan", - "prechecked": false - }, - { - "key": "suriname", - "radio_button_name": "Suriname", - "topic_name": "Suriname", - "prechecked": false - }, - { - "key": "swaziland-now-eswatini", - "radio_button_name": "Swaziland (now Eswatini)", - "topic_name": "Swaziland (now Eswatini)", - "prechecked": false - }, - { - "key": "sweden", - "radio_button_name": "Sweden", - "topic_name": "Sweden", - "prechecked": false - }, - { - "key": "switzerland", - "radio_button_name": "Switzerland", - "topic_name": "Switzerland", - "prechecked": false - }, - { - "key": "syria", - "radio_button_name": "Syria", - "topic_name": "Syria", - "prechecked": false - }, - { - "key": "taiwan", - "radio_button_name": "Taiwan", - "topic_name": "Taiwan", - "prechecked": false - }, - { - "key": "tajikistan", - "radio_button_name": "Tajikistan", - "topic_name": "Tajikistan", - "prechecked": false - }, - { - "key": "tanzania", - "radio_button_name": "Tanzania", - "topic_name": "Tanzania", - "prechecked": false - }, - { - "key": "thailand", - "radio_button_name": "Thailand", - "topic_name": "Thailand", - "prechecked": false - }, - { - "key": "togo", - "radio_button_name": "Togo", - "topic_name": "Togo", - "prechecked": false - }, - { - "key": "tonga", - "radio_button_name": "Tonga", - "topic_name": "Tonga", - "prechecked": false - }, - { - "key": "trinidad-and-tobago", - "radio_button_name": "Trinidad and Tobago", - "topic_name": "Trinidad and Tobago", - "prechecked": false - }, - { - "key": "tristan-da-cunha", - "radio_button_name": "Tristan Da Cunha", - "topic_name": "Tristan Da Cunha", - "prechecked": false - }, - { - "key": "tunisia", - "radio_button_name": "Tunisia", - "topic_name": "Tunisia", - "prechecked": false - }, - { - "key": "turkey", - "radio_button_name": "Turkey", - "topic_name": "Turkey", - "prechecked": false - }, - { - "key": "turkmenistan", - "radio_button_name": "Turkmenistan", - "topic_name": "Turkmenistan", - "prechecked": false - }, - { - "key": "turks-and-caicos-islands", - "radio_button_name": "Turks and Caicos Islands", - "topic_name": "Turks and Caicos Islands", - "prechecked": false - }, - { - "key": "tuvalu", - "radio_button_name": "Tuvalu", - "topic_name": "Tuvalu", - "prechecked": false - }, - { - "key": "uganda", - "radio_button_name": "Uganda", - "topic_name": "Uganda", - "prechecked": false - }, - { - "key": "ukraine", - "radio_button_name": "Ukraine", - "topic_name": "Ukraine", - "prechecked": false - }, - { - "key": "united-arab-emirates", - "radio_button_name": "United Arab Emirates", - "topic_name": "United Arab Emirates", - "prechecked": false - }, - { - "key": "uruguay", - "radio_button_name": "Uruguay", - "topic_name": "Uruguay", - "prechecked": false - }, - { - "key": "usa", - "radio_button_name": "USA", - "topic_name": "USA", - "prechecked": false - }, - { - "key": "uzbekistan", - "radio_button_name": "Uzbekistan", - "topic_name": "Uzbekistan", - "prechecked": false - }, - { - "key": "vanuatu", - "radio_button_name": "Vanuatu", - "topic_name": "Vanuatu", - "prechecked": false - }, - { - "key": "venezuela", - "radio_button_name": "Venezuela", - "topic_name": "Venezuela", - "prechecked": false - }, - { - "key": "vietnam", - "radio_button_name": "Vietnam", - "topic_name": "Vietnam", - "prechecked": false - }, - { - "key": "wallis-and-futuna-islands", - "radio_button_name": "Wallis and Futuna Islands", - "topic_name": "Wallis and Futuna Islands", - "prechecked": false - }, - { - "key": "yemen", - "radio_button_name": "Yemen", - "topic_name": "Yemen", - "prechecked": false - }, - { - "key": "zambia", - "radio_button_name": "Zambia", - "topic_name": "Zambia", - "prechecked": false - }, - { - "key": "zimbabwe", - "radio_button_name": "Zimbabwe", - "topic_name": "Zimbabwe", - "prechecked": false - } - ] - }, - { - "facet_id": "commodity_type", - "facet_name": "commodity type", - "facet_choices": [ - { - "key": "animal-products-including-food", - "radio_button_name": "Animal products including food", - "topic_name": "Animal products including food", - "prechecked": false - }, - { - "key": "equine", - "radio_button_name": "Equine", - "topic_name": "Equine", - "prechecked": false - }, - { - "key": "fish", - "radio_button_name": "Fish", - "topic_name": "Fish", - "prechecked": false - }, - { - "key": "germplasm", - "radio_button_name": "Germplasm", - "topic_name": "Germplasm", - "prechecked": false - }, - { - "key": "live-animals", - "radio_button_name": "Live animals", - "topic_name": "Live animals", - "prechecked": false - }, - { - "key": "livestock", - "radio_button_name": "Livestock", - "topic_name": "Livestock", - "prechecked": false - }, - { - "key": "pets", - "radio_button_name": "Pets", - "topic_name": "Pets", - "prechecked": false + "email_filter_options": { + "email_filter_by": "all_selected_facets", + "all_selected_facets_except_for": [ + "certificate_status" + ], + "email_alert_topic_name_overrides": { + "destination_country": [ + { + "facet_option_key": "eurasian-customs-union", + "topic_name_override": "Eurasian Customs Union" } ] } - ], + }, "topics": [ "keeping-farmed-animals/animal-welfare" ], diff --git a/lib/documents/schemas/farming_grants.json b/lib/documents/schemas/farming_grants.json index 5d36b9f30..c4dc7f8b9 100644 --- a/lib/documents/schemas/farming_grants.json +++ b/lib/documents/schemas/farming_grants.json @@ -16,7 +16,6 @@ ], "show_summaries": true, "signup_content_id": "2cd12e92-3b68-4cb1-bafe-fde6a7939afb", - "signup_copy": "You'll get an email each time a grant is updated or a new grant is published.", "subscription_list_title_prefix": "Funding for land or farms", "summary": "Find out about grants and funding for farmers and land managers in England. We will add more grants and funding as we develop this tool.
You can search for actions you can get paid for as part of the Sustainable Farming Incentive (SFI). The tool does not confirm your eligibility. Read the SFI guidance to check if you're eligible and how you can apply.
Search by keyword, action name or code if you know it. Use the filters to search by land types or areas of interest.
", "document_noun": "result", diff --git a/lib/documents/schemas/flood_and_coastal_erosion_risk_management_research_reports.json b/lib/documents/schemas/flood_and_coastal_erosion_risk_management_research_reports.json index 8ab154ec4..0627ceb60 100644 --- a/lib/documents/schemas/flood_and_coastal_erosion_risk_management_research_reports.json +++ b/lib/documents/schemas/flood_and_coastal_erosion_risk_management_research_reports.json @@ -14,54 +14,11 @@ "document_noun": "research report", "document_title": "Flood and Coastal Erosion Risk Management Research Report", "signup_content_id": "0b3468bb-ccbe-4c97-9d94-870ae02e977d", - "signup_copy": "You'll get an email each time a report is updated or a new report is published.", "subscription_list_title_prefix": "Flood and Coastal Erosion Risk Management research reports", - "email_filter_by": "flood_and_coastal_erosion_category", - "email_filter_facets": [ - { - "facet_id": "flood_and_coastal_erosion_category", - "facet_name": "Categories", - "required": true, - "facet_choices": [ - { - "key": "environmental-management-and-sustainability", - "radio_button_name": "Environmental management and sustainability", - "topic_name": "environmental management and sustainability", - "prechecked": false - }, - { - "key": "increasing-resilience-to-flooding", - "radio_button_name": "Increasing resilience to flooding", - "topic_name": "increasing resilience to flooding", - "prechecked": false - }, - { - "key": "managing-flood-incidents", - "radio_button_name": "Managing flood incidents", - "topic_name": "managing flood incidents", - "prechecked": false - }, - { - "key": "policy-governance-and-funding", - "radio_button_name": "Policy, governance and funding", - "topic_name": "policy, governance and funding", - "prechecked": false - }, - { - "key": "understanding-risks-from-all-sources-of-flooding", - "radio_button_name": "Understanding risks from all sources of flooding", - "topic_name": "understanding risks from all sources of flooding", - "prechecked": false - }, - { - "key": "whole-life-asset-management", - "radio_button_name": "Whole life asset management", - "topic_name": "whole life asset management", - "prechecked": false - } - ] - } - ], + "email_filter_options": { + "email_filter_by": "flood_and_coastal_erosion_category", + "downcase_email_alert_topic_names": true + }, "facets": [ { "key": "flood_and_coastal_erosion_category", diff --git a/lib/documents/schemas/international_development_funds.json b/lib/documents/schemas/international_development_funds.json index 9a33af308..b1799718b 100644 --- a/lib/documents/schemas/international_development_funds.json +++ b/lib/documents/schemas/international_development_funds.json @@ -10,7 +10,6 @@ "format": "international_development_fund" }, "signup_content_id": "f1a4e5b2-c8b3-40f2-acde-75061a45184d", - "signup_copy": "You'll get an email each time a fund is updated or a new fund is published.", "show_summaries": true, "organisations": [ "f9fcf3fe-2751-4dca-97ca-becaeceb4b26" diff --git a/lib/documents/schemas/maib_reports.json b/lib/documents/schemas/maib_reports.json index ae827ebfd..5a1ad14e1 100644 --- a/lib/documents/schemas/maib_reports.json +++ b/lib/documents/schemas/maib_reports.json @@ -9,7 +9,6 @@ "format": "maib_report" }, "signup_content_id": "56cb57e2-7e7f-4f67-b2f6-39c9a55385dc", - "signup_copy": "You'll get an email each time a report is updated or a new report is published.", "show_summaries": true, "organisations": [ "9c66b9a3-1e6a-48e8-974d-2a5635f84679" @@ -19,49 +18,12 @@ ], "subscription_list_title_prefix": { "singular": "Marine Accident Investigation Branch (MAIB) reports with the following vessel type: ", - "plural": "Marine Accident Investigation Branch (MAIB) reports with the following vessel types: ", - "many": "Marine Accident Investigation Branch (MAIB) reports: " + "plural": "Marine Accident Investigation Branch (MAIB) reports with the following vessel types: " + }, + "email_filter_options": { + "email_filter_by": "vessel_type", + "downcase_email_alert_topic_names": true }, - "email_filter_by": "vessel_type", - "email_filter_facets": [ - { - "facet_id": "vessel_type", - "facet_name": "Vessel types", - "required": true, - "facet_choices": [ - { - "key": "merchant-vessel-100-gross-tons-or-over", - "radio_button_name": "Merchant vessel 100 gross tons or over", - "topic_name": "merchant vessel 100 gross tons or over", - "prechecked": false - }, - { - "key": "merchant-vessel-under-100-gross-tons", - "radio_button_name": "Merchant vessel under 100 gross tons", - "topic_name": "merchant vessel under 100 gross tons", - "prechecked": false - }, - { - "key": "fishing-vessel", - "radio_button_name": "Fishing vessel", - "topic_name": "fishing vessel", - "prechecked": false - }, - { - "key": "recreational-craft-sail", - "radio_button_name": "Recreational craft - sail", - "topic_name": "recreational craft - sail", - "prechecked": false - }, - { - "key": "recreational-craft-power", - "radio_button_name": "Recreational craft - power", - "topic_name": "recreational craft - power", - "prechecked": false - } - ] - } - ], "document_noun": "report", "document_title": "MAIB Report", "facets": [ diff --git a/lib/documents/schemas/marine_equipment_approved_recommendations.json b/lib/documents/schemas/marine_equipment_approved_recommendations.json index b27cde696..642f688ba 100644 --- a/lib/documents/schemas/marine_equipment_approved_recommendations.json +++ b/lib/documents/schemas/marine_equipment_approved_recommendations.json @@ -19,70 +19,10 @@ "9ac82e6a-0fb6-431f-85d8-560361e21d0b" ], "signup_content_id": "512a14c1-260a-4c4e-8de8-643eadf7905c", - "signup_copy": "You’ll get an email each time a new UK Approved Recommendation is published.", - "email_filter_by": "all_selected_facets", - "email_filter_facets": [ - { - "facet_id": "category", - "facet_name": "Category", - "facet_choices": [ - { - "key": "life-saving-appliances", - "radio_button_name": "Life-saving appliances", - "topic_name": "life-saving appliances", - "prechecked": false - }, - { - "key": "marine-pollution-prevention", - "radio_button_name": "Marine pollution prevention", - "topic_name": "marine pollution prevention", - "prechecked": false - }, - { - "key": "fire-protection-equipment", - "radio_button_name": "Fire protection equipment", - "topic_name": "fire protection equipment", - "prechecked": false - }, - { - "key": "navigation-equipment", - "radio_button_name": "Navigation equipment", - "topic_name": "navigation equipment", - "prechecked": false - }, - { - "key": "radio-communication-equipment", - "radio_button_name": "Radio-communication equipment", - "topic_name": "radio-communication equipment", - "prechecked": false - }, - { - "key": "equipment-required-under-colregs", - "radio_button_name": "Equipment required under COLREGs", - "topic_name": "equipment required under colregs", - "prechecked": false - }, - { - "key": "other-safety-equipment", - "radio_button_name": "Other safety equipment", - "topic_name": "other safety equipment", - "prechecked": false - }, - { - "key": "equipment-under-solas-chapter-ii-1", - "radio_button_name": "Equipment under SOLAS Chapter II-1", - "topic_name": "equipment under solas chapter ii-1", - "prechecked": false - }, - { - "key": "general", - "radio_button_name": "General", - "topic_name": "general", - "prechecked": false - } - ] - } - ], + "email_filter_options": { + "email_filter_by": "all_selected_facets", + "downcase_email_alert_topic_names": true + }, "subscription_list_title_prefix": "UK Approved Recommendations for marine equipment", "summary": "Find recommendations on how to interpret and apply the Merchant Shipping (Marine Equipment) Regulations 2016 as amended.
", "document_noun": "recommendation", diff --git a/lib/documents/schemas/marine_notices.json b/lib/documents/schemas/marine_notices.json index b2378ab3b..7eb3b061e 100644 --- a/lib/documents/schemas/marine_notices.json +++ b/lib/documents/schemas/marine_notices.json @@ -9,7 +9,6 @@ "format": "marine_notice" }, "signup_content_id": "21985d9f-8c84-4fa1-915c-2807eaa37dff", - "signup_copy": "You'll get an email each time a notice is updated or a new notice is published.", "organisations": [ "23a24aa8-1711-42b6-bf6b-47af0f230295" ], diff --git a/lib/documents/schemas/medical_safety_alerts.json b/lib/documents/schemas/medical_safety_alerts.json index 1ea89fc90..b59be1a48 100644 --- a/lib/documents/schemas/medical_safety_alerts.json +++ b/lib/documents/schemas/medical_safety_alerts.json @@ -9,7 +9,6 @@ "format": "medical_safety_alert" }, "signup_content_id": "a796ca43-021b-4960-9c99-f41bb8ef2266", - "signup_copy": "You'll get an email each time an alert is updated or a new alert is published.", "show_summaries": true, "organisations": [ "240f72bd-9a4d-4f39-94d9-77235cadde8e" @@ -24,44 +23,16 @@ "medicines-medical-devices-blood/medical-devices-regulation-safety", "medicines-medical-devices-blood/vigilance-safety-alerts" ], - "email_filter_by": "alert_type", - "email_filter_facets": [ - { - "facet_id": "alert_type", - "facet_name": "Message type", - "required": true, - "facet_choices": [ - { - "key": "field-safety-notices", - "radio_button_name": "Field safety notice", - "topic_name": "field safety notice", - "body": "information from medical device manufacturers.", - "prechecked": true - }, - { - "key": "national-patient-safety", - "radio_button_name": "National patient safety alert", - "topic_name": "national patient safety alert", - "body": "information published by the MHRA related to patient safety.", - "prechecked": true - }, - { - "key": "device-safety-information", - "radio_button_name": "Device safety information", - "topic_name": "device safety information", - "body": "information published by the MHRA related to device safety.", - "prechecked": true - }, - { - "key": "medicines-recall-notification", - "radio_button_name": "Medicines recall/notification", - "topic_name": "medicines recall/notification", - "body": "information published by the MHRA related to medicines.", - "prechecked": true - } - ] - } - ], + "email_filter_options": { + "email_filter_by": "alert_type", + "downcase_email_alert_topic_names": true, + "pre_checked_email_alert_checkboxes": [ + "field-safety-notices", + "national-patient-safety", + "device-safety-information", + "medicines-recall-notification" + ] + }, "document_noun": "message", "document_title": "Medical Safety Alert", "facets": [ diff --git a/lib/documents/schemas/product_safety_alert_report_recalls.json b/lib/documents/schemas/product_safety_alert_report_recalls.json index f4d5c98fa..0f0e5ab3f 100644 --- a/lib/documents/schemas/product_safety_alert_report_recalls.json +++ b/lib/documents/schemas/product_safety_alert_report_recalls.json @@ -9,39 +9,14 @@ "format": "product_safety_alert_report_recall" }, "signup_content_id": "bb6047de-3854-4774-a5d5-fc66fed4f792", - "signup_copy": "You'll get an email each time an alert is updated or a new alert is published.", "organisations": [ "a0ee18e7-9e1e-4ba1-aed5-f3f287dce752" ], "topics": [], - "email_filter_by": "product_alert_type", - "email_filter_facets": [ - { - "facet_id": "product_alert_type", - "facet_name": "Alert type", - "required": true, - "facet_choices": [ - { - "key": "product-safety-alert", - "radio_button_name": "Product safety alert", - "topic_name": "product safety alert", - "prechecked": false - }, - { - "key": "product-safety-report", - "radio_button_name": "Product safety report", - "topic_name": "product safety report", - "prechecked": false - }, - { - "key": "product-recall", - "radio_button_name": "Product recall", - "topic_name": "product recall", - "prechecked": false - } - ] - } - ], + "email_filter_options": { + "email_filter_by": "product_alert_type", + "downcase_email_alert_topic_names": true + }, "document_noun": "report", "document_title": "Product Safety Alerts, Reports and Recalls", "facets": [ diff --git a/lib/documents/schemas/protected_food_drink_names.json b/lib/documents/schemas/protected_food_drink_names.json index 323ffcdca..f04220b19 100644 --- a/lib/documents/schemas/protected_food_drink_names.json +++ b/lib/documents/schemas/protected_food_drink_names.json @@ -10,7 +10,6 @@ }, "show_summaries": true, "signup_content_id": "cff7449e-4181-480f-93e4-91fecfb4c774", - "signup_copy": "You'll get an email each time a food or drink name is updated or a new name is published.", "organisations": [ "de4e9dc6-cca4-43af-a594-682023b84d6c" ], diff --git a/lib/documents/schemas/raib_reports.json b/lib/documents/schemas/raib_reports.json index 6033a1beb..60ec6e1f3 100644 --- a/lib/documents/schemas/raib_reports.json +++ b/lib/documents/schemas/raib_reports.json @@ -9,7 +9,6 @@ "format": "raib_report" }, "signup_content_id": "db81c7e8-b1b6-4c29-992a-1289f1b63073", - "signup_copy": "You'll get an email each time a report is updated or a new report is published.", "show_summaries": true, "organisations": [ "013872d8-8bbb-4e80-9b79-45c7c5cf9177" @@ -19,43 +18,12 @@ ], "subscription_list_title_prefix": { "singular": "Rail Accident Investigation Branch (RAIB) reports with the following railway type: ", - "plural": "Rail Accident Investigation Branch (RAIB) reports with the following railway types: ", - "many": "Rail Accident Investigation Branch (RAIB) reports: " + "plural": "Rail Accident Investigation Branch (RAIB) reports with the following railway types: " + }, + "email_filter_options": { + "email_filter_by": "railway_type", + "downcase_email_alert_topic_names": true }, - "email_filter_by": "railway_type", - "email_filter_facets": [ - { - "facet_id": "railway_type", - "facet_name": "Railway types", - "required": true, - "facet_choices": [ - { - "key": "heavy-rail", - "radio_button_name": "Heavy rail", - "topic_name": "heavy rail", - "prechecked": false - }, - { - "key": "light-rail", - "radio_button_name": "Light rail", - "topic_name": "light rail", - "prechecked": false - }, - { - "key": "metros", - "radio_button_name": "Metros", - "topic_name": "metros", - "prechecked": false - }, - { - "key": "heritage-railways", - "radio_button_name": "Heritage railways", - "topic_name": "heritage railways", - "prechecked": false - } - ] - } - ], "document_noun": "report", "document_title": "RAIB Report", "facets": [ diff --git a/lib/documents/schemas/research_for_development_outputs.json b/lib/documents/schemas/research_for_development_outputs.json index 1b6829415..87c1bc6b1 100644 --- a/lib/documents/schemas/research_for_development_outputs.json +++ b/lib/documents/schemas/research_for_development_outputs.json @@ -10,7 +10,6 @@ "format": "research_for_development_output" }, "signup_content_id": "fdcbada2-1ad4-4194-98dc-5f04a448316e", - "signup_copy": "You'll get an email each time an output is updated or a new output is published.", "organisations": [ "f9fcf3fe-2751-4dca-97ca-becaeceb4b26" ], diff --git a/lib/documents/schemas/residential_property_tribunal_decisions.json b/lib/documents/schemas/residential_property_tribunal_decisions.json index 2d3b496f2..4707b3198 100644 --- a/lib/documents/schemas/residential_property_tribunal_decisions.json +++ b/lib/documents/schemas/residential_property_tribunal_decisions.json @@ -21,65 +21,10 @@ "357110bb-cbc5-4708-9711-1b26e6c63e86" ], "signup_content_id": "8a6239e1-76cf-41a0-9295-0ae1182080d2", - "signup_copy": "You'll get an email each time a decision is updated or a new decision is published.", "subscription_list_title_prefix": "Residential property tribunal decisions", - "email_filter_by": "all_selected_facets", - "email_filter_facets": [ - { - "facet_id": "tribunal_decision_category", - "facet_name": "tribunal decision categories", - "facet_choices": [ - { - "key": "housing-act-2004-and-housing-and-planning-act-2016", - "radio_button_name": "Housing Act 2004 and Housing and Planning Act 2016", - "topic_name": "Housing Act 2004 and Housing and Planning Act 2016", - "prechecked": false - }, - { - "key": "leasehold-disputes-management", - "radio_button_name": "Leasehold disputes (management)", - "topic_name": "Leasehold disputes (management)", - "prechecked": false - }, - { - "key": "leasehold-enfranchisement-and-extension", - "radio_button_name": "Leasehold enfranchisement and extension", - "topic_name": "Leasehold enfranchisement and extension", - "prechecked": false - }, - { - "key": "park-homes", - "radio_button_name": "Park homes", - "topic_name": "Park homes", - "prechecked": false - }, - { - "key": "rents", - "radio_button_name": "Rents", - "topic_name": "Rents", - "prechecked": false - }, - { - "key": "right-to-buy", - "radio_button_name": "Right to Buy", - "topic_name": "Right to Buy", - "prechecked": false - }, - { - "key": "tenant-associations", - "radio_button_name": "Tenant associations", - "topic_name": "Tenant associations", - "prechecked": false - }, - { - "key": "tenant-fees-act", - "radio_button_name": "Tenant Fees act", - "topic_name": "Tenant Fees Act", - "prechecked": false - } - ] - } - ], + "email_filter_options": { + "email_filter_by": "all_selected_facets" + }, "summary": "Find decisions on Residential Property Tribunal cases in England from December 2018 onwards.
If the decision was about leasehold and was made before December 2018, visit Lease Advice. Other decisions made before December 2018 can be found on BAILII
", "document_noun": "decision", "document_title": "Residential Property Tribunal Decision", diff --git a/lib/documents/schemas/tax_tribunal_decisions.json b/lib/documents/schemas/tax_tribunal_decisions.json index b0b751ba4..17b3e6446 100644 --- a/lib/documents/schemas/tax_tribunal_decisions.json +++ b/lib/documents/schemas/tax_tribunal_decisions.json @@ -22,58 +22,14 @@ "357110bb-cbc5-4708-9711-1b26e6c63e86" ], "signup_content_id": "ae5afec1-30d6-4997-bdf8-7de94d2dd910", - "signup_copy": "You'll get an email each time a decision is updated or a new decision is published.", "subscription_list_title_prefix": { "singular": "Upper Tribunal (Tax and Chancery Chamber) decisions with the following category: ", - "plural": "Upper Tribunal (Tax and Chancery Chamber) decisions with the following categories: ", - "many": "Upper Tribunal (Tax and Chancery Chamber) decisions: " + "plural": "Upper Tribunal (Tax and Chancery Chamber) decisions with the following categories: " + }, + "email_filter_options": { + "email_filter_by": "tribunal_decision_category", + "downcase_email_alert_topic_names": true }, - "email_filter_by": "tribunal_decision_category", - "email_filter_facets": [ - { - "facet_id": "tribunal_decision_category", - "facet_name": "Categories", - "required": true, - "facet_choices": [ - { - "key": "banking", - "radio_button_name": "Banking", - "topic_name": "banking", - "prechecked": false - }, - { - "key": "charity", - "radio_button_name": "Charity", - "topic_name": "charity", - "prechecked": false - }, - { - "key": "financial-services", - "radio_button_name": "Financial Services", - "topic_name": "financial services", - "prechecked": false - }, - { - "key": "land-registration", - "radio_button_name": "Land Registration", - "topic_name": "land registration", - "prechecked": false - }, - { - "key": "pensions", - "radio_button_name": "Pensions", - "topic_name": "pensions", - "prechecked": false - }, - { - "key": "tax", - "radio_button_name": "Tax", - "topic_name": "tax", - "prechecked": false - } - ] - } - ], "summary": "Find decisions on tax, financial services, pensions, charity and land registration appeals to the Upper Tribunal (Tax and Chancery Chamber).
", "document_noun": "decision", "document_title": "Tax Tribunal Decision", diff --git a/lib/documents/schemas/utaac_decisions.json b/lib/documents/schemas/utaac_decisions.json index fdcc40f93..2ac72aea1 100644 --- a/lib/documents/schemas/utaac_decisions.json +++ b/lib/documents/schemas/utaac_decisions.json @@ -9,7 +9,6 @@ "format": "utaac_decision" }, "signup_content_id": "13e59efa-6c0d-48e8-a0b9-092b62cdc912", - "signup_copy": "You'll get an email each time a decision is updated or a new decision is published.", "show_summaries": true, "editing_organisations": [ "dcc907d6-433c-42df-9ffb-d9c68be5dc4d" diff --git a/spec/finders/email_alert_configuration_spec.rb b/spec/finders/email_alert_configuration_spec.rb deleted file mode 100644 index 123aeaf36..000000000 --- a/spec/finders/email_alert_configuration_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -require "spec_helper" - -RSpec.describe "Email alert configuration" do - all_finders = Dir["lib/documents/schemas/*.json"].map do |filename| - JSON.parse(File.read(filename)) - end - - all_finders.each do |finder| - next if finder["email_filter_by"] == "all_selected_facets" - - describe "Finder configuration for #{finder['name']}" do - next unless finder["email_filter_by"] - - before do - @facet_used_to_email_things = finder["facets"].find do |facet| - facet["key"] == finder["email_filter_by"] - end - end - - it "only allows people to sign up to alerts that exist" do - actually_possible_keys_for_which_emails_will_be_sent = @facet_used_to_email_things["allowed_values"].map do |allowed_value| - allowed_value["value"] - end - - finder.dig("email_filter_facets", 0, "facet_choices").each do |choice| - expect(choice["key"]).to be_in(actually_possible_keys_for_which_emails_will_be_sent) - end - end - - # email-alert-api limits the name of a subscription list to 1000 characters - # We test here to make sure we don't try to create lists with names longer than this - it "doesn't have a name longer than 1000 characters" do - next unless finder["subscription_list_title_prefix"] - - name = if finder["subscription_list_title_prefix"]["plural"] - # If the list name has singular and plural forms, test the plural - # form with every possible topic name appended to make the longest - # possible name - (finder["subscription_list_title_prefix"]["plural"] + - finder.dig("email_filter_facets", 0, "facet_choices").collect { |topic| topic["topic_name"] }.to_sentence) - .humanize - else - # If the list name only has one form, then topic names are not - # appended; just check the name itself isn't too long - finder["subscription_list_title_prefix"] - end - - expect(name.length).to be <= 1000 - end - end - end -end diff --git a/spec/models/finder_schema_spec.rb b/spec/models/finder_schema_spec.rb index d30045688..6e8a8cc60 100644 --- a/spec/models/finder_schema_spec.rb +++ b/spec/models/finder_schema_spec.rb @@ -64,21 +64,6 @@ end end - describe "#override_signup_copy" do - it "overrides the signup copy based on the document noun on update if the schema has signup copy" do - schema = FinderSchema.new - schema.signup_copy = "You'll get an email each time a document is updated or a new document is published." - schema.update({ document_noun: "publication" }) - expect(schema.signup_copy).to eq("You'll get an email each time a publication is updated or a new publication is published.") - end - - it "does not override the signup copy if the schema does not have signup copy already" do - schema = FinderSchema.new - schema.update({ document_noun: "publication" }) - expect(schema.signup_copy).to be_nil - end - end - describe "#humanized_facet_name" do it "returns the name defined in the schema for the supplied facet key" do properties = mandatory_properties.merge({ diff --git a/spec/presenters/finders/finder_signup_content_item_presenter_spec.rb b/spec/presenters/finders/finder_signup_content_item_presenter_spec.rb index 083a628b5..080aa0461 100644 --- a/spec/presenters/finders/finder_signup_content_item_presenter_spec.rb +++ b/spec/presenters/finders/finder_signup_content_item_presenter_spec.rb @@ -3,9 +3,10 @@ RSpec.describe FinderSignupContentItemPresenter do describe "#to_json" do Dir["lib/documents/schemas/*.json"].each do |file| + let(:read_file) { File.read(file) } + let(:payload) { JSON.parse(read_file) } + it "is valid against the #{file} content schemas" do - read_file = File.read(file) - payload = JSON.parse(read_file) if payload.key?("signup_content_id") finder_signup_content_presenter = FinderSignupContentItemPresenter.new(payload, File.mtime(file)) presented_data = finder_signup_content_presenter.to_json @@ -14,6 +15,313 @@ expect(presented_data).to be_valid_against_publisher_schema("finder_email_signup") end end + + # email-alert-api limits the name of a subscription list to 1000 characters + # We test here to make sure we don't try to create lists with names longer than this + it "doesn't have a name longer than 1000 characters" do + finder_signup_content_presenter = FinderSignupContentItemPresenter.new(payload, File.mtime(file)) + presented_data = finder_signup_content_presenter.to_json + next unless presented_data[:details][:subscription_list_title_prefix] + + name = if presented_data[:details][:subscription_list_title_prefix][:plural] + # If the list name has singular and plural forms, test the plural + # form with every possible topic name appended to make the longest + # possible name + (presented_data[:details][:subscription_list_title_prefix][:plural] + + presented_data[:details][:email_filter_facets][0][:facet_choices].collect { |topic| topic[:topic_name] }.to_sentence) + .humanize + else + # If the list name only has one form, then topic names are not + # appended; just check the name itself isn't too long + presented_data[:details][:subscription_list_title_prefix] + end + + expect(name.length).to be <= 1000 + end + end + end + + describe ".email_filter_facets" do + let(:facet_one) do + { + "key": "life_saving_maritime_appliance_service_station_regions", + "name": "Regions in the UK", + "short_name": "region", + "type": "text", + "preposition": "in region", + "display_as_result_metadata": true, + "filterable": true, + "allowed_values": [ + { + "label": "Foo", + "value": "foo", + }, + { + "label": "Bar", + "value": "bar", + }, + ], + } + end + let(:facet_two) do + { + "key": "some_other_facet", + "name": "Some other facet", + "filterable": true, + "allowed_values": [ + { + "label": "Baz", + "value": "baz-baz", + }, + { + "label": "Something", + "value": "bla", + }, + ], + } + end + let(:facet_with_no_allowed_values) do + { + "key": "some_date", + "name": "Some date", + "filterable": true, + "type": "date", + } + end + let(:facet_with_filterable_false) do + { + "key": "some_options", + "name": "Some options", + "filterable": false, + "allowed_values": [ + { + "label": "some value", + "value": "val", + }, + ], + } + end + let(:schema) do + { + "facets" => JSON.parse([facet_one, facet_two, facet_with_no_allowed_values, facet_with_filterable_false].to_json), + } + end + + it "returns an empty array if no email_filter_by is provided" do + expect(FinderSignupContentItemPresenter.new(schema).email_filter_facets).to eq([]) + end + + it "returns all filterable facets with allowed_values, if 'all_selected_facets' is passed" do + schema.merge!({ + "email_filter_options" => { + "email_filter_by" => "all_selected_facets", + }, + }) + expect(FinderSignupContentItemPresenter.new(schema).email_filter_facets).to eq( + [ + { + facet_id: "life_saving_maritime_appliance_service_station_regions", + facet_name: "Regions in the UK", + facet_choices: [ + { + key: "foo", + prechecked: false, + radio_button_name: "Foo", + topic_name: "Foo", + }, + { + key: "bar", + prechecked: false, + radio_button_name: "Bar", + topic_name: "Bar", + }, + ], + }, + { + facet_id: "some_other_facet", + facet_name: "Some other facet", + facet_choices: [ + { + key: "baz-baz", + prechecked: false, + radio_button_name: "Baz", + topic_name: "Baz", + }, + { + key: "bla", + prechecked: false, + radio_button_name: "Something", + topic_name: "Something", + }, + ], + }, + ], + ) + end + + it "returns all filterable facets with allowed_values (if 'all_selected_facets' is passed), minus any specified in 'all_selected_facets_except_for'" do + schema.merge!({ + "email_filter_options" => { + "email_filter_by" => "all_selected_facets", + "all_selected_facets_except_for" => %w[life_saving_maritime_appliance_service_station_regions], + }, + }) + expect(FinderSignupContentItemPresenter.new(schema).email_filter_facets).to eq( + [ + { + facet_id: "some_other_facet", + facet_name: "Some other facet", + facet_choices: [ + { + key: "baz-baz", + prechecked: false, + radio_button_name: "Baz", + topic_name: "Baz", + }, + { + key: "bla", + prechecked: false, + radio_button_name: "Something", + topic_name: "Something", + }, + ], + }, + ], + ) + end + + it "returns the filterable facet corresponding to 'email_filter_by'" do + schema.merge!({ + "email_filter_options" => { + "email_filter_by" => "some_other_facet", + }, + }) + expect(FinderSignupContentItemPresenter.new(schema).email_filter_facets).to eq( + [ + { + facet_id: "some_other_facet", + facet_name: "Some other facet", + required: true, + facet_choices: [ + { + key: "baz-baz", + prechecked: false, + radio_button_name: "Baz", + topic_name: "Baz", + }, + { + key: "bla", + prechecked: false, + radio_button_name: "Something", + topic_name: "Something", + }, + ], + }, + ], + ) + end + + it "downcases the generated topic name if downcase_email_alert_topic_names passed" do + schema.merge!({ + "email_filter_options" => { + "email_filter_by" => "some_other_facet", + "downcase_email_alert_topic_names" => true, + }, + }) + expect(FinderSignupContentItemPresenter.new(schema).email_filter_facets).to eq( + [ + { + facet_id: "some_other_facet", + facet_name: "Some other facet", + required: true, + facet_choices: [ + { + key: "baz-baz", + prechecked: false, + radio_button_name: "Baz", + topic_name: "baz", + }, + { + key: "bla", + prechecked: false, + radio_button_name: "Something", + topic_name: "something", + }, + ], + }, + ], + ) + end + + it "overrides the generated topic name if email_alert_topic_name_overrides passed" do + schema.merge!({ + "email_filter_options" => { + "email_filter_by" => "some_other_facet", + "email_alert_topic_name_overrides" => { + "some_other_facet" => [ + { + "facet_option_key" => "baz-baz", + "topic_name_override" => "something ENTIRELY different", + }, + ], + }, + }, + }) + expect(FinderSignupContentItemPresenter.new(schema).email_filter_facets).to eq( + [ + { + facet_id: "some_other_facet", + facet_name: "Some other facet", + required: true, + facet_choices: [ + { + key: "baz-baz", + prechecked: false, + radio_button_name: "Baz", + topic_name: "something ENTIRELY different", + }, + { + key: "bla", + prechecked: false, + radio_button_name: "Something", + topic_name: "Something", + }, + ], + }, + ], + ) + end + + it "pre-checks any items specified in the pre_checked_email_alert_checkboxes array" do + schema.merge!({ + "email_filter_options" => { + "email_filter_by" => "some_other_facet", + "pre_checked_email_alert_checkboxes" => %w[baz-baz], + }, + }) + expect(FinderSignupContentItemPresenter.new(schema).email_filter_facets).to eq( + [ + { + facet_id: "some_other_facet", + facet_name: "Some other facet", + required: true, + facet_choices: [ + { + key: "baz-baz", + prechecked: true, + radio_button_name: "Baz", + topic_name: "Baz", + }, + { + key: "bla", + prechecked: false, + radio_button_name: "Something", + topic_name: "Something", + }, + ], + }, + ], + ) end end end