diff --git a/conf/tests/test_redirects.py b/conf/tests/test_redirects.py index 099b1cb3..fc2340c9 100644 --- a/conf/tests/test_redirects.py +++ b/conf/tests/test_redirects.py @@ -228,7 +228,6 @@ def test_redirects(url, expected, client): '/international/invest/perfectfit/', # needs PIR API call mocked # just a light check of SOME but not all views - '/international/contact/', '/international/invest/contact/', '/international/invest/contact/success/', '/international/expand/contact/', diff --git a/conf/tests/test_urls.py b/conf/tests/test_urls.py index ba11b95a..7377d675 100644 --- a/conf/tests/test_urls.py +++ b/conf/tests/test_urls.py @@ -60,23 +60,3 @@ def test_url_redirect_industries_to_about_uk_page_off(client, settings): with pytest.raises(NoReverseMatch): reverse('industries-to-about-uk-redirect') - - -def test_url_redirect_international_contact_triage_on(client, settings): - settings.FEATURE_FLAGS['INTERNATIONAL_TRIAGE_ON'] = True - reload_urlconf(settings) - - assert reverse('international-contact-triage') - - with pytest.raises(NoReverseMatch): - reverse('contact-page-international') - - -def test_url_redirect_international_contact_triage_off(client, settings): - settings.FEATURE_FLAGS['INTERNATIONAL_TRIAGE_ON'] = False - reload_urlconf(settings) - - assert reverse('contact-page-international') - - with pytest.raises(NoReverseMatch): - reverse('international-contact-triage') diff --git a/conf/urls.py b/conf/urls.py index fd6089ee..70588c56 100644 --- a/conf/urls.py +++ b/conf/urls.py @@ -113,23 +113,6 @@ ), ] -# This route remains in use after the Atlas refactor -if settings.FEATURE_FLAGS['INTERNATIONAL_TRIAGE_ON']: - urlpatterns += [ - re_path( - r'^international/contact/$', - core.views.InternationalContactTriageView.as_view(), - name='international-contact-triage' - ), - ] -else: - urlpatterns += [ - re_path( - r'^international/contact/$', - core.views.InternationalContactPageView.as_view(), - name='contact-page-international' - ), - ] urlpatterns += [ re_path( diff --git a/core/header_config/tier_two_nav_items.py b/core/header_config/tier_two_nav_items.py index 2b79a76c..2e1a6a66 100644 --- a/core/header_config/tier_two_nav_items.py +++ b/core/header_config/tier_two_nav_items.py @@ -136,7 +136,7 @@ WHY_INVEST_IN_UK = NavItem( name='why-invest-in-the-uk', - title=_('Why choose the UK?'), + title=_('Why choose the UK'), url=WHY_INVEST_IN_THE_UK_URL ) diff --git a/core/templates/atlas/components/footer.html b/core/templates/atlas/components/footer.html index b3128c64..63bc3efd 100644 --- a/core/templates/atlas/components/footer.html +++ b/core/templates/atlas/components/footer.html @@ -26,7 +26,7 @@ href="https://www.great.gov.uk/accessibility-statement/" target="_blank">{% trans 'Accessibility' %}
  • - + {% trans 'Contact us' %}
  • diff --git a/core/tests/test_views.py b/core/tests/test_views.py index dea55e11..89dc5d1e 100644 --- a/core/tests/test_views.py +++ b/core/tests/test_views.py @@ -5,13 +5,11 @@ from django.urls import reverse from conf.tests.test_urls import reload_urlconf -from core import constants from core.forms import CapitalInvestContactForm -from core.tests.helpers import create_response, stub_page, dummy_page +from core.tests.helpers import create_response, stub_page from core.views import ( MultilingualCMSPageFromPathView, CapitalInvestContactFormView, - InternationalContactTriageView, WhyBuyFromUKFormView, WhyBuyFromUKFormViewSuccess ) @@ -247,19 +245,6 @@ def test_capital_invest_contact_form_success_page_returns_404_when_feature_flag_ assert response.status_code == 404 -@patch('directory_cms_client.client.cms_api_client.lookup_by_path') -def test_international_contact_form(mock_cms_response, client, settings): - settings.FEATURE_FLAGS['INTERNATIONAL_TRIAGE_ON'] = False - reload_urlconf(settings) - - mock_cms_response.return_value = create_response(dummy_page) - - url = reverse('contact-page-international') - response = client.get(url) - - assert response.status_code == 200 - - @pytest.fixture def capital_invest_contact_form_data(captcha_stub): return { @@ -632,46 +617,6 @@ def test_about_uk_breadcrumbs_article_page_feature_off( assert response.context_data['page']['tree_based_breadcrumbs'][0]['title'] == 'Why choose the UK' -@pytest.mark.parametrize( - 'choice_contact_url', - [constants.INVEST_CONTACT_URL, constants.CAPITAL_INVEST_CONTACT_URL, constants.EXPORTING_TO_UK_CONTACT_URL, - constants.BUYING_CONTACT_URL] -) -def test_international_contact_triage_redirects( - choice_contact_url, client, feature_flags -): - feature_flags['INTERNATIONAL_TRIAGE_ON'] = True - feature_flags['EXPORTING_TO_UK_ON'] = True - feature_flags['CAPITAL_INVEST_CONTACT_IN_TRIAGE_ON'] = True - - response = client.post('/international/contact/', {'choice': choice_contact_url}) - assert response.status_code == 302 - assert response.url == choice_contact_url - - -@patch('directory_cms_client.client.cms_api_client.lookup_by_path') -def test_international_contact_triage_view( - mock_cms_response, rf -): - page = { - 'title': 'Midlands', - 'meta': { - 'languages': [ - ['en-gb', 'English'], - ] - } - } - - mock_cms_response.return_value = create_response(page) - - request = rf.get('/international/contact/') - request.LANGUAGE_CODE = 'en-gb' - response = InternationalContactTriageView.as_view()( - request, path='/international/contact/') - - assert 'domestic_contact_home' in response.context_data - - @pytest.fixture def why_buy_from_uk_form_data(captcha_stub): return { diff --git a/core/views.py b/core/views.py index 817de5c5..85bdfbcc 100644 --- a/core/views.py +++ b/core/views.py @@ -16,7 +16,7 @@ from directory_constants import urls from directory_components.helpers import SocialLinkBuilder from directory_components.mixins import ( - CMSLanguageSwitcherMixin, GA360Mixin, CountryDisplayMixin, EnableTranslationsMixin) + CMSLanguageSwitcherMixin, GA360Mixin, EnableTranslationsMixin) from core import forms, helpers, constants from core.context_modifiers import register_context_modifier, registry as context_modifier_registry @@ -162,27 +162,6 @@ def sector_landing_page_context_modifier(context, request): } -class InternationalContactPageView(CountryDisplayMixin, InternationalView): - template_name = 'core/contact_page.html' - header_section = tier_one_nav_items.CONTACT - - def __init__(self): - super().__init__() - self.set_ga360_payload( - page_id='InternationalContactPage', - business_unit='GreatInternational', - site_section='Contact', - site_subsection='ContactForm' - ) - - def get_context_data(self, *args, **kwargs): - return super().get_context_data( - hide_language_selector=True, - invest_contact_us_url=urls.international.EXPAND_CONTACT, - *args, **kwargs - ) - - class SendContactNotifyMessagesMixin: def send_company_message(self, form): sender = directory_forms_api_client.helpers.Sender( @@ -522,33 +501,3 @@ def handler404(request, *args, **kwargs): def handler500(request, *args, **kwargs): return render(request, '500.html', status=500) - - -class InternationalContactTriageView( - GA360Mixin, - EnableTranslationsMixin, - InternationalHeaderMixin, - FormView, -): - template_name = 'core/contact_international_triage.html' - form_class = forms.InternationalRoutingForm - success_url = urls.domestic.CONTACT_US + 'international/' - header_section = tier_one_nav_items.CONTACT - - def __init__(self): - super().__init__() - self.set_ga360_payload( - page_id='GreatInternationalContactTriage', - business_unit='GreatInternational', - site_section='GreatInternational', - site_subsection='ContactTriage' - ) - - def form_valid(self, form): - return redirect(form.cleaned_data['choice']) - - def get_context_data(self, *args, **kwargs): - return super().get_context_data( - domestic_contact_home=urls.domestic.CONTACT_US, - *args, **kwargs, - ) diff --git a/investment_atlas/templates/investment_atlas/general_content_page.html b/investment_atlas/templates/investment_atlas/general_content_page.html index 01b677ca..514ad36a 100644 --- a/investment_atlas/templates/investment_atlas/general_content_page.html +++ b/investment_atlas/templates/investment_atlas/general_content_page.html @@ -19,6 +19,4 @@ {% endfor %} - {% include 'investment_atlas/includes/speak_to_us.html' %} - {% endblock content %} diff --git a/investment_atlas/templates/investment_atlas/includes/contact_eyb.html b/investment_atlas/templates/investment_atlas/includes/contact_eyb.html new file mode 100644 index 00000000..8650b238 --- /dev/null +++ b/investment_atlas/templates/investment_atlas/includes/contact_eyb.html @@ -0,0 +1,20 @@ +
    +
    +
    + +
    +
    + {% if button_preamble %} +

    + {{ button_preamble }} +

    + {% endif %} + + Find out more + +
    +
    + +
    +
    +
    diff --git a/investment_atlas/templates/investment_atlas/includes/speak_to_us.html b/investment_atlas/templates/investment_atlas/includes/speak_to_us.html deleted file mode 100644 index f4e8f92d..00000000 --- a/investment_atlas/templates/investment_atlas/includes/speak_to_us.html +++ /dev/null @@ -1,10 +0,0 @@ -
    -
    -

    Speak to us

    -

    - The government is identifying new projects across the whole of the UK. Investors who are interested in our projects can find out more by contacting - us. -

    - Get in touch -
    -
    diff --git a/investment_atlas/templates/investment_atlas/opportunity.html b/investment_atlas/templates/investment_atlas/opportunity.html index ddbe2361..619a2639 100644 --- a/investment_atlas/templates/investment_atlas/opportunity.html +++ b/investment_atlas/templates/investment_atlas/opportunity.html @@ -47,7 +47,11 @@ + {% if page.investment_type == 'Foreign direct investment' or page.investment_type == 'Freeport' %} + {% include 'investment_atlas/includes/contact_eyb.html' with button_preamble="Take advantage of this opportunity to expand and grow your business in the UK" %} + {% else %} {% include 'investment_atlas/includes/contact.html' with button_preamble="Contact the opportunity lead" %} + {% endif %}
    {% for section in page.main_content %} @@ -131,6 +135,4 @@

    Other opportunities

    {% endif %} - {% include 'investment_atlas/includes/speak_to_us.html' %} - {% endblock %} diff --git a/investment_atlas/templates/investment_atlas/region.html b/investment_atlas/templates/investment_atlas/region.html index a057d2a0..0ff5d494 100644 --- a/investment_atlas/templates/investment_atlas/region.html +++ b/investment_atlas/templates/investment_atlas/region.html @@ -129,6 +129,4 @@

    {{ page.case_study_title }}

    {% endif %} - - {% include 'investment_atlas/includes/speak_to_us.html' %} {% endblock %} diff --git a/investment_atlas/templates/investment_atlas/region_listing_page.html b/investment_atlas/templates/investment_atlas/region_listing_page.html index b6a64343..7bc8d41b 100644 --- a/investment_atlas/templates/investment_atlas/region_listing_page.html +++ b/investment_atlas/templates/investment_atlas/region_listing_page.html @@ -40,6 +40,4 @@

    Explore more of the Investment Atlas

    {% endif %} - {% include 'investment_atlas/includes/speak_to_us.html' %} - {% endblock %} diff --git a/investment_atlas/templates/investment_atlas/topic_list.html b/investment_atlas/templates/investment_atlas/topic_list.html index d612ae17..48d5643c 100644 --- a/investment_atlas/templates/investment_atlas/topic_list.html +++ b/investment_atlas/templates/investment_atlas/topic_list.html @@ -34,6 +34,4 @@

    Explore more of the Investment Atlas

    {% endif %} - {% include 'investment_atlas/includes/speak_to_us.html' %} - {% endblock %} diff --git a/investment_atlas/templates/investment_atlas/why_invest_in_the_uk_page.html b/investment_atlas/templates/investment_atlas/why_invest_in_the_uk_page.html index ba77a7b8..ab6b5d68 100644 --- a/investment_atlas/templates/investment_atlas/why_invest_in_the_uk_page.html +++ b/investment_atlas/templates/investment_atlas/why_invest_in_the_uk_page.html @@ -46,5 +46,4 @@

    - {% include 'investment_atlas/includes/speak_to_us.html' %} {% endblock %}