From 0dc2097471d8c82e0acdf3634419b9263c3e5733 Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 11:42:52 +0000 Subject: [PATCH 01/13] remove markup filter tag --- caseworker/templates/core/error.html | 2 +- .../forms/open_general_licences.py | 2 +- exporter/compliance/views.py | 2 +- .../templates/components/ogl-step-list.html | 19 ++++++------ exporter/templates/core/signature-help.html | 20 +++++++++---- exporter/templates/core/start-gov-uk.html | 6 ++-- exporter/templates/core/start.html | 5 ++-- .../licences/open-general-licences.html | 4 +-- .../lite_exporter_frontend/applications.py | 9 ------ .../lite_exporter_frontend/compliance.py | 1 - lite_content/lite_exporter_frontend/core.py | 30 ++----------------- .../lite_exporter_frontend/licences.py | 1 - lite_forms/templates/confirmation.html | 2 +- lite_forms/templatetags/custom_tags.py | 8 +---- 14 files changed, 40 insertions(+), 71 deletions(-) diff --git a/caseworker/templates/core/error.html b/caseworker/templates/core/error.html index ed95c5e44d..4ed6adb937 100644 --- a/caseworker/templates/core/error.html +++ b/caseworker/templates/core/error.html @@ -1,3 +1,3 @@ {% extends "error.html" %} -{% block description %}{{ description|markdown }}{% endblock %} +{% block description %}{{ description }}{% endblock %} diff --git a/exporter/apply_for_a_licence/forms/open_general_licences.py b/exporter/apply_for_a_licence/forms/open_general_licences.py index 4f1e3644eb..33f2df695b 100644 --- a/exporter/apply_for_a_licence/forms/open_general_licences.py +++ b/exporter/apply_for_a_licence/forms/open_general_licences.py @@ -189,7 +189,7 @@ def open_general_licence_submit_success_page(request, **kwargs): return success_page( request=request, title=OpenGeneralLicenceRegistration.TITLE, - secondary_title=OpenGeneralLicenceRegistration.SECONDARY_TITLE.format( + secondary_title="You've successfully registered for **{} ({})**".format( open_general_licence["case_type"]["reference"]["value"], open_general_licence["name"] ), description="", diff --git a/exporter/compliance/views.py b/exporter/compliance/views.py index 1c9e2eddd7..9c242b627f 100644 --- a/exporter/compliance/views.py +++ b/exporter/compliance/views.py @@ -124,7 +124,7 @@ def get(self, request, **kwargs): return success_page( request=request, title=OpenReturnsForm.Success.TITLE, - secondary_title=OpenReturnsForm.Success.SECONDARY_TITLE, + secondary_title="", description=OpenReturnsForm.Success.DESCRIPTION, what_happens_next="", links={ diff --git a/exporter/templates/components/ogl-step-list.html b/exporter/templates/components/ogl-step-list.html index 37620fc469..79bb48d3b5 100644 --- a/exporter/templates/components/ogl-step-list.html +++ b/exporter/templates/components/ogl-step-list.html @@ -1,10 +1,10 @@
  1. -

    {% lcs 'applications.OpenGeneralLicenceQuestions.OpenGeneralLicenceDetail.Points.FIRST_POINT' %}

    +

    Ensure this open general licence is appropriate for your needs

    - {% lcs 'applications.OpenGeneralLicenceQuestions.OpenGeneralLicenceDetail.Summary.DESCRIPTION' %} + Description
    {{ data.description }} @@ -12,7 +12,7 @@
    - {% lcs 'applications.OpenGeneralLicenceQuestions.OpenGeneralLicenceDetail.Summary.CONTROL_LIST_ENTRIES' %} + Control list entries
    {% include 'includes/control-list-entries.html' with control_list_entries=data.control_list_entries %} @@ -20,7 +20,7 @@
    - {% lcs 'applications.OpenGeneralLicenceQuestions.OpenGeneralLicenceDetail.Summary.COUNTRIES' %} + Countries
    {% for country in data.countries %} @@ -31,22 +31,23 @@
  2. -

    {% lcs 'applications.OpenGeneralLicenceQuestions.OpenGeneralLicenceDetail.Points.SECOND_POINT' %}

    +

    Read the full text of the open general licence

    {{ data.url|linkify }}
  3. -

    {% lcs 'applications.OpenGeneralLicenceQuestions.OpenGeneralLicenceDetail.Points.THIRD_POINT' %}

    +

    Check that this open general licence is appropriate for your sites

      {% for site in data.sites %}
    1. {{ site.value }} -

      {{ site.description|safe }}

      +

      {{ site.description }}

    2. {% endfor %}
    - {% lcs 'applications.OpenGeneralLicenceQuestions.OpenGeneralLicenceDetail.Points.THIRD_POINT_NOTICE' as notice %} - {{ notice|markdown }} + If a site isn't listed, you can + add a site + from your account home. Adding a site now means you'll have to start from the beginning to register this open general licence.
diff --git a/exporter/templates/core/signature-help.html b/exporter/templates/core/signature-help.html index f5d441474a..9664942182 100644 --- a/exporter/templates/core/signature-help.html +++ b/exporter/templates/core/signature-help.html @@ -2,18 +2,26 @@ {% block back_link %} - {% lcs 'core.SignatureHelp.BACK' %} + Back to hub {% endblock %} {% block body %} -

{% block title %}{% lcs 'core.SignatureHelp.TITLE' %}{% endblock %}

+

{% block title %}Document Signatures{% endblock %}

- {% lcs 'core.SignatureHelp.CONTENT' as help %} - {{ help|markdown }} -

- {% lcs 'core.SignatureHelp.DOWNLOAD_BUTTON' %} + Most documents generated by DBT are digitally signed. This allows exporters to ensure that the documents they download and view are authentic. +

Digitally signed documents will have a signature on the last page. +

In order to ensure that documents you download and view are authentic, do the following; +
+
    +
  1. Download the certificate from the link below
  2. +
  3. Import this into your Adobe Reader\'s "trusted certificates"
  4. +
  5. Ensure the certificate is set as a trusted root for certifying documents
  6. +
+
After this, whenever you view a signed DBT document from this site, you will see a banner indicating that the document has come from a trusted source. +

+ Download certificate
{% endblock %} diff --git a/exporter/templates/core/start-gov-uk.html b/exporter/templates/core/start-gov-uk.html index 006806c70d..bf75749c41 100644 --- a/exporter/templates/core/start-gov-uk.html +++ b/exporter/templates/core/start-gov-uk.html @@ -46,8 +46,10 @@

- {% lcs 'core.StartPageGovUK.NOTICE' as notice %} - {{ notice|markdown }} + There are different services if you want to + export drugs and medicines + , export fine art + or export livestock
{% endblock %} diff --git a/exporter/templates/core/start.html b/exporter/templates/core/start.html index 69f9a7a141..5d89ae1e20 100644 --- a/exporter/templates/core/start.html +++ b/exporter/templates/core/start.html @@ -41,8 +41,9 @@

- {% lcs 'core.StartPage.NOTICE' as notice %} - {{ notice|markdown }} + There are different services if you want to export drugs and medicines + , export fine art + or export livestock
{% lcs 'core.StartPage.SIGN_IN_BUTTON' %} diff --git a/exporter/templates/licences/open-general-licences.html b/exporter/templates/licences/open-general-licences.html index df2b0d7f73..926b172ab1 100644 --- a/exporter/templates/licences/open-general-licences.html +++ b/exporter/templates/licences/open-general-licences.html @@ -20,8 +20,8 @@

{% block title %}{% lcs "licences.LicencesList.TITLE {% endif %}

- {% lcs 'licences.OpenGeneralLicencesList.WARNING_LINK' as link %} - {{ link|markdown }} + Read + guidance on compliance and enforcement of export controls

{% include 'filters.html' %} diff --git a/lite_content/lite_exporter_frontend/applications.py b/lite_content/lite_exporter_frontend/applications.py index 6b2fcc83fe..e5f9ca2891 100644 --- a/lite_content/lite_exporter_frontend/applications.py +++ b/lite_content/lite_exporter_frontend/applications.py @@ -268,15 +268,6 @@ class OpenGeneralLicenceDetail: "This {} doesn't require registration, however make sure you still meet the requirements." ) - class Points: - FIRST_POINT = "Ensure this open general licence is appropriate for your needs" - SECOND_POINT = "Read the full text of the open general licence" - THIRD_POINT = "Check that this open general licence is appropriate for your sites" - THIRD_POINT_NOTICE = ( - "If a site isn't listed, you can [add a site](/organisation/sites/new/) from your account home. Adding a site now means " - "you'll have to start from the beginning to register this open general licence." - ) - class Summary: DESCRIPTION = "Description" CONTROL_LIST_ENTRIES = "Control list entries" diff --git a/lite_content/lite_exporter_frontend/compliance.py b/lite_content/lite_exporter_frontend/compliance.py index c7e864bc68..c8a458f528 100644 --- a/lite_content/lite_exporter_frontend/compliance.py +++ b/lite_content/lite_exporter_frontend/compliance.py @@ -73,7 +73,6 @@ class ExampleTable: class Success: TITLE = "Open licence return submitted" - SECONDARY_TITLE = "" DESCRIPTION = "" OPEN_LICENCE_RETURNS_LINK = "View open licence returns" HOME_LINK = "Return to your export control account dashboard" diff --git a/lite_content/lite_exporter_frontend/core.py b/lite_content/lite_exporter_frontend/core.py index d529332997..dbfcdd8039 100644 --- a/lite_content/lite_exporter_frontend/core.py +++ b/lite_content/lite_exporter_frontend/core.py @@ -23,12 +23,7 @@ class StartPage: SIGN_IN_BUTTON_SUFFIX = "GOV.UK" OR = "or" REGISTER_ACCOUNT_LINK = "set up an account" - NOTICE = ( - "There are different services if you want to " - "[export drugs and medicines](https://www.gov.uk/guidance/export-drugs-and-medicines-special-rules), " - "[export fine art](https://www.artscouncil.org.uk/export-controls/export-licensing) " - "or [export livestock](https://www.gov.uk/guidance/export-livestock-and-poultry)" - ) + BREADCRUMBS = [ ["Home", "https://gov.uk"], ["Business and enterprise", "https://www.gov.uk/topic/business-enterprise"], @@ -48,12 +43,7 @@ class StartPageGovUK: SIGN_IN_BUTTON_SUFFIX = "GOV.UK" OR = "or" REGISTER_ACCOUNT_LINK = "set up an account" - NOTICE = ( - "There are different services if you want to " - "[export drugs and medicines](https://www.gov.uk/guidance/export-drugs-and-medicines-special-rules), " - "[export fine art](https://www.artscouncil.org.uk/export-controls/export-licensing) " - "or [export livestock](https://www.gov.uk/guidance/export-livestock-and-poultry)" - ) + BREADCRUMBS = [ ["Home", "https://gov.uk"], ["Business and enterprise", "https://www.gov.uk/topic/business-enterprise"], @@ -148,21 +138,5 @@ class Headquarters: ) -class SignatureHelp: - BACK = "Back to hub" - TITLE = "Document Signatures" - CONTENT = """ - Most documents generated by DBT are digitally signed. This allows exporters to ensure that the documents they download and view are authentic.\n\n\n - - Digitally signed documents will have a signature on the last page. \n\n\n - - In order to ensure that documents you download and view are authentic, do the following;\n - - 1. Download the certificate from the link below \n 2. Import this into your Adobe Reader's "trusted certificates" \n 3. Ensure the certificate is set as a trusted root for certifying documents \n - After this, whenever you view a signed DBT document from this site, you will see a banner indicating that the document has come from a trusted source. - """ # noqa - DOWNLOAD_BUTTON = "Download certificate" - - class Errors: PERMISSION_DENIED = "You do not have permission to access this resource" diff --git a/lite_content/lite_exporter_frontend/licences.py b/lite_content/lite_exporter_frontend/licences.py index c8da189282..0fa655f8f7 100644 --- a/lite_content/lite_exporter_frontend/licences.py +++ b/lite_content/lite_exporter_frontend/licences.py @@ -52,7 +52,6 @@ class Table: class OpenGeneralLicenceRegistration: TITLE = "Registration complete" - SECONDARY_TITLE = "You've successfully registered for **{} ({})**" class Links: VIEW_OGLS_LINK = "View your open general licences" diff --git a/lite_forms/templates/confirmation.html b/lite_forms/templates/confirmation.html index a3041d9976..98aeca0b65 100644 --- a/lite_forms/templates/confirmation.html +++ b/lite_forms/templates/confirmation.html @@ -12,7 +12,7 @@

{{ title }}

- {{ secondary_title|markdown }} + {{ secondary_title }}
{% if animated %}
diff --git a/lite_forms/templatetags/custom_tags.py b/lite_forms/templatetags/custom_tags.py index 55d378960d..97857f37d8 100644 --- a/lite_forms/templatetags/custom_tags.py +++ b/lite_forms/templatetags/custom_tags.py @@ -7,7 +7,7 @@ from django.utils.safestring import mark_safe from core.builtins.custom_tags import get_const_string -from lite_forms.helpers import convert_to_markdown, flatten_data +from lite_forms.helpers import flatten_data @register.filter @@ -159,12 +159,6 @@ def get(value, arg): return value.get(arg, "") if value else None -@register.filter -@mark_safe # noqa: S308 -def markdown(text): - return convert_to_markdown(text) - - @register.filter def heading_class(text): if text and len(text) < 150: From c814295d525156740745c14ea5eb6760f0c4f48d Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 13:48:31 +0000 Subject: [PATCH 02/13] remove makedown toolbar and date --- caseworker/cases/forms/finalise_case.py | 2 +- exporter/applications/forms/common.py | 14 +++++++------- exporter/goods/forms/goods.py | 4 ++-- lite_content/lite_exporter_frontend/strings.py | 1 - lite_content/lite_internal_frontend/advice.py | 1 - lite_forms/components.py | 7 ++----- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/caseworker/cases/forms/finalise_case.py b/caseworker/cases/forms/finalise_case.py index 2f4f816eab..171374c33e 100644 --- a/caseworker/cases/forms/finalise_case.py +++ b/caseworker/cases/forms/finalise_case.py @@ -10,7 +10,7 @@ def approve_licence_form(queue_pk, case_id, is_open_licence, editable_duration, title=lite_content.lite_internal_frontend.advice.FinaliseLicenceForm.APPROVE_TITLE, questions=[ DateInput( - description=lite_content.lite_internal_frontend.advice.FinaliseLicenceForm.DATE_DESCRIPTION, + description="For example, 27 3 2019", title=lite_content.lite_internal_frontend.advice.FinaliseLicenceForm.DATE_TITLE, prefix="", ), diff --git a/exporter/applications/forms/common.py b/exporter/applications/forms/common.py index 13e86c39e0..738b16a1ff 100644 --- a/exporter/applications/forms/common.py +++ b/exporter/applications/forms/common.py @@ -31,23 +31,23 @@ def application_copy_form(application_type=None): def exhibition_details_form(application_id): return Form( - title=strings.Exhibition.EXHIBITION_TITLE, + title="Exhibition details", questions=[ - TextInput(title=strings.Exhibition.TITLE, name="title"), + TextInput(title="Name", name="title"), DateInput( - title=strings.Exhibition.FIRST_EXHIBITION_DATE, - description=strings.Exhibition.DATE_DESCRIPTION, + title="Exhibition start date", + description="Exhibition start date", prefix="first_exhibition_date", name="first_exhibition_date", ), DateInput( - title=strings.Exhibition.REQUIRED_BY_DATE, - description=strings.Exhibition.DATE_DESCRIPTION, + title="Date the clearance is needed", + description="For example, 12 11 2020", prefix="required_by_date", name="required_by_date", ), TextArea( - title=strings.Exhibition.REASON_FOR_CLEARANCE, + title="The reason the clearance is needed by this date", name="reason_for_clearance", optional=True, extras={"max_length": 2000}, diff --git a/exporter/goods/forms/goods.py b/exporter/goods/forms/goods.py index 945750b179..a03235cffa 100644 --- a/exporter/goods/forms/goods.py +++ b/exporter/goods/forms/goods.py @@ -273,8 +273,8 @@ def upload_firearms_act_certificate_form(section, filename, back_link): optional=False, ), DateInput( - title=CreateGoodForm.FirearmGood.FirearmsActCertificate.EXPIRY_DATE, - description=CreateGoodForm.FirearmGood.FirearmsActCertificate.EXPIRY_DATE_HINT, + title="Expiry date", + description="For example, 12 11 2022", prefix="section_certificate_date_of_expiry", name="section_certificate_date_of_expiry", ), diff --git a/lite_content/lite_exporter_frontend/strings.py b/lite_content/lite_exporter_frontend/strings.py index 836c8419a4..8402fe29b4 100644 --- a/lite_content/lite_exporter_frontend/strings.py +++ b/lite_content/lite_exporter_frontend/strings.py @@ -399,7 +399,6 @@ class Exhibition: TITLE = "Name" FIRST_EXHIBITION_DATE = "Exhibition start date" REQUIRED_BY_DATE = "Date the clearance is needed" - DATE_DESCRIPTION = "For example, 12 11 2020" REASON_FOR_CLEARANCE = "The reason the clearance is needed by this date" diff --git a/lite_content/lite_internal_frontend/advice.py b/lite_content/lite_internal_frontend/advice.py index 618288689d..182a525e06 100644 --- a/lite_content/lite_internal_frontend/advice.py +++ b/lite_content/lite_internal_frontend/advice.py @@ -84,7 +84,6 @@ class FinaliseLicenceForm: FINALISE_TITLE = "Finalise" REFUSE_DESCRIPTION = "You'll be denying the case" NLR_DESCRIPTION = "You'll be informing the exporter that no licence is required" - DATE_DESCRIPTION = "For example, 27 3 2019" DATE_TITLE = "Licence start date" DURATION_DESCRIPTION = "This must be a whole number of months, such as 12" DURATION_TITLE = "How long will it last?" diff --git a/lite_forms/components.py b/lite_forms/components.py index 7d67f0253d..336c718468 100644 --- a/lite_forms/components.py +++ b/lite_forms/components.py @@ -552,11 +552,9 @@ def __init__( extras: Optional[List] = None, suffix: str = "", ): - from lite_forms.helpers import convert_to_markdown - self.prefix = prefix self.title = title - self.description = convert_to_markdown(description) + self.description = description self.name = name self.optional = optional self.classes = classes @@ -626,11 +624,10 @@ def __init__( such as an entity (person, place, or thing) or text. They enable user input and verify that input by converting text into chips. """ - from lite_forms.helpers import convert_to_markdown self.name = name self.title = title - self.description = convert_to_markdown(description) + self.description = description self.options = options self.optional = optional self.classes = classes if classes else ["tokenfield-container"] From 62f073c107e7dcea6d455d6890d691f50fa33b69 Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 14:17:28 +0000 Subject: [PATCH 03/13] remove markup option components --- caseworker/organisations/forms.py | 2 -- .../forms/trade_control_licence.py | 8 ++++--- .../forms/triage_questions.py | 5 +++-- .../lite_exporter_frontend/applications.py | 22 ------------------- .../lite_internal_frontend/organisations.py | 1 - lite_forms/components.py | 3 +-- lite_forms/tests.py | 9 -------- 7 files changed, 9 insertions(+), 41 deletions(-) diff --git a/caseworker/organisations/forms.py b/caseworker/organisations/forms.py index 015372cfe7..26ed8ec014 100644 --- a/caseworker/organisations/forms.py +++ b/caseworker/organisations/forms.py @@ -50,12 +50,10 @@ def register_organisation_forms(request): Option( key="commercial", value=RegisterAnOrganisation.CommercialOrIndividual.COMMERCIAL_TITLE, - description=RegisterAnOrganisation.CommercialOrIndividual.COMMERCIAL_DESCRIPTION, ), Option( key="individual", value=RegisterAnOrganisation.CommercialOrIndividual.INDIVIDUAL_TITLE, - description=RegisterAnOrganisation.CommercialOrIndividual.INDIVIDUAL_DESCRIPTION, ), ], ) diff --git a/exporter/apply_for_a_licence/forms/trade_control_licence.py b/exporter/apply_for_a_licence/forms/trade_control_licence.py index e17d4662f6..68cd378950 100644 --- a/exporter/apply_for_a_licence/forms/trade_control_licence.py +++ b/exporter/apply_for_a_licence/forms/trade_control_licence.py @@ -18,17 +18,19 @@ def application_type_form(): Option( key=CaseTypes.OGTCL, value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_GENERAL_TRADE_CONTROL_LICENCE, - description=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_GENERAL_TRADE_CONTROL_LICENCE_DESCRIPTION, + description="""Select to register a pre-published licence with set terms and conditions. Being an OGTCL holder can benefit your + business by saving time and money.""", ), Option( key=CaseTypes.SICL, value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.STANDARD_LICENCE, - description=TradeControlLicenceQuestions.TradeControlLicenceQuestion.STANDARD_LICENCE_DESCRIPTION, + description="Select a standard licence for a set quantity and set value of products.", ), Option( key=CaseTypes.OICL, value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_LICENCE, - description=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_LICENCE_DESCRIPTION, + description="""Select an open licence for multiple shipments of specific products to specific destinations. + Open licences cover long term projects and repeat business.""", ), ], ) diff --git a/exporter/apply_for_a_licence/forms/triage_questions.py b/exporter/apply_for_a_licence/forms/triage_questions.py index c81abae230..54968b26a3 100644 --- a/exporter/apply_for_a_licence/forms/triage_questions.py +++ b/exporter/apply_for_a_licence/forms/triage_questions.py @@ -226,12 +226,13 @@ def transhipment_questions(request): Option( key=CaseTypes.OGTL, value=TranshipmentQuestions.TranshipmentLicenceQuestion.OPEN_GENERAL_TRANSHIPMENT_LICENCE, - description=TranshipmentQuestions.TranshipmentLicenceQuestion.OPEN_GENERAL_TRANSHIPMENT_LICENCE_DESCRIPTION, + description="""Select to register a pre-published licence with set terms and conditions. Being an OGTL holder can benefit your + business by saving time and money. """, ), Option( key=CaseTypes.SITL, value=TranshipmentQuestions.TranshipmentLicenceQuestion.STANDARD_LICENCE, - description=TranshipmentQuestions.TranshipmentLicenceQuestion.STANDARD_LICENCE_DESCRIPTION, + description="Select a standard transhipment licence for a set quantity and set value of products", ), ], ), diff --git a/lite_content/lite_exporter_frontend/applications.py b/lite_content/lite_exporter_frontend/applications.py index e5f9ca2891..88d3d6c9f2 100644 --- a/lite_content/lite_exporter_frontend/applications.py +++ b/lite_content/lite_exporter_frontend/applications.py @@ -299,18 +299,8 @@ class TradeControlLicenceQuestion: DESCRIPTION = "" BACK = "Back" OPEN_GENERAL_TRADE_CONTROL_LICENCE = "Open General Trade Control Licence (OGTCL)" - OPEN_GENERAL_TRADE_CONTROL_LICENCE_DESCRIPTION = ( - "Select to register a pre-published licence with set terms " - "and conditions. Being an OGTCL holder can benefit your " - "business by saving time and money." - ) STANDARD_LICENCE = "Standard licence" - STANDARD_LICENCE_DESCRIPTION = "Select a standard licence for a set quantity and set value of products." OPEN_LICENCE = "Open licence" - OPEN_LICENCE_DESCRIPTION = ( - "Select an open licence for multiple shipments of specific products to specific destinations. " - "Open licences cover long term projects and repeat business." - ) class ControlActivity: TITLE = "Select the type of trade control activity you're providing" @@ -357,20 +347,8 @@ class TranshipmentLicenceQuestion: DESCRIPTION = "" BACK = "Back" OPEN_GENERAL_TRANSHIPMENT_LICENCE = "Open General Transhipment Licence (OGTL)" - OPEN_GENERAL_TRANSHIPMENT_LICENCE_DESCRIPTION = ( - "Select to register a pre-published licence with set terms " - "and conditions. Being an OGTL holder can benefit your " - "business by saving time and money." - ) STANDARD_LICENCE = "Standard Transhipment Licence" - STANDARD_LICENCE_DESCRIPTION = ( - "Select a standard transhipment licence for a set quantity and set value of products." - ) OPEN_LICENCE = "Open licence" - OPEN_LICENCE_DESCRIPTION = ( - "Select an open licence for multiple shipments of specific products to specific destinations. " - "Open licences cover long term projects and repeat business." - ) class ExportType: TITLE = "Select an export type" diff --git a/lite_content/lite_internal_frontend/organisations.py b/lite_content/lite_internal_frontend/organisations.py index f1f1a40d0d..e0cdca95d0 100644 --- a/lite_content/lite_internal_frontend/organisations.py +++ b/lite_content/lite_internal_frontend/organisations.py @@ -84,7 +84,6 @@ class CommercialOrIndividual: COMMERCIAL_TITLE = "Commercial" COMMERCIAL_DESCRIPTION = "" INDIVIDUAL_TITLE = "Individual" - INDIVIDUAL_DESCRIPTION = "" ERROR = "Select the type of organisation you're registering for" class WhereIsTheExporterBased: diff --git a/lite_forms/components.py b/lite_forms/components.py index 336c718468..911db9bb37 100644 --- a/lite_forms/components.py +++ b/lite_forms/components.py @@ -436,12 +436,11 @@ def __init__( cannot_remove: bool = False, id=None, ): - from lite_forms.helpers import convert_to_markdown self.auto_check = auto_check self.key = key self.value = value - self.description = convert_to_markdown(description) + self.description = description self.show_or = show_or self.img_url = img_url self.components = [component for component in components if component] if components else [] diff --git a/lite_forms/tests.py b/lite_forms/tests.py index a777f14174..64e5b7dc2b 100644 --- a/lite_forms/tests.py +++ b/lite_forms/tests.py @@ -12,7 +12,6 @@ Label, HelpSection, Option, - DateInput, BackLink, HiddenField, NumberInput, @@ -225,14 +224,6 @@ def test_help_section(self): detail = HelpSection(title="abc", description=self.markdown_description) self.assertEqual(detail.description, self.html_description) - def test_option(self): - option = Option(key="a", value="A", description=self.markdown_description) - self.assertEqual(option.description, self.html_description) - - def test_date_input(self): - date = DateInput(prefix="Date", description=self.markdown_description) - self.assertEqual(date.description, self.html_description) - class SingleQuestionFormAccessibilityTest(TestCase): def test_no_questions_no_title_label(self): From e8fb052b66dba87fec30d642a7a943304e6e140d Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 14:32:23 +0000 Subject: [PATCH 04/13] remove markeup helpsection --- caseworker/organisations/forms.py | 2 +- lite_content/lite_internal_frontend/organisations.py | 1 - lite_forms/components.py | 4 +--- lite_forms/tests.py | 5 ----- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/caseworker/organisations/forms.py b/caseworker/organisations/forms.py index 26ed8ec014..3022e13f26 100644 --- a/caseworker/organisations/forms.py +++ b/caseworker/organisations/forms.py @@ -183,7 +183,7 @@ def create_admin_user_form(): TextInput(title="Contact telephone number", name="user.phone_number", optional=True), ], default_button_name="Submit", - helpers=[HelpSection("Help", RegisterAnOrganisation.DEFAULT_USER)], + helpers=[HelpSection("Help", "This will be the default user for this organisation.")], ) diff --git a/lite_content/lite_internal_frontend/organisations.py b/lite_content/lite_internal_frontend/organisations.py index e0cdca95d0..6d5f991518 100644 --- a/lite_content/lite_internal_frontend/organisations.py +++ b/lite_content/lite_internal_frontend/organisations.py @@ -74,7 +74,6 @@ class RegisterAnOrganisation: COMMERCIAL_TITLE = "Register an organisation" INDIVIDUAL_TITLE = "Register a private individual" CREATE_DEFAULT_SITE = "Create a default site for this exporter" - DEFAULT_USER = "This will be the default user for this organisation." EMAIL = "Email" NAME_OF_SITE = "Name of site" diff --git a/lite_forms/components.py b/lite_forms/components.py index 911db9bb37..0e07eac55b 100644 --- a/lite_forms/components.py +++ b/lite_forms/components.py @@ -212,10 +212,8 @@ def __init__(self, name, value): class HelpSection: def __init__(self, title, description, includes=None): - from lite_forms.helpers import convert_to_markdown - self.title = title - self.description = convert_to_markdown(description) + self.description = description self.includes = includes diff --git a/lite_forms/tests.py b/lite_forms/tests.py index 64e5b7dc2b..3bed2114d8 100644 --- a/lite_forms/tests.py +++ b/lite_forms/tests.py @@ -10,7 +10,6 @@ FormGroup, _Component, Label, - HelpSection, Option, BackLink, HiddenField, @@ -220,10 +219,6 @@ def test_detail_component(self): detail = DetailComponent(title="abc", description=self.markdown_description) self.assertEqual(detail.description, self.html_description) - def test_help_section(self): - detail = HelpSection(title="abc", description=self.markdown_description) - self.assertEqual(detail.description, self.html_description) - class SingleQuestionFormAccessibilityTest(TestCase): def test_no_questions_no_title_label(self): From 2ea1636bcc4e4eb6a40d3a034d5b99ee73876e69 Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 14:46:55 +0000 Subject: [PATCH 05/13] remove markeup DetailComponent --- exporter/compliance/forms.py | 23 ++++++++++++++++--- .../lite_exporter_frontend/compliance.py | 23 ------------------- lite_forms/components.py | 4 +--- lite_forms/tests.py | 4 ---- 4 files changed, 21 insertions(+), 33 deletions(-) diff --git a/exporter/compliance/forms.py b/exporter/compliance/forms.py index 2f560cc7b0..2ae0351231 100644 --- a/exporter/compliance/forms.py +++ b/exporter/compliance/forms.py @@ -12,15 +12,32 @@ def get_years(): def open_licence_return_form_group(): + FORMATTING_HELP_DETAILS = """ + The first row must contain column headers, or be blank. It must not contain returns data.
Columns must start from column A and be in the following order:
    +
  • Licence number
  • +
  • Destination
  • +
  • End user type
  • +
  • Usage count
  • +
  • Period
  • +

Licence number must be in one of the following formats:
    +
  • GBOXX20XX/XXXXX. For example GBOIE2020/00001)
  • +
  • GBOXX20XX/XXXXX/X for amended licences. For example GBOIE2020/00001/A
  • +

Destination names must be entered exactly as they appear on the licence.

End user type must be one of the following, entered exactly as shown here:
    +
  • Government
  • +
  • Commercial
  • +
  • Pvt Indiv
  • +
  • Other
  • +

Usage count must be a positive integer.

Period must be in the following format, entered exactly as shown with YY replaced with the last 2 digits of the year:
    +
  • 01-JAN-YY to 31-DEC-YY
  • +
+ """ return FormGroup( [ Form( title=OpenReturnsHelpPage.TITLE, questions=[ Label(OpenReturnsHelpPage.DESCRIPTION), - DetailComponent( - OpenReturnsHelpPage.FORMATTING_HELP_LINK, OpenReturnsHelpPage.FORMATTING_HELP_DETAILS - ), + DetailComponent("Format your open licence returns CSV", FORMATTING_HELP_DETAILS), ], default_button_name=OpenReturnsHelpPage.BUTTON, back_link=BackLink(OpenReturnsHelpPage.BACK, reverse_lazy("core:home")), diff --git a/lite_content/lite_exporter_frontend/compliance.py b/lite_content/lite_exporter_frontend/compliance.py index c8a458f528..15b99a32b1 100644 --- a/lite_content/lite_exporter_frontend/compliance.py +++ b/lite_content/lite_exporter_frontend/compliance.py @@ -5,29 +5,6 @@ class OpenReturnsHelpPage: You must submit open licence returns for:\n - Open Individual Export Licences (OIELs)\n - Open Individual Trade Control Licences (OITCLs)\n - Open General Export Licences (OGELs)\n - Open General Trade Control Licences (OGTCLs) """ # noqa - FORMATTING_HELP_LINK = "Format your open licence returns CSV" - FORMATTING_HELP_DETAILS = """The first row must contain column headers, or be blank. It must not contain returns data.\n - Columns must start from column A and be in the following order:\n - - - Licence number\n - Destination\n - End user type\n - Usage count\n - Period\n - - Licence number must be in one of the following formats:\n - - - GBOXX20XX/XXXXX. For example GBOIE2020/00001)\n - GBOXX20XX/XXXXX/X for amended licences. For example GBOIE2020/00001/A\n - - Destination names must be entered exactly as they appear on the licence.\n - \n - - End user type must be one of the following, entered exactly as shown here:\n - - - Government\n - Commercial\n - Pvt Indiv\n - Other\n - - Usage count must be a positive integer.\n - \n - - Period must be in the following format, entered exactly as shown with YY replaced with the last 2 digits of the year:\n - - - 01-JAN-YY to 31-DEC-YY\n""" BUTTON = "Next" diff --git a/lite_forms/components.py b/lite_forms/components.py index 0e07eac55b..b289fb5cf0 100644 --- a/lite_forms/components.py +++ b/lite_forms/components.py @@ -195,10 +195,8 @@ def __str__(self): class DetailComponent: def __init__(self, title, description="", components=None): - from lite_forms.helpers import convert_to_markdown - self.title = title - self.description = convert_to_markdown(description) + self.description = description self.components = components self.input_type = "detail" diff --git a/lite_forms/tests.py b/lite_forms/tests.py index 3bed2114d8..c1a26b4e0c 100644 --- a/lite_forms/tests.py +++ b/lite_forms/tests.py @@ -215,10 +215,6 @@ def test_form(self): form = Form(description=self.markdown_description) self.assertEqual(form.description, self.html_description) - def test_detail_component(self): - detail = DetailComponent(title="abc", description=self.markdown_description) - self.assertEqual(detail.description, self.html_description) - class SingleQuestionFormAccessibilityTest(TestCase): def test_no_questions_no_title_label(self): From cc375197f1f3ea630b4403928d266488dd3025bf Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 18:02:25 +0000 Subject: [PATCH 06/13] remove markdown form --- caseworker/cases/forms/attach_documents.py | 2 +- caseworker/cases/forms/generate_document.py | 2 +- caseworker/cases/forms/move_case.py | 2 +- caseworker/cases/forms/reissue_ogl_form.py | 2 +- caseworker/letter_templates/forms.py | 13 ++++++++----- caseworker/organisations/forms.py | 4 ++-- caseworker/queues/forms.py | 4 ++-- caseworker/teams/forms.py | 2 +- caseworker/users/forms/roles.py | 4 ++-- exporter/applications/forms/countries.py | 6 +++--- exporter/applications/forms/edit.py | 6 +++--- exporter/applications/forms/f680_details.py | 2 +- exporter/applications/forms/goods.py | 2 +- exporter/applications/forms/goods_types.py | 2 +- exporter/applications/forms/hmrc.py | 2 +- exporter/applications/forms/locations.py | 6 +++--- exporter/applications/forms/parties.py | 2 +- exporter/applications/views/clearance.py | 2 +- .../forms/open_general_licences.py | 6 +++--- .../forms/trade_control_licence.py | 8 ++++---- .../apply_for_a_licence/forms/triage_questions.py | 4 ++-- exporter/compliance/forms.py | 4 ++-- exporter/ecju_queries/forms.py | 2 +- exporter/goods/forms/goods.py | 14 +++++++++----- exporter/organisation/members/forms.py | 2 +- exporter/organisation/sites/forms.py | 2 +- .../lite_exporter_frontend/applications.py | 2 +- lite_content/lite_exporter_frontend/goods.py | 9 --------- lite_forms/components.py | 4 ++-- 29 files changed, 60 insertions(+), 62 deletions(-) diff --git a/caseworker/cases/forms/attach_documents.py b/caseworker/cases/forms/attach_documents.py index 50e03e4566..2daa96f23b 100644 --- a/caseworker/cases/forms/attach_documents.py +++ b/caseworker/cases/forms/attach_documents.py @@ -28,7 +28,7 @@ def attach_documents_form(case_url): def upload_document_form(queue_pk): return Form( UploadEnforcementXML.TITLE, - UploadEnforcementXML.DESCRIPTION, + "", [ FileUpload(name="file"), ], diff --git a/caseworker/cases/forms/generate_document.py b/caseworker/cases/forms/generate_document.py index 3719e91fc8..c71d67a4b7 100644 --- a/caseworker/cases/forms/generate_document.py +++ b/caseworker/cases/forms/generate_document.py @@ -31,7 +31,7 @@ def select_template_form(templates, back_url): def select_addressee_form(): return Form( title=GenerateDocumentsPage.AddresseeForm.TITLE, - description=GenerateDocumentsPage.AddresseeForm.DESCRIPTION, + description="", questions=[Custom("components/addressee-table.html")], default_button_name=letter_templates.LetterTemplatesPage.PickTemplate.BUTTON, container="case", diff --git a/caseworker/cases/forms/move_case.py b/caseworker/cases/forms/move_case.py index 21c1e275d5..1f1360f1a4 100644 --- a/caseworker/cases/forms/move_case.py +++ b/caseworker/cases/forms/move_case.py @@ -9,7 +9,7 @@ def move_case_form(request: HttpRequest, queue, case: dict): return Form( title=Manage.MoveCase.TITLE, - description=Manage.MoveCase.DESCRIPTION, + description="", questions=[ Filter(), Checkboxes("queues[]", get_queues(request, convert_to_options=True), filterable=True), diff --git a/caseworker/cases/forms/reissue_ogl_form.py b/caseworker/cases/forms/reissue_ogl_form.py index 7183f66a8e..8785cf1855 100644 --- a/caseworker/cases/forms/reissue_ogl_form.py +++ b/caseworker/cases/forms/reissue_ogl_form.py @@ -7,7 +7,7 @@ def reissue_ogl_confirmation_form(case_id, queue_id): return Form( title=Manage.ReissueOGL.TITLE, - description=Manage.ReissueOGL.DESCRIPTION, + description="Doing so will allow the exporter to resume using this open general licence", questions=[ RadioButtons( name="confirm", diff --git a/caseworker/letter_templates/forms.py b/caseworker/letter_templates/forms.py index fcf2cab144..b8769e55c2 100644 --- a/caseworker/letter_templates/forms.py +++ b/caseworker/letter_templates/forms.py @@ -16,6 +16,9 @@ from caseworker.letter_templates.services import get_letter_layouts from lite_forms.helpers import conditional +EDIT_LETTER_TEMPLATE_HINT = """Call it something that:
• is easy to find
+ • explains when to use this template
For example, 'Refuse a licence' """ + def _letter_layout_options(request): options = [] @@ -49,7 +52,7 @@ def add_letter_template(request): forms=[ Form( title=strings.LetterTemplates.AddLetterTemplate.Name.TITLE, - description=strings.LetterTemplates.AddLetterTemplate.Name.HINT, + description=EDIT_LETTER_TEMPLATE_HINT, questions=[TextInput(name="name")], back_link=BackLink( strings.LetterTemplates.AddLetterTemplate.Name.BACK_LINK, @@ -75,7 +78,7 @@ def add_letter_template(request): is_application_case_types_only, Form( title=strings.LetterTemplates.EditLetterTemplate.Decisions.TITLE, - description=strings.LetterTemplates.EditLetterTemplate.Decisions.DESCRIPTION, + description="Select the decisions that apply to your template", questions=[ Checkboxes( name="decisions[]", @@ -90,7 +93,7 @@ def add_letter_template(request): ), Form( title=strings.LetterTemplates.AddLetterTemplate.VisibleToExporter.TITLE, - description=strings.LetterTemplates.AddLetterTemplate.VisibleToExporter.DESCRIPTION, + description="Should documents created with this template be visible to exporters?", questions=[ RadioButtons( name="visible_to_exporter", @@ -108,7 +111,7 @@ def add_letter_template(request): ), Form( title=strings.LetterTemplates.AddLetterTemplate.IncludeSignature.TITLE, - description=strings.LetterTemplates.AddLetterTemplate.IncludeSignature.DESCRIPTION, + description="", questions=[ RadioButtons( name="include_digital_signature", @@ -139,7 +142,7 @@ def edit_letter_template(request, letter_template, case_type_options, decision_o questions=[ TextInput( title=strings.LetterTemplates.EditLetterTemplate.Name.TITLE, - description=strings.LetterTemplates.EditLetterTemplate.Name.HINT, + description=EDIT_LETTER_TEMPLATE_HINT, name="name", ), Checkboxes( diff --git a/caseworker/organisations/forms.py b/caseworker/organisations/forms.py index 3022e13f26..6812d45c32 100644 --- a/caseworker/organisations/forms.py +++ b/caseworker/organisations/forms.py @@ -42,7 +42,7 @@ def register_organisation_forms(request): [ Form( title=RegisterAnOrganisation.CommercialOrIndividual.TITLE, - description=RegisterAnOrganisation.CommercialOrIndividual.DESCRIPTION, + description="", questions=[ RadioButtons( name="type", @@ -63,7 +63,7 @@ def register_organisation_forms(request): ), Form( title=RegisterAnOrganisation.WhereIsTheExporterBased.TITLE, - description=RegisterAnOrganisation.WhereIsTheExporterBased.DESCRIPTION, + description="", questions=[ RadioButtons( name="location", diff --git a/caseworker/queues/forms.py b/caseworker/queues/forms.py index e6ea040852..624423a278 100644 --- a/caseworker/queues/forms.py +++ b/caseworker/queues/forms.py @@ -22,7 +22,7 @@ def new_queue_form(request): return Form( title=AddQueueForm.TITLE, - description=AddQueueForm.DESCRIPTION, + description="", questions=[ TextInput( title=AddQueueForm.Name.TITLE, @@ -55,7 +55,7 @@ def remove_current_queue_id(options, queue_id): def edit_queue_form(request, queue_id): return Form( title=EditQueueForm.TITLE, - description=EditQueueForm.DESCRIPTION, + description="", questions=[ TextInput( title=EditQueueForm.Name.TITLE, diff --git a/caseworker/teams/forms.py b/caseworker/teams/forms.py index 98c0ebcd0a..d04fe54f87 100644 --- a/caseworker/teams/forms.py +++ b/caseworker/teams/forms.py @@ -11,7 +11,7 @@ def add_team_form(): return Form( title=AddTeamForm.TITLE, - description=AddTeamForm.DESCRIPTION, + description="", questions=[ TextInput(title=AddTeamForm.Name.TITLE, description=AddTeamForm.Name.DESCRIPTION, name="name"), RadioButtons( diff --git a/caseworker/users/forms/roles.py b/caseworker/users/forms/roles.py index e0bd57f51b..c20ed484eb 100644 --- a/caseworker/users/forms/roles.py +++ b/caseworker/users/forms/roles.py @@ -10,7 +10,7 @@ def add_role(request: HttpRequest): return Form( title=AddRoleForm.TITLE, - description=AddRoleForm.DESCRIPTION, + description="", questions=[ TextInput(title=AddRoleForm.ROLE_NAME, name="name"), Checkboxes( @@ -38,7 +38,7 @@ def add_role(request: HttpRequest): def edit_role(request: HttpRequest): return Form( title=EditRoleForm.TITLE, - description=EditRoleForm.DESCRIPTION, + description="", questions=[ TextInput(title=EditRoleForm.ROLE_NAME, name="name"), Checkboxes( diff --git a/exporter/applications/forms/countries.py b/exporter/applications/forms/countries.py index 071633f19d..9857ba8c95 100644 --- a/exporter/applications/forms/countries.py +++ b/exporter/applications/forms/countries.py @@ -9,7 +9,7 @@ def countries_form(request, application_id): return Form( title=strings.applications.DestinationForm.TITLE, - description=strings.applications.DestinationForm.DESCRIPTION, + description="", questions=[ Filter(), Checkboxes( @@ -28,7 +28,7 @@ def countries_form(request, application_id): def choose_contract_type_form(): return Form( title=contractTypeStrings.ChooseContractTypeForm.TITLE, - description=contractTypeStrings.ChooseContractTypeForm.DESCRIPTION, + description="Examples of sectors and contract types are ‘army’, ‘registered firearm dealers’ and ‘for the exporters own use’.", questions=[ RadioButtons( "choice", @@ -46,7 +46,7 @@ def choose_contract_type_form(): def contract_type_per_country_form(current_country, country_name): return Form( title=contractTypeStrings.AddContractTypesForm.TITLE + country_name, - description=contractTypeStrings.AddContractTypesForm.DESCRIPTION, + description="", questions=[ HiddenField("countries", current_country), Checkboxes( diff --git a/exporter/applications/forms/edit.py b/exporter/applications/forms/edit.py index bc3e1190dd..752c745b31 100644 --- a/exporter/applications/forms/edit.py +++ b/exporter/applications/forms/edit.py @@ -8,7 +8,7 @@ def reference_name_form(application_id=None): return Form( title=applications.InitialApplicationQuestionsForms.ReferenceNameQuestion.TITLE, - description=applications.InitialApplicationQuestionsForms.ReferenceNameQuestion.DESCRIPTION, + description="Give the application a reference name so you can refer back to it when needed.", questions=[ TextInput(name="name"), ], @@ -20,7 +20,7 @@ def reference_name_form(application_id=None): def firearms_form(application_id=None): return Form( title=applications.GoodsCategories.TITLE, - description=applications.GoodsCategories.DESCRIPTION, + description="", questions=[ RadioButtons( name="contains_firearm_goods", @@ -38,7 +38,7 @@ def firearms_form(application_id=None): def told_by_an_official_form(application_id=None): return Form( title=ExportLicenceQuestions.HaveYouBeenInformedQuestion.TITLE, - description=ExportLicenceQuestions.HaveYouBeenInformedQuestion.DESCRIPTION, + description="Give the application a reference name so you can refer back to it when needed.", questions=[ RadioButtons( name="have_you_been_informed", diff --git a/exporter/applications/forms/f680_details.py b/exporter/applications/forms/f680_details.py index acb17cf8ad..5b5037a800 100644 --- a/exporter/applications/forms/f680_details.py +++ b/exporter/applications/forms/f680_details.py @@ -8,7 +8,7 @@ def f680_details_form(request, application_id): return Form( title=F680Details.TITLE, - description=F680Details.DESCRIPTION, + description="", questions=[ Checkboxes( name="types[]", diff --git a/exporter/applications/forms/goods.py b/exporter/applications/forms/goods.py index 3c81d51590..b151df5558 100644 --- a/exporter/applications/forms/goods.py +++ b/exporter/applications/forms/goods.py @@ -9,7 +9,7 @@ def exhibition_item_type(request, good_id, application_id): return components.Form( title=AddGoodToApplicationForm.Exhibition.TITLE, - description=AddGoodToApplicationForm.Exhibition.DESCRIPTION, + description="", questions=[ components.HiddenField(name="good_id", value=good_id), components.RadioButtons(title="", description="", name="item_type", options=get_item_types(request)), diff --git a/exporter/applications/forms/goods_types.py b/exporter/applications/forms/goods_types.py index 3cdb78c4ce..069506432e 100644 --- a/exporter/applications/forms/goods_types.py +++ b/exporter/applications/forms/goods_types.py @@ -10,7 +10,7 @@ def goods_type_form(request, application_type: str): return Form( title=CreateGoodsTypeForm.TITLE, - description=CreateGoodsTypeForm.DESCRIPTION, + description="Start with the product name to make it easier to find the product when needed. Include the commodity code if you know it.", questions=[ TextArea( title=CreateGoodsTypeForm.Description.TITLE, diff --git a/exporter/applications/forms/hmrc.py b/exporter/applications/forms/hmrc.py index 11854dea67..f5793fd077 100644 --- a/exporter/applications/forms/hmrc.py +++ b/exporter/applications/forms/hmrc.py @@ -43,7 +43,7 @@ def query_explanation_form(application_id): def reference_name_form(): return Form( title=applications.HMRCQuery.InitialQuestions.REFERENCE_NAME_TITLE, - description=applications.HMRCQuery.InitialQuestions.REFERENCE_NAME_DESCRIPTION, + description="Give the query a reference name so you can refer back to it when needed.", questions=[ TextInput(name="name"), ], diff --git a/exporter/applications/forms/locations.py b/exporter/applications/forms/locations.py index 21ff5dfa33..ad4ece616c 100644 --- a/exporter/applications/forms/locations.py +++ b/exporter/applications/forms/locations.py @@ -33,7 +33,7 @@ class Locations: def which_location_form(application_id, application_type): return Form( title=goods.GoodsLocationForm.WHERE_ARE_YOUR_GOODS_LOCATED_TITLE, - description=goods.GoodsLocationForm.WHERE_ARE_YOUR_GOODS_LOCATED_DESCRIPTION, + description="", questions=[ RadioButtons( "choice", @@ -97,7 +97,7 @@ def new_external_location_form(request, application_type=None, location_type=Non def location_type_form(request, application_type=None): return Form( title=LocationTypeForm.TITLE, - description=LocationTypeForm.DESCRIPTION, + description="", questions=[ HiddenField("application_type", application_type), RadioButtons( @@ -124,7 +124,7 @@ def new_location_form(request, application_type, location_type): return Form( title=NewLocationForm.TITLE, - description=NewLocationForm.DESCRIPTION, + description="", questions=[ HiddenField(name="external_locations", value=""), TextInput(name="name", title=NewLocationForm.Name.TITLE), diff --git a/exporter/applications/forms/parties.py b/exporter/applications/forms/parties.py index 5e87417408..836c9826f9 100644 --- a/exporter/applications/forms/parties.py +++ b/exporter/applications/forms/parties.py @@ -89,7 +89,7 @@ def party_signatory_name_form(title, button): def party_clearance_level_form(options, button): return Form( title=strings.Parties.Clearance.Level.TITLE, - description=strings.Parties.Clearance.Level.DESCRIPTION, + description="", questions=[RadioButtons(name="clearance_level", options=options)], default_button_name=button, ) diff --git a/exporter/applications/views/clearance.py b/exporter/applications/views/clearance.py index 0cf132c186..ef3f96ee35 100644 --- a/exporter/applications/views/clearance.py +++ b/exporter/applications/views/clearance.py @@ -13,7 +13,7 @@ def clearance_level_form(application_id, options): return Form( title=ClearanceLevel.TITLE, - description=ClearanceLevel.DESCRIPTION, + description="", questions=[RadioButtons(name="clearance_level", options=options)], back_link=back_to_task_list(application_id), ) diff --git a/exporter/apply_for_a_licence/forms/open_general_licences.py b/exporter/apply_for_a_licence/forms/open_general_licences.py index 33f2df695b..5088321e9f 100644 --- a/exporter/apply_for_a_licence/forms/open_general_licences.py +++ b/exporter/apply_for_a_licence/forms/open_general_licences.py @@ -37,7 +37,7 @@ def no_open_general_licence_form(open_general_licence_type, selected_entry, sele title=OpenGeneralLicenceQuestions.NoOpenGeneralLicencesAvailable.TITLE.format( open_general_licence_type.name.lower() ), - description=OpenGeneralLicenceQuestions.NoOpenGeneralLicencesAvailable.DESCRIPTION, + description="", questions=[ *[ Label(x.format(open_general_licence_type.name.lower(), selected_entry, selected_country)) @@ -88,14 +88,14 @@ def open_general_licence_forms(request, **kwargs): [ Form( title=OpenGeneralLicenceQuestions.ControlListEntry.TITLE, - description=OpenGeneralLicenceQuestions.ControlListEntry.DESCRIPTION, + description="", questions=[AutocompleteInput(name="control_list_entry", options=control_list_entries)], default_button_name=generic.CONTINUE, back_link=BackLink(url=back_link_url), ), Form( title=OpenGeneralLicenceQuestions.Country.TITLE, - description=OpenGeneralLicenceQuestions.Country.DESCRIPTION, + description="", questions=[AutocompleteInput(name="country", options=countries)], default_button_name=generic.CONTINUE, ), diff --git a/exporter/apply_for_a_licence/forms/trade_control_licence.py b/exporter/apply_for_a_licence/forms/trade_control_licence.py index 68cd378950..9ba89d7d7c 100644 --- a/exporter/apply_for_a_licence/forms/trade_control_licence.py +++ b/exporter/apply_for_a_licence/forms/trade_control_licence.py @@ -10,7 +10,7 @@ def application_type_form(): return Form( title=TradeControlLicenceQuestions.TradeControlLicenceQuestion.TITLE, - description=TradeControlLicenceQuestions.TradeControlLicenceQuestion.DESCRIPTION, + description="", questions=[ RadioButtons( name="application_type", @@ -64,7 +64,7 @@ def activity_form(request): return Form( title=TradeControlLicenceQuestions.ControlActivity.TITLE, - description=TradeControlLicenceQuestions.ControlActivity.DESCRIPTION, + description="", questions=[RadioButtons(name="trade_control_activity", options=options)], default_button_name=generic.CONTINUE, ) @@ -77,15 +77,15 @@ def product_category_form(request): "category_b": TradeControlLicenceQuestions.ProductCategory.CATEGORY_B_HINT, "category_c": TradeControlLicenceQuestions.ProductCategory.CATEGORY_C_HINT, } + PRODUCT_CATEGORY_DESCRIPTION = """Find out about trade control product categories.""" options = [ Option(product_category["key"], product_category["value"], hint_text_map.get(product_category["key"])) for product_category in product_categories ] - return Form( title=TradeControlLicenceQuestions.ProductCategory.TITLE, - description=TradeControlLicenceQuestions.ProductCategory.DESCRIPTION, + description=PRODUCT_CATEGORY_DESCRIPTION, questions=[Checkboxes(name="trade_control_product_categories[]", options=options)], default_button_name=generic.SAVE_AND_CONTINUE, ) diff --git a/exporter/apply_for_a_licence/forms/triage_questions.py b/exporter/apply_for_a_licence/forms/triage_questions.py index 54968b26a3..7b7548ee88 100644 --- a/exporter/apply_for_a_licence/forms/triage_questions.py +++ b/exporter/apply_for_a_licence/forms/triage_questions.py @@ -218,7 +218,7 @@ def transhipment_questions(request): [ Form( title=TranshipmentQuestions.TranshipmentLicenceQuestion.TITLE, - description=TranshipmentQuestions.TranshipmentLicenceQuestion.DESCRIPTION, + description="", questions=[ RadioButtons( name="application_type", @@ -256,7 +256,7 @@ def MOD_questions(application_type=None): [ Form( title=MODQuestions.WhatAreYouApplyingFor.TITLE, - description=MODQuestions.WhatAreYouApplyingFor.DESCRIPTION, + description="", questions=[ RadioButtons( name="application_type", diff --git a/exporter/compliance/forms.py b/exporter/compliance/forms.py index 2ae0351231..45e81ca522 100644 --- a/exporter/compliance/forms.py +++ b/exporter/compliance/forms.py @@ -44,7 +44,7 @@ def open_licence_return_form_group(): ), Form( title=OpenReturnsForm.Year.TITLE, - description=OpenReturnsForm.Year.DESCRIPTION, + description="", questions=[ Select( title=OpenReturnsForm.Year.FIELD_TITLE, @@ -57,7 +57,7 @@ def open_licence_return_form_group(): ), Form( title=OpenReturnsForm.Upload.TITLE, - description=OpenReturnsForm.Upload.DESCRIPTION, + description="The file must be smaller than 1MB", questions=[ FileUpload(), Label(OpenReturnsForm.Upload.ExampleTable.HEADING), diff --git a/exporter/ecju_queries/forms.py b/exporter/ecju_queries/forms.py index 8e279a9426..46fb259ffb 100644 --- a/exporter/ecju_queries/forms.py +++ b/exporter/ecju_queries/forms.py @@ -48,7 +48,7 @@ def ecju_query_respond_confirmation_form(edit_response_url): def upload_documents_form(back_link): return Form( title=ecju_queries.UploadDocumentForm.TITLE, - description=ecju_queries.UploadDocumentForm.DESCRIPTION, + description="Do not attach a document that's above OFFICIAL-SENSITIVE.

The file must be smaller than 50MB.", questions=[ FileUpload(), TextArea( diff --git a/exporter/goods/forms/goods.py b/exporter/goods/forms/goods.py index a03235cffa..2524908872 100644 --- a/exporter/goods/forms/goods.py +++ b/exporter/goods/forms/goods.py @@ -76,7 +76,7 @@ def edit_grading_form(request, good_id): def pv_details_form(request): return Form( title=GoodGradingForm.TITLE, - description=GoodGradingForm.DESCRIPTION, + description="", questions=[ Heading("PV grading", HeadingStyle.M), Group( @@ -107,7 +107,7 @@ def pv_details_form(request): def edit_good_detail_form(request, good_id): return Form( title=EditGoodForm.TITLE, - description=EditGoodForm.DESCRIPTION, + description="", questions=[ TextInput( title="Name", @@ -149,9 +149,11 @@ def edit_good_detail_form(request, good_id): def check_document_available_form(back_url): + DESCRIPTION = """For example, a technical specification, datasheet, sales brochure or something else that fully describes the product details.
This is required in order to process the application.""" + return Form( title=DocumentAvailabilityForm.TITLE, - description=DocumentAvailabilityForm.DESCRIPTION, + description=DESCRIPTION, questions=[ RadioButtons( name="is_document_available", @@ -202,9 +204,11 @@ def document_grading_form(back_url): def attach_documents_form(back_link): + DESCRIPTION = """Upload a DOCX, DOC, PDF, PNG, JPEG or ODT file.
Documentation could be specifications, datasheets, sales brochures, drawings or anything else that fully details what the product is and what it's designed to do.
Do not attach a document that’s above OFFICIAL-SENSITIVE.
The file must be smaller than 50MB.""" + return Form( title=AttachDocumentForm.TITLE, - description=AttachDocumentForm.DESCRIPTION, + description=DESCRIPTION, questions=[ FileUpload(), TextArea( @@ -261,7 +265,7 @@ def format_list_item(link, name, description): def upload_firearms_act_certificate_form(section, filename, back_link): return Form( title=f"Attach your Firearms Act 1968 {section} certificate", - description=FileUploadFileTypes.UPLOAD_GUIDANCE_TEXT + "\n\nThe file must be smaller than 50MB.", + description=FileUploadFileTypes.UPLOAD_GUIDANCE_TEXT + "

The file must be smaller than 50MB.", questions=[ HiddenField("firearms_certificate_uploaded", False), FileUpload(), diff --git a/exporter/organisation/members/forms.py b/exporter/organisation/members/forms.py index 3fd55825f5..e8636c45a8 100644 --- a/exporter/organisation/members/forms.py +++ b/exporter/organisation/members/forms.py @@ -32,7 +32,7 @@ def edit_user_form(request, user_id, can_edit_role: bool): def assign_sites(request): return Form( title=strings.users.AssignToSitesForm.ASSIGN_USER_TO_SITES_TITLE, - description=strings.users.AssignToSitesForm.ASSIGN_USER_TO_SITES_DESCRIPTION, + description="", questions=[Checkboxes(name="sites[]", options=get_sites(request, request.session["organisation"], True))], default_button_name=strings.SAVE, ) diff --git a/exporter/organisation/sites/forms.py b/exporter/organisation/sites/forms.py index 915ce2f04a..9836430625 100644 --- a/exporter/organisation/sites/forms.py +++ b/exporter/organisation/sites/forms.py @@ -248,7 +248,7 @@ def site_records_location(request, in_uk=True, is_editing=False): if in_uk else strings.sites.AddSiteForm.SiteRecords.SiteNotInUK.TITLE ), - description=strings.sites.AddSiteForm.SiteRecords.DESCRIPTION, + description="ECJU uses this for compliance visits.", questions=[ *conditional( in_uk, diff --git a/lite_content/lite_exporter_frontend/applications.py b/lite_content/lite_exporter_frontend/applications.py index 88d3d6c9f2..01bebbdccb 100644 --- a/lite_content/lite_exporter_frontend/applications.py +++ b/lite_content/lite_exporter_frontend/applications.py @@ -223,7 +223,7 @@ class ReferenceNameQuestion: class ExportLicenceQuestions: class HaveYouBeenInformedQuestion: TITLE = "Have you received a letter or email from Border Force or HMRC informing you to apply for a licence?" - DESCRIPTION = "You may know this as an 'end use control'." + DESCRIPTION = "Give the application a reference name so you can refer back to it when needed." WHAT_WAS_THE_REFERENCE_CODE_TITLE = "Reference number" WHAT_WAS_THE_REFERENCE_CODE_DESCRIPTION = ( "For example, CRE/2020/1234567. The reference number is on the letter or email." diff --git a/lite_content/lite_exporter_frontend/goods.py b/lite_content/lite_exporter_frontend/goods.py index de80222bff..bcd99c39a4 100644 --- a/lite_content/lite_exporter_frontend/goods.py +++ b/lite_content/lite_exporter_frontend/goods.py @@ -1,8 +1,6 @@ from lite_content.lite_exporter_frontend import generic from lite_content.lite_exporter_frontend.generic import PERMISSION_FINDER_LINK -from exporter.core.constants import FileUploadFileTypes - class GoodsList: TITLE = "Product list" @@ -335,13 +333,6 @@ class DeleteConfirmationForm: class AttachDocumentForm: TITLE = "Attach a document" - DESCRIPTION = ( - FileUploadFileTypes.UPLOAD_GUIDANCE_TEXT - + "\n\nDocumentation could be specifications, datasheets, sales brochures, drawings " - "or anything else that fully details what the product is and what it's designed to do." - "\n\nDo not attach a document that’s above OFFICIAL-SENSITIVE. " - "\n\nThe file must be smaller than 50MB." - ) BUTTON = "Save and continue" BACK_FORM_LINK = "Back" BACK_GOOD_LINK = "Back to product" diff --git a/lite_forms/components.py b/lite_forms/components.py index b289fb5cf0..b98e421551 100644 --- a/lite_forms/components.py +++ b/lite_forms/components.py @@ -165,10 +165,10 @@ def __init__( container: str = "two-pane", form_help=None, ): - from lite_forms.helpers import convert_to_markdown, heading_used_as_label + from lite_forms.helpers import heading_used_as_label self.title = title - self.description = convert_to_markdown(description) + self.description = description self.questions = questions self.caption = caption self.helpers = helpers From 0df0d9fc2975c44d7d19770e02936488c160a90f Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 19:28:50 +0000 Subject: [PATCH 07/13] remove markdown label --- caseworker/cases/forms/finalise_case.py | 4 ++-- exporter/applications/components.py | 4 +++- exporter/applications/forms/questions.py | 11 ++++++++++- .../forms/open_general_licences.py | 4 ++-- exporter/compliance/forms.py | 2 +- lite_content/lite_exporter_frontend/compliance.py | 6 +++--- lite_content/lite_exporter_frontend/goods.py | 9 +++------ lite_forms/components.py | 4 +--- lite_forms/tests.py | 8 -------- 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/caseworker/cases/forms/finalise_case.py b/caseworker/cases/forms/finalise_case.py index 171374c33e..77a0b46916 100644 --- a/caseworker/cases/forms/finalise_case.py +++ b/caseworker/cases/forms/finalise_case.py @@ -48,9 +48,9 @@ def approve_licence_form(queue_pk, case_id, is_open_licence, editable_duration, def deny_licence_form(queue_pk, case_id, is_open_licence, nlr): if nlr: - description = lite_content.lite_internal_frontend.advice.FinaliseLicenceForm.NLR_DESCRIPTION + description = "You'll be informing the exporter that no licence is required" else: - description = lite_content.lite_internal_frontend.advice.FinaliseLicenceForm.REFUSE_DESCRIPTION + description = "You'll be denying the case" return Form( title=lite_content.lite_internal_frontend.advice.FinaliseLicenceForm.FINALISE_TITLE, diff --git a/exporter/applications/components.py b/exporter/applications/components.py index 49983753cb..0d1e05f1a1 100644 --- a/exporter/applications/components.py +++ b/exporter/applications/components.py @@ -13,4 +13,6 @@ def back_to_task_list(application_id): def footer_label(application_id): url = reverse("applications:task_list", kwargs={"pk": str(application_id)}) - return Label(f'Or return to application overview') + return Label( + f'Or return to application overview' + ) diff --git a/exporter/applications/forms/questions.py b/exporter/applications/forms/questions.py index 61dab4b60a..02e7a0fd8c 100644 --- a/exporter/applications/forms/questions.py +++ b/exporter/applications/forms/questions.py @@ -125,7 +125,16 @@ def electronic_warfare_form(): RadioButtons( name="electronic_warfare_requirement", options=[ - Option(key=True, value="Yes", components=[Label(text=F680Questions.EWRequirement.ATTACHMENT)]), + Option( + key=True, + value="Yes", + components=[ + Label( + text="""You need to complete part A of the MOD EW Data Release Capture Form + and attach it to the application in the supporting documents section.""" + ) + ], + ), Option(key=False, value="No"), ], ) diff --git a/exporter/apply_for_a_licence/forms/open_general_licences.py b/exporter/apply_for_a_licence/forms/open_general_licences.py index 5088321e9f..0c3b528582 100644 --- a/exporter/apply_for_a_licence/forms/open_general_licences.py +++ b/exporter/apply_for_a_licence/forms/open_general_licences.py @@ -108,11 +108,11 @@ def open_general_licence_forms(request, **kwargs): ), questions=[ Label( - OpenGeneralLicenceQuestions.OpenGeneralLicences.DESCRIPTION.format( + "These are the {}s described by **{}** being exported to **{}**.".format( open_general_licence_type.name.lower(), selected_entry, selected_country ) ), - Label(OpenGeneralLicenceQuestions.OpenGeneralLicences.HELP_TEXT), + Label("Select the option which best matches your product and requirements."), RadioButtons( name="open_general_licence", options=[ diff --git a/exporter/compliance/forms.py b/exporter/compliance/forms.py index 45e81ca522..ac43ae1d90 100644 --- a/exporter/compliance/forms.py +++ b/exporter/compliance/forms.py @@ -60,7 +60,7 @@ def open_licence_return_form_group(): description="The file must be smaller than 1MB", questions=[ FileUpload(), - Label(OpenReturnsForm.Upload.ExampleTable.HEADING), + Label("

Your file needs to look like the following example

Save your file as a CSV"), Custom("components/spreadsheet.html"), ], default_button_name=OpenReturnsForm.Upload.BUTTON, diff --git a/lite_content/lite_exporter_frontend/compliance.py b/lite_content/lite_exporter_frontend/compliance.py index 15b99a32b1..a09f5de4d9 100644 --- a/lite_content/lite_exporter_frontend/compliance.py +++ b/lite_content/lite_exporter_frontend/compliance.py @@ -1,9 +1,9 @@ class OpenReturnsHelpPage: TITLE = "Before you start" BACK = "Back to hub" - DESCRIPTION = """Submit open licence returns using a CSV file that follows this [template and guidance](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/385687/14-1290-open-licence-returns.pdf).\n - You must submit open licence returns for:\n - - Open Individual Export Licences (OIELs)\n - Open Individual Trade Control Licences (OITCLs)\n - Open General Export Licences (OGELs)\n - Open General Trade Control Licences (OGTCLs) + DESCRIPTION = """Submit open licence returns using a CSV file that follows this [template and guidance](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/385687/14-1290-open-licence-returns.pdf).
+ You must submit open licence returns for:
+ - Open Individual Export Licences (OIELs)
- Open Individual Trade Control Licences (OITCLs)
- Open General Export Licences (OGELs)\n - Open General Trade Control Licences (OGTCLs) """ # noqa BUTTON = "Next" diff --git a/lite_content/lite_exporter_frontend/goods.py b/lite_content/lite_exporter_frontend/goods.py index bcd99c39a4..74fd0c26ed 100644 --- a/lite_content/lite_exporter_frontend/goods.py +++ b/lite_content/lite_exporter_frontend/goods.py @@ -115,12 +115,9 @@ class DocumentAvailabilityForm: class DocumentSensitivityForm: TITLE = "Is the document rated above OFFICIAL-SENSITIVE?" - ECJU_HELPLINE = ( - "****\n\nContact ECJU to arrange a more secure way to send " - "this document.\n\n You can continue with the application " - "without attaching a document.\n\n**ECJU helpline**\n 020 7215 4594\n " - "[Find out about call charges (opens in new tab)](https://www.gov.uk/call-charges)" - ) + ECJU_HELPLINE = """
Contact ECJU to arrange a more secure way to send this document.
You can continue with the application without attaching a document.
ECJU helpline
+ 020 7215 4594
Find out about call charges (opens in new tab) +""" SUBMIT_BUTTON = "Save and continue" class Options: diff --git a/lite_forms/components.py b/lite_forms/components.py index b98e421551..77dd66135b 100644 --- a/lite_forms/components.py +++ b/lite_forms/components.py @@ -111,10 +111,8 @@ def __init__( id: str = None, classes: Optional[List] = None, ): - from lite_forms.helpers import convert_to_markdown - self.id = id - self.text = convert_to_markdown(text) + self.text = text self.classes = classes self.input_type = "label" diff --git a/lite_forms/tests.py b/lite_forms/tests.py index c1a26b4e0c..9da4d7abfc 100644 --- a/lite_forms/tests.py +++ b/lite_forms/tests.py @@ -207,14 +207,6 @@ def test_generic_component(self): component = _Component(name="a", description=self.markdown_description) self.assertEqual(component.description, self.html_description) - def test_label(self): - label = Label(self.markdown_description) - self.assertEqual(label.text, self.html_description) - - def test_form(self): - form = Form(description=self.markdown_description) - self.assertEqual(form.description, self.html_description) - class SingleQuestionFormAccessibilityTest(TestCase): def test_no_questions_no_title_label(self): From d66c78e68d3b2eebfc6b92405d2ecd140a995773 Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Tue, 29 Oct 2024 19:55:04 +0000 Subject: [PATCH 08/13] remove markdown from component --- caseworker/letter_templates/forms.py | 10 ++--- caseworker/queues/forms.py | 4 +- caseworker/users/forms/roles.py | 8 ++-- caseworker/users/forms/users.py | 12 +++--- exporter/applications/forms/goods_types.py | 2 +- exporter/compliance/forms.py | 2 +- lite_forms/components.py | 47 +--------------------- lite_forms/tests.py | 15 ------- 8 files changed, 20 insertions(+), 80 deletions(-) diff --git a/caseworker/letter_templates/forms.py b/caseworker/letter_templates/forms.py index b8769e55c2..cc3779a484 100644 --- a/caseworker/letter_templates/forms.py +++ b/caseworker/letter_templates/forms.py @@ -141,25 +141,25 @@ def edit_letter_template(request, letter_template, case_type_options, decision_o title=strings.LetterTemplates.EditLetterTemplate.TITLE % letter_template["name"], questions=[ TextInput( - title=strings.LetterTemplates.EditLetterTemplate.Name.TITLE, + title="Give your template a name", description=EDIT_LETTER_TEMPLATE_HINT, name="name", ), Checkboxes( - title=strings.LetterTemplates.EditLetterTemplate.CaseTypes.TITLE, + title="When should someone use this template?", name="case_types[]", options=case_type_options, classes=["govuk-checkboxes--small"], ), Checkboxes( - title=strings.LetterTemplates.EditLetterTemplate.Decisions.TITLE, - description=strings.LetterTemplates.EditLetterTemplate.Decisions.DESCRIPTION, + title="Decisions (optional)", + description="Select the decisions that apply to your template", name="decisions[]", options=decision_options, classes=["govuk-checkboxes--small"], ), RadioButtonsImage( - title=strings.LetterTemplates.EditLetterTemplate.Layout.TITLE, + title="Choose a layout", name="layout", options=_letter_layout_options(request), ), diff --git a/caseworker/queues/forms.py b/caseworker/queues/forms.py index 624423a278..0b210b39c7 100644 --- a/caseworker/queues/forms.py +++ b/caseworker/queues/forms.py @@ -31,7 +31,7 @@ def new_queue_form(request): ), Select( title=AddQueueForm.CountersigningQueue.TITLE, - description=AddQueueForm.CountersigningQueue.DESCRIPTION, + description="", options=get_queues( request=request, disable_pagination=True, convert_to_options=True, users_team_first=True ), @@ -64,7 +64,7 @@ def edit_queue_form(request, queue_id): ), Select( title=EditQueueForm.CountersigningQueue.TITLE, - description=EditQueueForm.CountersigningQueue.DESCRIPTION, + description="", options=remove_current_queue_id( get_queues( request=request, disable_pagination=True, convert_to_options=True, users_team_first=True diff --git a/caseworker/users/forms/roles.py b/caseworker/users/forms/roles.py index c20ed484eb..3b436eb041 100644 --- a/caseworker/users/forms/roles.py +++ b/caseworker/users/forms/roles.py @@ -17,7 +17,7 @@ def add_role(request: HttpRequest): name="permissions[]", options=get_permissions(request, True), title=AddRoleForm.PERMISSION_CHECKBOXES_TITLE, - description=AddRoleForm.PERMISSION_CHECKBOXES_DESCRIPTION, + description="", optional=True, classes=["govuk-checkboxes--small"], ), @@ -25,7 +25,7 @@ def add_role(request: HttpRequest): name="statuses[]", options=get_statuses(request, True), title=AddRoleForm.STATUSES_CHECKBOXES_TITLE, - description=AddRoleForm.STATUSES_CHECKBOXES_DESCRIPTION, + description="", optional=True, classes=["govuk-checkboxes--small"], ), @@ -45,7 +45,7 @@ def edit_role(request: HttpRequest): name="permissions[]", options=get_permissions(request, True), title=EditRoleForm.PERMISSION_CHECKBOXES_TITLE, - description=EditRoleForm.PERMISSION_CHECKBOXES_DESCRIPTION, + description="", optional=True, classes=["govuk-checkboxes--small"], ), @@ -53,7 +53,7 @@ def edit_role(request: HttpRequest): name="statuses[]", options=get_statuses(request, True), title=AddRoleForm.STATUSES_CHECKBOXES_TITLE, - description=AddRoleForm.STATUSES_CHECKBOXES_DESCRIPTION, + description="", optional=True, classes=["govuk-checkboxes--small"], ), diff --git a/caseworker/users/forms/users.py b/caseworker/users/forms/users.py index c4a8d71ae5..7471839095 100644 --- a/caseworker/users/forms/users.py +++ b/caseworker/users/forms/users.py @@ -15,19 +15,19 @@ def add_user_form(request): TextInput(title=AddUserForm.Email.TITLE, description=AddUserForm.Email.DESCRIPTION, name="email"), Select( title=AddUserForm.Team.TITLE, - description=AddUserForm.Team.DESCRIPTION, + description="", name="team", options=get_teams(request, True), ), Select( title=AddUserForm.Role.TITLE, - description=AddUserForm.Role.DESCRIPTION, + description="", name="role", options=get_roles(request, True), ), Select( title=AddUserForm.DefaultQueue.TITLE, - description=AddUserForm.DefaultQueue.DESCRIPTION, + description="", name="default_queue", options=get_queues(request, include_system=True, convert_to_options=True), ), @@ -46,7 +46,7 @@ def edit_user_form(request, user, can_edit_role: bool, can_edit_team: bool): can_edit_team, Select( title=EditUserForm.Team.TITLE, - description=EditUserForm.Team.DESCRIPTION, + description="", name="team", options=get_teams(request, True), ), @@ -55,14 +55,14 @@ def edit_user_form(request, user, can_edit_role: bool, can_edit_team: bool): can_edit_role, Select( title=EditUserForm.Role.TITLE, - description=EditUserForm.Role.DESCRIPTION, + description="", name="role", options=get_roles(request, True), ), ), Select( title=EditUserForm.DefaultQueue.TITLE, - description=EditUserForm.DefaultQueue.DESCRIPTION, + description="", name="default_queue", options=get_queues(request, include_system=True, convert_to_options=True), ), diff --git a/exporter/applications/forms/goods_types.py b/exporter/applications/forms/goods_types.py index 069506432e..140b6cc532 100644 --- a/exporter/applications/forms/goods_types.py +++ b/exporter/applications/forms/goods_types.py @@ -43,7 +43,7 @@ def goods_type_form(request, application_type: str): ), RadioButtons( title=CreateGoodsTypeForm.IsIncorporated.TITLE, - description=CreateGoodsTypeForm.IsIncorporated.DESCRIPTION, + description="", name="is_good_incorporated", options=[ Option(key=True, value=CreateGoodsTypeForm.IsIncorporated.YES), diff --git a/exporter/compliance/forms.py b/exporter/compliance/forms.py index ac43ae1d90..579c721476 100644 --- a/exporter/compliance/forms.py +++ b/exporter/compliance/forms.py @@ -48,7 +48,7 @@ def open_licence_return_form_group(): questions=[ Select( title=OpenReturnsForm.Year.FIELD_TITLE, - description=OpenReturnsForm.Year.FIELD_DESCRIPTION, + description="", name="year", options=get_years(), ) diff --git a/lite_forms/components.py b/lite_forms/components.py index 77dd66135b..82f7048bff 100644 --- a/lite_forms/components.py +++ b/lite_forms/components.py @@ -22,11 +22,9 @@ def __init__( classes: Optional[List] = None, extras=None, ): - from lite_forms.helpers import convert_to_markdown - self.name = name self.title = title - self.description = convert_to_markdown(description) + self.description = description self.short_title = short_title or title self.accessible_description = accessible_description self.optional = optional @@ -130,21 +128,6 @@ def __init__( self.input_type = "label" -class GroupWithLabel(_Component): - def __init__( - self, - text: str = None, - id: str = None, - components: Optional[List] = None, - classes: Optional[List] = None, - ): - super().__init__(text, classes) - self.id = id - self.components = [EmptyLabel()] + components - self.classes = classes - self.input_type = "group" - - class Form: def __init__( self, @@ -255,34 +238,6 @@ def __init__( self.input_type = "email_input" -class NumberInput(_Component): - def __init__( - self, - name: str, - title: str = "", - description: str = "", - accessible_description: str = None, - optional: bool = False, - classes: Optional[List] = None, - ): - super().__init__(name, title, description, accessible_description, optional, classes) - self.input_type = "number_input" - - -class QuantityInput(_Component): - def __init__( - self, - name: str, - title: str = "", - description: str = "", - accessible_description: str = None, - optional: bool = False, - classes: Optional[List] = None, - ): - super().__init__(name, title, description, accessible_description, optional, classes) - self.input_type = "quantity_input" - - class CurrencyInput(_Component): def __init__( self, diff --git a/lite_forms/tests.py b/lite_forms/tests.py index 9da4d7abfc..1b67988deb 100644 --- a/lite_forms/tests.py +++ b/lite_forms/tests.py @@ -8,7 +8,6 @@ DetailComponent, TextInput, FormGroup, - _Component, Label, Option, BackLink, @@ -194,20 +193,6 @@ def test_prefix_dots(self): self.assertEqual(r"\\.all\\.the\\.dots\\.", prefix_dots(".all.the.dots.")) -class MarkdownTest(TestCase): - def setUp(self): - super().setUp() - self.markdown_description = "Please **Click** this [link](https://www.gov.uk/)" - self.html_description = ( - 'Please Click this link' - ) - - def test_generic_component(self): - component = _Component(name="a", description=self.markdown_description) - self.assertEqual(component.description, self.html_description) - - class SingleQuestionFormAccessibilityTest(TestCase): def test_no_questions_no_title_label(self): form = Form() From e5d58be3e786ce5c5630457f999a53a9b2003c73 Mon Sep 17 00:00:00 2001 From: Gurdeep Atwal Date: Wed, 30 Oct 2024 09:18:54 +0000 Subject: [PATCH 09/13] lint fixes and removed mark_down method --- exporter/applications/forms/questions.py | 6 ++- .../forms/trade_control_licence.py | 19 ++++++--- .../forms/triage_questions.py | 6 ++- exporter/compliance/forms.py | 41 ++++++++++--------- exporter/goods/forms/goods.py | 15 +++++-- .../lite_exporter_frontend/applications.py | 2 +- .../lite_exporter_frontend/compliance.py | 10 +++-- lite_content/lite_exporter_frontend/goods.py | 25 +++++++---- lite_forms/helpers.py | 15 ------- lite_forms/tests.py | 3 +- .../exporter/applications/test_components.py | 12 ++++++ 11 files changed, 91 insertions(+), 63 deletions(-) create mode 100644 unit_tests/exporter/applications/test_components.py diff --git a/exporter/applications/forms/questions.py b/exporter/applications/forms/questions.py index 02e7a0fd8c..a7be9cbcf7 100644 --- a/exporter/applications/forms/questions.py +++ b/exporter/applications/forms/questions.py @@ -130,8 +130,10 @@ def electronic_warfare_form(): value="Yes", components=[ Label( - text="""You need to complete part A of the MOD EW Data Release Capture Form - and attach it to the application in the supporting documents section.""" + text=( + "You need to complete part A of the MOD EW Data Release Capture" + " Form and attach it to the application in the supporting documents section." + ) ) ], ), diff --git a/exporter/apply_for_a_licence/forms/trade_control_licence.py b/exporter/apply_for_a_licence/forms/trade_control_licence.py index 9ba89d7d7c..b7bfed0758 100644 --- a/exporter/apply_for_a_licence/forms/trade_control_licence.py +++ b/exporter/apply_for_a_licence/forms/trade_control_licence.py @@ -18,8 +18,10 @@ def application_type_form(): Option( key=CaseTypes.OGTCL, value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_GENERAL_TRADE_CONTROL_LICENCE, - description="""Select to register a pre-published licence with set terms and conditions. Being an OGTCL holder can benefit your - business by saving time and money.""", + description=( + "Select to register a pre-published licence with set terms and conditions. " + "Being an OGTCL holder can benefit your business by saving time and money." + ), ), Option( key=CaseTypes.SICL, @@ -29,8 +31,10 @@ def application_type_form(): Option( key=CaseTypes.OICL, value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_LICENCE, - description="""Select an open licence for multiple shipments of specific products to specific destinations. - Open licences cover long term projects and repeat business.""", + description=( + "Select an open licence for multiple shipments of specific products to specific destinations. " + "Open licences cover long term projects and repeat business." + ), ), ], ) @@ -77,7 +81,12 @@ def product_category_form(request): "category_b": TradeControlLicenceQuestions.ProductCategory.CATEGORY_B_HINT, "category_c": TradeControlLicenceQuestions.ProductCategory.CATEGORY_C_HINT, } - PRODUCT_CATEGORY_DESCRIPTION = """Find out about trade control product categories.""" + guidence_url = "https://www.gov.uk/guidance/export-controls-military-goods-software-and-technology#trade-controls-and-arranging-sales-or-movements" + PRODUCT_CATEGORY_DESCRIPTION = ( + 'Find out about ' + "trade control product categories." + ) options = [ Option(product_category["key"], product_category["value"], hint_text_map.get(product_category["key"])) diff --git a/exporter/apply_for_a_licence/forms/triage_questions.py b/exporter/apply_for_a_licence/forms/triage_questions.py index 7b7548ee88..6db4c7e9c9 100644 --- a/exporter/apply_for_a_licence/forms/triage_questions.py +++ b/exporter/apply_for_a_licence/forms/triage_questions.py @@ -226,8 +226,10 @@ def transhipment_questions(request): Option( key=CaseTypes.OGTL, value=TranshipmentQuestions.TranshipmentLicenceQuestion.OPEN_GENERAL_TRANSHIPMENT_LICENCE, - description="""Select to register a pre-published licence with set terms and conditions. Being an OGTL holder can benefit your - business by saving time and money. """, + description=( + "Select to register a pre-published licence with set terms and conditions. Being an OGTL holder can benefit your " + "business by saving time and money." + ), ), Option( key=CaseTypes.SITL, diff --git a/exporter/compliance/forms.py b/exporter/compliance/forms.py index 579c721476..3f2fc89d6d 100644 --- a/exporter/compliance/forms.py +++ b/exporter/compliance/forms.py @@ -12,25 +12,28 @@ def get_years(): def open_licence_return_form_group(): - FORMATTING_HELP_DETAILS = """ - The first row must contain column headers, or be blank. It must not contain returns data.
Columns must start from column A and be in the following order:
    -
  • Licence number
  • -
  • Destination
  • -
  • End user type
  • -
  • Usage count
  • -
  • Period
  • -

Licence number must be in one of the following formats:
    -
  • GBOXX20XX/XXXXX. For example GBOIE2020/00001)
  • -
  • GBOXX20XX/XXXXX/X for amended licences. For example GBOIE2020/00001/A
  • -

Destination names must be entered exactly as they appear on the licence.

End user type must be one of the following, entered exactly as shown here:
    -
  • Government
  • -
  • Commercial
  • -
  • Pvt Indiv
  • -
  • Other
  • -

Usage count must be a positive integer.

Period must be in the following format, entered exactly as shown with YY replaced with the last 2 digits of the year:
    -
  • 01-JAN-YY to 31-DEC-YY
  • -
- """ + FORMATTING_HELP_DETAILS = ( + "The first row must contain column headers, or be blank." + "It must not contain returns data.
Columns must start from column A and be in the following order:
    " + "
  • Licence number
  • " + "
  • Destination
  • " + "
  • End user type
  • " + "
  • Usage count
  • " + "
  • Period
  • " + "

Licence number must be in one of the following formats:
    " + "
  • GBOXX20XX/XXXXX. For example GBOIE2020/00001)
  • " + "
  • GBOXX20XX/XXXXX/X for amended licences. For example GBOIE2020/00001/A
  • " + "

Destination names must be entered exactly as they appear on the licence." + "

End user type must be one of the following, entered exactly as shown here:
    " + "
  • Government
  • " + "
  • Commercial
  • " + "
  • Pvt Indiv
  • " + "
  • Other
  • " + "

Usage count must be a positive integer." + "

Period must be in the following format, entered exactly as shown with YY replaced with the last 2 digits of the year:
    " + "
  • 01-JAN-YY to 31-DEC-YY
  • " + "
" + ) return FormGroup( [ Form( diff --git a/exporter/goods/forms/goods.py b/exporter/goods/forms/goods.py index 2524908872..e94f69cbbf 100644 --- a/exporter/goods/forms/goods.py +++ b/exporter/goods/forms/goods.py @@ -52,7 +52,6 @@ TextArea, TextInput, ) -from lite_forms.helpers import convert_to_markdown from lite_forms.styles import ButtonStyle, HeadingStyle @@ -149,7 +148,11 @@ def edit_good_detail_form(request, good_id): def check_document_available_form(back_url): - DESCRIPTION = """For example, a technical specification, datasheet, sales brochure or something else that fully describes the product details.
This is required in order to process the application.""" + DESCRIPTION = ( + "For example, a technical specification, datasheet, " + "sales brochure or something else that fully describes the product details." + "
This is required in order to process the application." + ) return Form( title=DocumentAvailabilityForm.TITLE, @@ -204,7 +207,11 @@ def document_grading_form(back_url): def attach_documents_form(back_link): - DESCRIPTION = """Upload a DOCX, DOC, PDF, PNG, JPEG or ODT file.
Documentation could be specifications, datasheets, sales brochures, drawings or anything else that fully details what the product is and what it's designed to do.
Do not attach a document that’s above OFFICIAL-SENSITIVE.
The file must be smaller than 50MB.""" + DESCRIPTION = ( + "Upload a DOCX, DOC, PDF, PNG, JPEG or ODT file.
Documentation could be specifications, datasheets, " + "sales brochures, drawings or anything else that fully details what the product is and what it's designed to do." + "
Do not attach a document that’s above OFFICIAL-SENSITIVE.
The file must be smaller than 50MB." + ) return Form( title=AttachDocumentForm.TITLE, @@ -810,7 +817,7 @@ class AddGoodsQuestionsForm(forms.Form): (False, CreateGoodForm.IsControlled.NO), ), label=CreateGoodForm.IsControlled.TITLE, - help_text=convert_to_markdown(CreateGoodForm.IsControlled.DESCRIPTION), + help_text=CreateGoodForm.IsControlled.DESCRIPTION, ) control_list_entries = forms.MultipleChoiceField( diff --git a/lite_content/lite_exporter_frontend/applications.py b/lite_content/lite_exporter_frontend/applications.py index 01bebbdccb..88d3d6c9f2 100644 --- a/lite_content/lite_exporter_frontend/applications.py +++ b/lite_content/lite_exporter_frontend/applications.py @@ -223,7 +223,7 @@ class ReferenceNameQuestion: class ExportLicenceQuestions: class HaveYouBeenInformedQuestion: TITLE = "Have you received a letter or email from Border Force or HMRC informing you to apply for a licence?" - DESCRIPTION = "Give the application a reference name so you can refer back to it when needed." + DESCRIPTION = "You may know this as an 'end use control'." WHAT_WAS_THE_REFERENCE_CODE_TITLE = "Reference number" WHAT_WAS_THE_REFERENCE_CODE_DESCRIPTION = ( "For example, CRE/2020/1234567. The reference number is on the letter or email." diff --git a/lite_content/lite_exporter_frontend/compliance.py b/lite_content/lite_exporter_frontend/compliance.py index a09f5de4d9..e766416228 100644 --- a/lite_content/lite_exporter_frontend/compliance.py +++ b/lite_content/lite_exporter_frontend/compliance.py @@ -1,10 +1,12 @@ class OpenReturnsHelpPage: TITLE = "Before you start" BACK = "Back to hub" - DESCRIPTION = """Submit open licence returns using a CSV file that follows this [template and guidance](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/385687/14-1290-open-licence-returns.pdf).
- You must submit open licence returns for:
- - Open Individual Export Licences (OIELs)
- Open Individual Trade Control Licences (OITCLs)
- Open General Export Licences (OGELs)\n - Open General Trade Control Licences (OGTCLs) - """ # noqa + DESCRIPTION = ( + "Submit open licence returns using a CSV file that follows this [template and guidance]" + "(https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/385687/14-1290-open-licence-returns.pdf).
" + " You must submit open licence returns for:
- Open Individual Export Licences (OIELs)
" + "- Open Individual Trade Control Licences (OITCLs)
- Open General Export Licences (OGELs)
- Open General Trade Control Licences (OGTCLs)" + ) BUTTON = "Next" diff --git a/lite_content/lite_exporter_frontend/goods.py b/lite_content/lite_exporter_frontend/goods.py index 74fd0c26ed..ca7ecf9381 100644 --- a/lite_content/lite_exporter_frontend/goods.py +++ b/lite_content/lite_exporter_frontend/goods.py @@ -115,9 +115,12 @@ class DocumentAvailabilityForm: class DocumentSensitivityForm: TITLE = "Is the document rated above OFFICIAL-SENSITIVE?" - ECJU_HELPLINE = """
Contact ECJU to arrange a more secure way to send this document.
You can continue with the application without attaching a document.
ECJU helpline
- 020 7215 4594
Find out about call charges (opens in new tab) -""" + ECJU_HELPLINE = """ +
Contact ECJU to arrange a more secure way to send this document. +
You can continue with the application without attaching a document. +
ECJU helpline
020 7215 4594
+ + Find out about call charges (opens in new tab)""" SUBMIT_BUTTON = "Save and continue" class Options: @@ -141,12 +144,16 @@ class Description: class IsControlled: TITLE = "Is the product on the control list?" DESCRIPTION = ( - "Products that aren't on the " + PERMISSION_FINDER_LINK + " may be affected by [military end use controls]" - "(https://www.gov.uk/guidance/export-controls-military-goods-software-and-technology), " - "[current trade sanctions and embargoes]" - "(https://www.gov.uk/guidance/current-arms-embargoes-and-other-restrictions) or " - "[weapons of mass destruction controls](https://www.gov.uk/guidance/supplementary-wmd-end-use-controls). " - "If the product isn't subject to any controls, you'll get a no licence required (NLR) document from ECJU." + 'Products that aren\'t on the control list' + 'may be affected by ' + 'military end use controls, ' + 'current trade sanctions and embargoes or ' + "weapons of mass destruction controls. If the product isn't subject to any controls, " + "you'll get a no licence required (NLR) document from ECJU." ) CLC_REQUIRED = ( "Products that aren't on the " + PERMISSION_FINDER_LINK + " may be affected by [military end use controls]" diff --git a/lite_forms/helpers.py b/lite_forms/helpers.py index c77acc4075..de45874013 100644 --- a/lite_forms/helpers.py +++ b/lite_forms/helpers.py @@ -1,7 +1,6 @@ import copy from collections.abc import MutableMapping -from markdown import markdown from lite_forms.components import FormGroup, Form, HiddenField, TreeNode @@ -155,20 +154,6 @@ def heading_used_as_label(components): return single_input -def convert_to_markdown(text): - if text: - text = "
".join([markdown(item.strip(), extensions=["nl2br"]) for item in text.split("\n\n")]) - # Replace leading (

) & trailing (

) p tags as they are not needed - text = text.replace("

", "") - text = text.replace("

", "") - text = text.replace( - "' + "return to application overview" + ) == lbl.text From 308f9678a4fec5378e1ccc6eebb079e3df92455a Mon Sep 17 00:00:00 2001 From: Kevin Carrogan Date: Mon, 4 Nov 2024 10:04:58 +0000 Subject: [PATCH 10/13] Remove trade control related code --- .../forms/open_general_licences.py | 2 - .../forms/trade_control_licence.py | 100 ------------------ .../forms/triage_questions.py | 18 ---- exporter/apply_for_a_licence/urls.py | 1 - exporter/apply_for_a_licence/views.py | 14 --- .../lite_exporter_frontend/applications.py | 48 --------- .../exporter/apply_for_a_licence/test_urls.py | 2 - 7 files changed, 185 deletions(-) delete mode 100644 exporter/apply_for_a_licence/forms/trade_control_licence.py diff --git a/exporter/apply_for_a_licence/forms/open_general_licences.py b/exporter/apply_for_a_licence/forms/open_general_licences.py index 0c3b528582..c47781b013 100644 --- a/exporter/apply_for_a_licence/forms/open_general_licences.py +++ b/exporter/apply_for_a_licence/forms/open_general_licences.py @@ -81,8 +81,6 @@ def open_general_licence_forms(request, **kwargs): back_link_url = reverse("apply_for_a_licence:export_licence_questions") elif open_general_licence_type.acronym == OpenGeneralExportLicenceTypes.open_general_transhipment_licence.acronym: back_link_url = reverse("apply_for_a_licence:transhipment_questions") - else: - back_link_url = reverse("apply_for_a_licence:trade_control_licence_questions") return FormGroup( [ diff --git a/exporter/apply_for_a_licence/forms/trade_control_licence.py b/exporter/apply_for_a_licence/forms/trade_control_licence.py deleted file mode 100644 index b7bfed0758..0000000000 --- a/exporter/apply_for_a_licence/forms/trade_control_licence.py +++ /dev/null @@ -1,100 +0,0 @@ -from django.urls import reverse_lazy - -from exporter.core.constants import CaseTypes -from exporter.core.services import get_trade_control_activities, get_trade_control_product_categories -from lite_content.lite_exporter_frontend import generic -from lite_content.lite_exporter_frontend.applications import TradeControlLicenceQuestions -from lite_forms.components import Form, RadioButtons, Option, BackLink, TextArea, Checkboxes - - -def application_type_form(): - return Form( - title=TradeControlLicenceQuestions.TradeControlLicenceQuestion.TITLE, - description="", - questions=[ - RadioButtons( - name="application_type", - options=[ - Option( - key=CaseTypes.OGTCL, - value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_GENERAL_TRADE_CONTROL_LICENCE, - description=( - "Select to register a pre-published licence with set terms and conditions. " - "Being an OGTCL holder can benefit your business by saving time and money." - ), - ), - Option( - key=CaseTypes.SICL, - value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.STANDARD_LICENCE, - description="Select a standard licence for a set quantity and set value of products.", - ), - Option( - key=CaseTypes.OICL, - value=TradeControlLicenceQuestions.TradeControlLicenceQuestion.OPEN_LICENCE, - description=( - "Select an open licence for multiple shipments of specific products to specific destinations. " - "Open licences cover long term projects and repeat business." - ), - ), - ], - ) - ], - default_button_name=generic.CONTINUE, - back_link=BackLink( - TradeControlLicenceQuestions.TradeControlLicenceQuestion.BACK, reverse_lazy("apply_for_a_licence:start") - ), - ) - - -def activity_form(request): - activities = get_trade_control_activities(request) - options = [] - - for activity in activities: - option = Option(activity["key"], activity["value"]) - - if activity["key"] == "other": - option.components = [ - TextArea( - title=TradeControlLicenceQuestions.ControlActivity.OTHER_DESCRIPTION, - name="trade_control_activity_other", - optional=False, - rows=1, - extras={"max_length": 100}, - ) - ] - - options.append(option) - - return Form( - title=TradeControlLicenceQuestions.ControlActivity.TITLE, - description="", - questions=[RadioButtons(name="trade_control_activity", options=options)], - default_button_name=generic.CONTINUE, - ) - - -def product_category_form(request): - product_categories = get_trade_control_product_categories(request) - hint_text_map = { - "category_a": TradeControlLicenceQuestions.ProductCategory.CATEGORY_A_HINT, - "category_b": TradeControlLicenceQuestions.ProductCategory.CATEGORY_B_HINT, - "category_c": TradeControlLicenceQuestions.ProductCategory.CATEGORY_C_HINT, - } - guidence_url = "https://www.gov.uk/guidance/export-controls-military-goods-software-and-technology#trade-controls-and-arranging-sales-or-movements" - PRODUCT_CATEGORY_DESCRIPTION = ( - 'Find out about ' - "trade control product categories." - ) - - options = [ - Option(product_category["key"], product_category["value"], hint_text_map.get(product_category["key"])) - for product_category in product_categories - ] - return Form( - title=TradeControlLicenceQuestions.ProductCategory.TITLE, - description=PRODUCT_CATEGORY_DESCRIPTION, - questions=[Checkboxes(name="trade_control_product_categories[]", options=options)], - default_button_name=generic.SAVE_AND_CONTINUE, - ) diff --git a/exporter/apply_for_a_licence/forms/triage_questions.py b/exporter/apply_for_a_licence/forms/triage_questions.py index 6db4c7e9c9..ca59916011 100644 --- a/exporter/apply_for_a_licence/forms/triage_questions.py +++ b/exporter/apply_for_a_licence/forms/triage_questions.py @@ -2,11 +2,6 @@ from django.conf import settings from exporter.applications.forms.edit import firearms_form, reference_name_form, told_by_an_official_form -from exporter.apply_for_a_licence.forms.trade_control_licence import ( - application_type_form, - activity_form, - product_category_form, -) from core.constants import GoodsTypeCategory from exporter.core.constants import CaseTypes from lite_content.lite_exporter_frontend import generic @@ -200,19 +195,6 @@ def goodstype_category_form(application_id=None): ) -def trade_control_licence_questions(request): - return FormGroup( - [ - application_type_form(), - *conditional( - request.POST.get("application_type") != CaseTypes.OGTCL, - [reference_name_form(), activity_form(request), product_category_form(request)], - [], - ), - ] - ) - - def transhipment_questions(request): return FormGroup( [ diff --git a/exporter/apply_for_a_licence/urls.py b/exporter/apply_for_a_licence/urls.py index 474f9deb68..4c6d51edf2 100644 --- a/exporter/apply_for_a_licence/urls.py +++ b/exporter/apply_for_a_licence/urls.py @@ -13,7 +13,6 @@ if not settings.FEATURE_FLAG_ONLY_ALLOW_SIEL: urlpatterns += [ - path("trade-control/", views.TradeControlLicenceQuestions.as_view(), name="trade_control_licence_questions"), path("transhipment/", views.TranshipmentQuestions.as_view(), name="transhipment_questions"), path("mod/", views.MODClearanceQuestions.as_view(), name="mod_questions"), path("/", views.OpenGeneralLicenceQuestions.as_view(), name="ogl_questions"), diff --git a/exporter/apply_for_a_licence/views.py b/exporter/apply_for_a_licence/views.py index d641eb6d49..bf71d3098d 100644 --- a/exporter/apply_for_a_licence/views.py +++ b/exporter/apply_for_a_licence/views.py @@ -12,7 +12,6 @@ export_licence_questions, MOD_questions, transhipment_questions, - trade_control_licence_questions, ) from exporter.apply_for_a_licence.validators import validate_opening_question, validate_open_general_licences from exporter.core.constants import PERMANENT, CaseTypes @@ -56,19 +55,6 @@ def get_success_url(self): return reverse_lazy("applications:task_list", kwargs={"pk": pk}) -class TradeControlLicenceQuestions(LoginRequiredMixin, MultiFormView): - def init(self, request, **kwargs): - self.forms = trade_control_licence_questions(request) - self.action = post_applications - - def get_success_url(self): - if self.request.POST.get("application_type") == CaseTypes.OGTCL: - return reverse_lazy("apply_for_a_licence:ogl_questions", kwargs={"ogl": CaseTypes.OGTCL}) - else: - pk = self.get_validated_data()["id"] - return reverse_lazy("applications:task_list", kwargs={"pk": pk}) - - class TranshipmentQuestions(LoginRequiredMixin, MultiFormView): def init(self, request, **kwargs): self.forms = transhipment_questions(request) diff --git a/lite_content/lite_exporter_frontend/applications.py b/lite_content/lite_exporter_frontend/applications.py index 88d3d6c9f2..890e5f6fee 100644 --- a/lite_content/lite_exporter_frontend/applications.py +++ b/lite_content/lite_exporter_frontend/applications.py @@ -293,54 +293,6 @@ class NoOpenGeneralLicencesAvailable: RETURN_TO_ACCOUNT_HOME_LINK = "Return to account home" -class TradeControlLicenceQuestions: - class TradeControlLicenceQuestion: - TITLE = "Select the type of trade control licence you need" - DESCRIPTION = "" - BACK = "Back" - OPEN_GENERAL_TRADE_CONTROL_LICENCE = "Open General Trade Control Licence (OGTCL)" - STANDARD_LICENCE = "Standard licence" - OPEN_LICENCE = "Open licence" - - class ControlActivity: - TITLE = "Select the type of trade control activity you're providing" - DESCRIPTION = "" - OTHER_DESCRIPTION = "Provide details" - - class ProductCategory: - TITLE = "Select a trade control product category" - DESCRIPTION = ( - "Find out about [trade control product categories](" - "https://www.gov.uk/guidance/export-controls-military-goods-software-and-technology#trade" - "-controls-and-arranging-sales-or-movements)." - ) - CATEGORY_A_HINT = ( - "Category A products are specified in [Part 1 of Schedule 1 of the Export Control Order 2008, as amended](" - "http://www.legislation.gov.uk/uksi/2008/3231/schedule/1/made).\n" - "Certain security and paramilitary police equipment, restraints specially designed for restraining human " - "beings, and portable devices designed or modified for the purpose of riot control or self-protection by " - "the administration of an electric shock and components specially designed or modified for the devices " - "mentioned above and handheld, spiked batons and cluster munitions, explosive submunitions and explosive " - "bomblets." - ) - CATEGORY_B_HINT = ( - "Category B products are specified in [Part 2 of Schedule 1 of the Export Control Order 2008, as amended](" - "http://www.legislation.gov.uk/uksi/2014/702/article/2/made).\n" - "Small arms and light weapons within ML1 and ML2. Accessories and ammunition for small arms and light " - "weapons within ML1 and ML2. Light weapons within ML4. Ammunition for light weapons within ML4. Hand " - "grenades. Man-portable air defence systems (MANPADS) missiles for them, associated equipment and their " - "specially designed components, long-range missiles. Anti-vehicle landmines. Components for Category B " - "products." - ) - CATEGORY_C_HINT = ( - "Category C products are all other military products not specified in Schedule 1 of the Export Control " - "Order 2008, as amended.\n" - "Military products not otherwise specified. Portable devices for the purpose of riot control or " - "self-protection by the administration or dissemination of an incapacitating chemical substance. Pelargonic " - "acid vanillylamide and oleoresin capsicum." - ) - - class TranshipmentQuestions: class TranshipmentLicenceQuestion: TITLE = "Select the type of transhipment licence you need" diff --git a/unit_tests/exporter/apply_for_a_licence/test_urls.py b/unit_tests/exporter/apply_for_a_licence/test_urls.py index d090c8836b..81ceb10982 100644 --- a/unit_tests/exporter/apply_for_a_licence/test_urls.py +++ b/unit_tests/exporter/apply_for_a_licence/test_urls.py @@ -21,7 +21,6 @@ def test_url_respects_feature_flag_off(settings): # but non SIEL urls are not found with pytest.raises(NoReverseMatch): - reverse("apply_for_a_licence:trade_control_licence_questions") reverse("apply_for_a_licence:transhipment_questions") reverse("apply_for_a_licence:mod_questions") reverse("apply_for_a_licence:ogl_questions", kwargs={"ogl": "foo"}) @@ -40,7 +39,6 @@ def test_url_respects_feature_flag_on(settings): reverse("apply_for_a_licence:export_licence_questions") # and non SIEL urls are not found - reverse("apply_for_a_licence:trade_control_licence_questions") reverse("apply_for_a_licence:transhipment_questions") reverse("apply_for_a_licence:mod_questions") reverse("apply_for_a_licence:ogl_questions", kwargs={"ogl": "foo"}) From e43f36122f372f58270039472800a7b7a52a0a53 Mon Sep 17 00:00:00 2001 From: Kevin Carrogan Date: Mon, 4 Nov 2024 10:14:53 +0000 Subject: [PATCH 11/13] Remove compiance --- exporter/compliance/__init__.py | 0 exporter/compliance/forms.py | 72 ----------------- exporter/compliance/services.py | 67 ---------------- exporter/compliance/urls.py | 27 ------- exporter/compliance/views.py | 134 ------------------------------- exporter/urls.py | 8 -- unit_tests/exporter/test_urls.py | 41 ---------- 7 files changed, 349 deletions(-) delete mode 100644 exporter/compliance/__init__.py delete mode 100644 exporter/compliance/forms.py delete mode 100644 exporter/compliance/services.py delete mode 100644 exporter/compliance/urls.py delete mode 100644 exporter/compliance/views.py delete mode 100644 unit_tests/exporter/test_urls.py diff --git a/exporter/compliance/__init__.py b/exporter/compliance/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/exporter/compliance/forms.py b/exporter/compliance/forms.py deleted file mode 100644 index 3f2fc89d6d..0000000000 --- a/exporter/compliance/forms.py +++ /dev/null @@ -1,72 +0,0 @@ -from django.urls import reverse_lazy - -from lite_content.lite_exporter_frontend.compliance import OpenReturnsForm, OpenReturnsHelpPage -from lite_forms.components import FormGroup, Form, Select, Option, FileUpload, Label, DetailComponent, BackLink, Custom -from django.utils import timezone - - -def get_years(): - current_year = timezone.localtime().year - previous_year = current_year - 1 - return [Option(key=current_year, value=current_year), Option(key=previous_year, value=previous_year)] - - -def open_licence_return_form_group(): - FORMATTING_HELP_DETAILS = ( - "The first row must contain column headers, or be blank." - "It must not contain returns data.
Columns must start from column A and be in the following order:
    " - "
  • Licence number
  • " - "
  • Destination
  • " - "
  • End user type
  • " - "
  • Usage count
  • " - "
  • Period
  • " - "

Licence number must be in one of the following formats:
    " - "
  • GBOXX20XX/XXXXX. For example GBOIE2020/00001)
  • " - "
  • GBOXX20XX/XXXXX/X for amended licences. For example GBOIE2020/00001/A
  • " - "

Destination names must be entered exactly as they appear on the licence." - "

End user type must be one of the following, entered exactly as shown here:
    " - "
  • Government
  • " - "
  • Commercial
  • " - "
  • Pvt Indiv
  • " - "
  • Other
  • " - "

Usage count must be a positive integer." - "

Period must be in the following format, entered exactly as shown with YY replaced with the last 2 digits of the year:
    " - "
  • 01-JAN-YY to 31-DEC-YY
  • " - "
" - ) - return FormGroup( - [ - Form( - title=OpenReturnsHelpPage.TITLE, - questions=[ - Label(OpenReturnsHelpPage.DESCRIPTION), - DetailComponent("Format your open licence returns CSV", FORMATTING_HELP_DETAILS), - ], - default_button_name=OpenReturnsHelpPage.BUTTON, - back_link=BackLink(OpenReturnsHelpPage.BACK, reverse_lazy("core:home")), - ), - Form( - title=OpenReturnsForm.Year.TITLE, - description="", - questions=[ - Select( - title=OpenReturnsForm.Year.FIELD_TITLE, - description="", - name="year", - options=get_years(), - ) - ], - default_button_name=OpenReturnsForm.Year.BUTTON, - ), - Form( - title=OpenReturnsForm.Upload.TITLE, - description="The file must be smaller than 1MB", - questions=[ - FileUpload(), - Label("

Your file needs to look like the following example

Save your file as a CSV"), - Custom("components/spreadsheet.html"), - ], - default_button_name=OpenReturnsForm.Upload.BUTTON, - ), - ] - ) diff --git a/exporter/compliance/services.py b/exporter/compliance/services.py deleted file mode 100644 index 510f93b7f2..0000000000 --- a/exporter/compliance/services.py +++ /dev/null @@ -1,67 +0,0 @@ -from http import HTTPStatus - -from django.http import HttpResponse - -from core import client -from core.helpers import convert_parameters_to_query_params -from lite_content.lite_exporter_frontend.compliance import OpenReturnsForm -from exporter.core import constants - - -FILENAME = "OpenLicenceReturns.csv" - - -def get_compliance_list(request): - data = client.get(request, f"/compliance/exporter/?page={request.GET.get('page', 1)}") - return data.json() - - -def get_compliance_detail(request, pk): - data = client.get(request, f"/compliance/exporter/{pk}/") - return data.json() - - -def get_case_visit_reports(request, pk, page=1): - querystring = convert_parameters_to_query_params({"pk": pk, "page": page}) - data = client.get(request, f"/compliance/exporter/{pk}/visits/{querystring}") - return data.json() - - -def get_case_visit_report(request, pk): - data = client.get(request, f"/compliance/exporter/visits/{pk}/") - return data.json() - - -def get_open_licence_returns(request): - page = request.GET.get("page", 1) - data = client.get(request, f"/compliance/open-licence-returns/?page={page}") - return data.json() - - -def get_open_licence_return_download(request, pk): - data = client.get(request, f"/compliance/open-licence-returns/{pk}/") - open_licence_returns = data.json() - response = HttpResponse("\n" + open_licence_returns["returns_data"], content_type="text/csv") - response["Content-Disposition"] = f'attachment; filename="{open_licence_returns["year"]}{FILENAME}"' - return response - - -def post_open_licence_return(request, json): - if not json.get("year"): - return {"errors": {"year": [OpenReturnsForm.Year.ERROR]}}, HTTPStatus.BAD_REQUEST - - if len(request.FILES) == 0: - return {"errors": {"file": [OpenReturnsForm.Upload.NO_FILE_ERROR]}}, HTTPStatus.BAD_REQUEST - if len(request.FILES) != 1: - return {"errors": {"file": [OpenReturnsForm.Upload.MULTIPLE_FILES_ERROR]}}, HTTPStatus.BAD_REQUEST - if request.FILES["file"].size > constants.MAX_OPEN_LICENCE_RETURNS_FILE_SIZE: - return {"errors": {"file": [OpenReturnsForm.Upload.SIZE_ERROR]}}, HTTPStatus.BAD_REQUEST - - try: - file = request.FILES.pop("file")[0] - json["file"] = file.read().decode("utf-8") - except Exception: # noqa - return {"errors": {"file": [OpenReturnsForm.Upload.READ_ERROR]}}, HTTPStatus.BAD_REQUEST - - data = client.post(request, "/compliance/open-licence-returns/", json) - return data.json(), data.status_code diff --git a/exporter/compliance/urls.py b/exporter/compliance/urls.py deleted file mode 100644 index 3d333bdcae..0000000000 --- a/exporter/compliance/urls.py +++ /dev/null @@ -1,27 +0,0 @@ -from django.urls import path - -from exporter.compliance import views - -app_name = "compliance" - -urlpatterns = [ - path("", views.ComplianceSiteList.as_view(), name="compliance_list"), - path("//", views.ComplianceSiteDetails.as_view(), name="compliance_site_details"), - path( - "/visit///", - views.ComplianceVisitDetails.as_view(), - name="compliance_visit_details", - ), - path("open-licence-returns/", views.AnnualReturnsList.as_view(), name="open_licence_returns_list"), - path( - "open-licence-returns//download/", - views.AnnualReturnsDownload.as_view(), - name="open_licence_returns_download", - ), - path("open-licence-returns/add/", views.AddAnnualReturn.as_view(), name="add_open_licence_return"), - path( - "open-licence-returns//success/", - views.AddAnnualReturnSuccess.as_view(), - name="add_open_licence_return_success", - ), -] diff --git a/exporter/compliance/views.py b/exporter/compliance/views.py deleted file mode 100644 index 9c242b627f..0000000000 --- a/exporter/compliance/views.py +++ /dev/null @@ -1,134 +0,0 @@ -from django.http import Http404 -from django.shortcuts import render, redirect -from django.urls import reverse_lazy -from django.views.generic import TemplateView - -from exporter.applications.services import ( - get_case_notes, - post_case_notes, - get_application_ecju_queries, - get_case_generated_documents, -) -from exporter.compliance.forms import open_licence_return_form_group -from exporter.compliance.services import ( - post_open_licence_return, - get_open_licence_returns, - get_open_licence_return_download, - get_compliance_list, - get_compliance_detail, - get_case_visit_reports, - get_case_visit_report, -) -from lite_content.lite_exporter_frontend.compliance import OpenReturnsForm -from lite_forms.generators import success_page -from lite_forms.views import MultiFormView - -from core.auth.views import LoginRequiredMixin - - -class ComplianceSiteList(LoginRequiredMixin, TemplateView): - def get(self, request, *args, **kwargs): - data = get_compliance_list(request) - return render(request, "compliance/compliance/list.html", {"compliance": data}) - - -class ComplianceSiteDetails(LoginRequiredMixin, TemplateView): - def get(self, request, pk, tab, **kwargs): - data = get_compliance_detail(request, pk) - data["tab"] = tab - if tab == "case-notes": - data["notes"] = get_case_notes(request, str(pk))["case_notes"] - elif tab == "ecju-queries": - data["open_queries"], data["closed_queries"] = get_application_ecju_queries(request, str(pk)) - elif tab == "generated-documents": - generated_documents, _ = get_case_generated_documents(request, str(pk)) - data["generated_documents"] = generated_documents["results"] - elif tab == "visit-reports": - data["visit_reports"] = get_case_visit_reports(request, str(pk), request.GET.get("page")) - - if kwargs.get("errors"): - data["errors"] = kwargs["errors"] - data["text"] = kwargs["text"] - - return render(request, "compliance/compliance/site-case.html", data) - - def post(self, request, pk, tab): - if tab != "case-notes": - return Http404 - - response, _ = post_case_notes(request, str(pk), request.POST) - - if "errors" in response: - return self.get(request, pk, tab, errors=response["errors"]["text"][0], text=request.POST.get("text")) - - return redirect(reverse_lazy("compliance:compliance_site_details", kwargs={"pk": pk, "tab": tab})) - - -class ComplianceVisitDetails(LoginRequiredMixin, TemplateView): - def get(self, request, site_case_id, pk, tab, **kwargs): - data = get_case_visit_report(request, pk) - data["tab"] = tab - data["site_case_id"] = site_case_id - if tab == "ecju-queries": - data["open_queries"], data["closed_queries"] = get_application_ecju_queries(request, str(pk)) - elif tab == "generated-documents": - generated_documents, _ = get_case_generated_documents(request, str(pk)) - data["generated_documents"] = generated_documents["results"] - - return render(request, "compliance/compliance/visit-case.html", data) - - -class AnnualReturnsList(LoginRequiredMixin, TemplateView): - def get(self, request, *args, **kwargs): - data = get_open_licence_returns(request) - return render(request, "compliance/open-licence-returns/list.html", {"open_licence_returns": data}) - - -class AnnualReturnsDownload(LoginRequiredMixin, TemplateView): - def get(self, request, pk): - return get_open_licence_return_download(request, pk) - - -class AddAnnualReturn(LoginRequiredMixin, MultiFormView): - def init(self, request, **kwargs): - self.additional_context = { - "columns": [ - OpenReturnsForm.Upload.ExampleTable.LICENCE_COLUMN, - OpenReturnsForm.Upload.ExampleTable.DESTINATION_COLUMN, - OpenReturnsForm.Upload.ExampleTable.END_USER_COLUMN, - OpenReturnsForm.Upload.ExampleTable.USAGE_COLUMN, - OpenReturnsForm.Upload.ExampleTable.PERIOD_COLUMN, - ], - "rows": [ - [ - OpenReturnsForm.Upload.ExampleTable.LICENCE_EXAMPLE, - OpenReturnsForm.Upload.ExampleTable.DESTINATION_EXAMPLE, - OpenReturnsForm.Upload.ExampleTable.END_USER_EXAMPLE_COLUMN, - OpenReturnsForm.Upload.ExampleTable.USAGE_EXAMPLE, - OpenReturnsForm.Upload.ExampleTable.PERIOD_EXAMPLE, - ] - ], - } - self.forms = open_licence_return_form_group() - self.action = post_open_licence_return - - def get_success_url(self): - return reverse_lazy( - "compliance:add_open_licence_return_success", - kwargs={"pk": self.get_validated_data()["open_licence_returns"]}, - ) - - -class AddAnnualReturnSuccess(LoginRequiredMixin, TemplateView): - def get(self, request, **kwargs): - return success_page( - request=request, - title=OpenReturnsForm.Success.TITLE, - secondary_title="", - description=OpenReturnsForm.Success.DESCRIPTION, - what_happens_next="", - links={ - OpenReturnsForm.Success.OPEN_LICENCE_RETURNS_LINK: reverse_lazy("compliance:open_licence_returns_list"), - OpenReturnsForm.Success.HOME_LINK: reverse_lazy("core:home"), - }, - ) diff --git a/exporter/urls.py b/exporter/urls.py index fd2da57688..d237d50e03 100644 --- a/exporter/urls.py +++ b/exporter/urls.py @@ -14,14 +14,6 @@ path("applications/", include("exporter.applications.urls")), path("apply-for-a-licence/", include("exporter.apply_for_a_licence.urls")), path("auth/", include("exporter.auth.urls")), -] - -if not settings.FEATURE_FLAG_ONLY_ALLOW_SIEL: - urlpatterns += [ - path("compliance/", include("exporter.compliance.urls")), - ] - -urlpatterns += [ path("end-users/", include("exporter.end_users.urls")), path("product-list/", include("exporter.goods.urls")), path("licences/", include("exporter.licences.urls")), diff --git a/unit_tests/exporter/test_urls.py b/unit_tests/exporter/test_urls.py deleted file mode 100644 index a2e9ad8b1b..0000000000 --- a/unit_tests/exporter/test_urls.py +++ /dev/null @@ -1,41 +0,0 @@ -from uuid import uuid4 - -import pytest - -from django.urls import reverse -from django.urls.exceptions import NoReverseMatch - -from unit_tests.helpers import reload_urlconf - - -def lookup_urls(): - reverse("compliance:compliance_list") - reverse("compliance:compliance_site_details", kwargs={"tab": "foo", "pk": uuid4()}) - reverse("compliance:compliance_visit_details", kwargs={"tab": "foo", "site_case_id": uuid4(), "pk": uuid4()}) - reverse("compliance:open_licence_returns_list") - reverse("compliance:open_licence_returns_download", kwargs={"pk": uuid4()}) - reverse("compliance:add_open_licence_return") - reverse("compliance:add_open_licence_return_success", kwargs={"pk": uuid4()}) - - -def test_url_respects_feature_flag_off(settings): - # given the feature is turned on - settings.FEATURE_FLAG_ONLY_ALLOW_SIEL = True - reload_urlconf(["exporter.compliance.urls", settings.ROOT_URLCONF]) - - # when urls are looked up - - # but non SIEL urls are not found - with pytest.raises(NoReverseMatch): - lookup_urls() - - -def test_url_respects_feature_flag_on(settings): - # given the feature is turned off - settings.FEATURE_FLAG_ONLY_ALLOW_SIEL = False - reload_urlconf(["exporter.compliance.urls", settings.ROOT_URLCONF]) - - # when urls are looked up - - # then nothing bad happens - lookup_urls() From d0624b88b559dfbb6e01e7367515650e579b7cf9 Mon Sep 17 00:00:00 2001 From: Kevin Carrogan Date: Mon, 4 Nov 2024 10:42:44 +0000 Subject: [PATCH 12/13] Update siel only flag to statically be true --- ci.exporter.env | 1 - conf/exporter.py | 2 +- example.exporter.env | 1 - tests.exporter.env | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ci.exporter.env b/ci.exporter.env index dd3f6e5c0a..35f184e212 100644 --- a/ci.exporter.env +++ b/ci.exporter.env @@ -18,7 +18,6 @@ ENVIRONMENT=local TEST_TYPE_HEADLESS=False LITE_E2E_HAWK_KEY=LITE_E2E_HAWK_KEY STATICFILES_STORAGE=django.contrib.staticfiles.storage.StaticFilesStorage -FEATURE_FLAG_ONLY_ALLOW_SIEL=false REDIS_URL=redis://redis:6379/exporter NOTIFY_KEY="super-secret-gov-uk-api-key-that-is-quite-long-and-hence-this-text" NOTIFY_FEEDBACK_TEMPLATE_ID="11111111-2222-3333-4444-555555555555" diff --git a/conf/exporter.py b/conf/exporter.py index bd91cc39b3..798cb3261e 100644 --- a/conf/exporter.py +++ b/conf/exporter.py @@ -83,7 +83,7 @@ LITE_API_AUTH_HEADER_NAME = "EXPORTER-USER-TOKEN" -FEATURE_FLAG_ONLY_ALLOW_SIEL = env.bool("FEATURE_FLAG_ONLY_ALLOW_SIEL", True) +FEATURE_FLAG_ONLY_ALLOW_SIEL = True FEATURE_FLAG_ALLOW_CLC_QUERY_AND_PV_GRADING = env.bool("FEATURE_FLAG_ALLOW_CLC_QUERY_AND_PV_GRADING", False) SPIRE_URL = "https://www.spire.trade.gov.uk/spire/fox/espire/LOGIN/login" diff --git a/example.exporter.env b/example.exporter.env index f6e529aa73..108aa867f0 100644 --- a/example.exporter.env +++ b/example.exporter.env @@ -59,7 +59,6 @@ AUTHBROKER_LOW_SECURITY=True STATICFILES_STORAGE=django.contrib.staticfiles.storage.StaticFilesStorage -FEATURE_FLAG_ONLY_ALLOW_SIEL=True FEATURE_FLAG_GOVUK_SIGNIN_ENABLED=True FEATURE_FLAG_ONLY_ALLOW_FIREARMS_PRODUCTS=True diff --git a/tests.exporter.env b/tests.exporter.env index f19380ebdc..99a370e97a 100644 --- a/tests.exporter.env +++ b/tests.exporter.env @@ -38,7 +38,6 @@ AUTHBROKER_LOW_SECURITY=True STATICFILES_STORAGE=django.contrib.staticfiles.storage.StaticFilesStorage -FEATURE_FLAG_ONLY_ALLOW_SIEL=false REDIS_URL=redis://127.0.0.1:6379/exporter NOTIFY_KEY="super-secret-gov-uk-api-key-that-is-quite-long-and-hence-this-text" From bd9bfdf6532df588f6720f4e57831d0a6f287ec4 Mon Sep 17 00:00:00 2001 From: Kevin Carrogan Date: Mon, 4 Nov 2024 10:48:06 +0000 Subject: [PATCH 13/13] Remove checks for feature flag that's always true --- exporter/templates/core/hub.html | 131 ++++++------------ exporter/templates/licences/licences.html | 14 +- exporter/templates/licences/nlrs.html | 10 +- .../licences/open-general-licences.html | 10 +- 4 files changed, 58 insertions(+), 107 deletions(-) diff --git a/exporter/templates/core/hub.html b/exporter/templates/core/hub.html index 71cbd3e3c0..7c1f6f8255 100644 --- a/exporter/templates/core/hub.html +++ b/exporter/templates/core/hub.html @@ -100,14 +100,10 @@

{% lcs 'hub.Tiles.VIEW_AND_MANAGE_LICENCES' %}

- {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -

View and manage your SIELs, including NLRs and unsuccessful applications.

-
- Use SPIRE – the online export licensing system - to view and manage all other licences and clearances.
- {% else %} -

View and manage your licences and clearances, including NLRs and unsuccessful applications.

- {% endif %} +

View and manage your SIELs, including NLRs and unsuccessful applications.

+
+ Use SPIRE – the online export licensing system + to view and manage all other licences and clearances.



@@ -129,22 +125,15 @@

{# End user query tile #}
- {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -

- - {% lcs 'hub.Tiles.END_USER_ADVISORIES' %}{% if notifications.notifications.end_user_advisory %} ({{ notifications.notifications.end_user_advisory }} notifications){% endif %} - -

-
- Use SPIRE – the online export licensing system - to ask for advice about an overseas organisation, government or individual in your export of products that are not controlled. -
- {% else %} - +

+ {% lcs 'hub.Tiles.END_USER_ADVISORIES' %}{% if notifications.notifications.end_user_advisory %} ({{ notifications.notifications.end_user_advisory }} notifications){% endif %} - -

{% lcs 'hub.Tiles.EUA.ASK_FOR_ADVICE' %}

- {% endif %} + +

+
+ Use SPIRE – the online export licensing system + to ask for advice about an overseas organisation, government or individual in your export of products that are not controlled. +
@@ -194,79 +183,47 @@

{% if organisation.type.key != 'hmrc' %}

{% lcs 'hub.Tiles.COMPLIANCE_HEADING' %}

- {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -
-
Use SPIRE – the online export licensing system - to view and manage your:
-
    -
  • compliance visits
  • -
  • open licence returns
  • -
-
- {% endif %} +
+
Use SPIRE – the online export licensing system + to view and manage your:
+
    +
  • compliance visits
  • +
  • open licence returns
  • +
+
-
+
{# Compliance licence tile #} -
- {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -

- - {% lcs 'hub.Tiles.Compliance.TITLE' %} - {% if notifications.notifications.compliance %} ({{ notifications.notifications.compliance }} notifications){% endif %} - -

- {% else %} -

- - {% lcs 'hub.Tiles.Compliance.TITLE' %} - {% if notifications.notifications.compliance %} ({{ notifications.notifications.compliance }} notifications){% endif %} - -

- {% endif %} +
+

+ + {% lcs 'hub.Tiles.Compliance.TITLE' %} + {% if notifications.notifications.compliance %} ({{ notifications.notifications.compliance }} notifications){% endif %} + +

{% lcs 'hub.Tiles.Compliance.DESCRIPTION' %}

{# Open licence returns tile #} -
- {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -

- - {% lcs 'hub.Tiles.OPEN_LICENCE_RETURNS' %} - -

- {% else %} -

- - {% lcs 'hub.Tiles.OPEN_LICENCE_RETURNS' %} - -

- {% endif %} +
+

+ + {% lcs 'hub.Tiles.OPEN_LICENCE_RETURNS' %} + +

{% lcs 'hub.Tiles.OpenLicenceReturns.DESCRIPTION' %}

    - {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -
  1. - - {% lcs 'hub.Tiles.OpenLicenceReturns.ADD_LINK' %} - -
  2. -
  3. - - {% lcs 'hub.Tiles.OpenLicenceReturns.VIEW_LINK' %} - -
  4. - {% else %} -
  5. - - {% lcs 'hub.Tiles.OpenLicenceReturns.ADD_LINK' %} - -
  6. -
  7. - - {% lcs 'hub.Tiles.OpenLicenceReturns.VIEW_LINK' %} - -
  8. - {% endif %} +
  9. + + {% lcs 'hub.Tiles.OpenLicenceReturns.ADD_LINK' %} + +
  10. +
  11. + + {% lcs 'hub.Tiles.OpenLicenceReturns.VIEW_LINK' %} + +
diff --git a/exporter/templates/licences/licences.html b/exporter/templates/licences/licences.html index 7022a54573..aacebee651 100644 --- a/exporter/templates/licences/licences.html +++ b/exporter/templates/licences/licences.html @@ -23,14 +23,12 @@

{% block title %}{% lcs "licences.LicencesList.TITLE {% include 'includes/tabs.html' %} - {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} - {% block feture_flag_notice %} -
- Use SPIRE – the online export licensing system - to view and manage your OIELs. -
- {% endblock %} - {% endif %} + {% block feture_flag_notice %} +
+ Use SPIRE – the online export licensing system + to view and manage your OIELs. +
+ {% endblock %} {% include 'filters.html' %} {% if data.results %} diff --git a/exporter/templates/licences/nlrs.html b/exporter/templates/licences/nlrs.html index eba47ffed6..20015bc227 100644 --- a/exporter/templates/licences/nlrs.html +++ b/exporter/templates/licences/nlrs.html @@ -15,12 +15,10 @@

{% block title %}{% lcs "licences.LicencesList.TITLE {% include 'includes/tabs.html' %} - {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -
- Use SPIRE – the online export licensing system - to view your OIEL, SIEL and MOD clearance NLRs. -
- {% endif %} +
+ Use SPIRE – the online export licensing system + to view your OIEL, SIEL and MOD clearance NLRs. +
{% include "filters.html" %} diff --git a/exporter/templates/licences/open-general-licences.html b/exporter/templates/licences/open-general-licences.html index 926b172ab1..6e5045ebf8 100644 --- a/exporter/templates/licences/open-general-licences.html +++ b/exporter/templates/licences/open-general-licences.html @@ -12,12 +12,10 @@

{% block title %}{% lcs "licences.LicencesList.TITLE

{% include 'includes/tabs.html' %} - {% if FEATURE_FLAG_ONLY_ALLOW_SIEL %} -
- Use SPIRE – the online export licensing system - to view and manage your OGLs. -
- {% endif %} +
+ Use SPIRE – the online export licensing system + to view and manage your OGLs. +

Read