Skip to content

Commit

Permalink
Merge pull request #1038 from uktrade/release
Browse files Browse the repository at this point in the history
UAT/Prod release
  • Loading branch information
Miriam Forner authored Sep 14, 2022
2 parents 37150f4 + bf5324c commit be93741
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
test:
working_directory: /tmp/cci-test
docker:
- image: circleci/python:3.9.7
- image: cimg/python:3.9.13
- image: circleci/redis:3.2-alpine
steps:
- checkout
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
## Pre-release

### Implemented enhancements
* GLS-316 - Add functionality to store a hero CTA title and URL for the investment atlas landing page.
* GLS-403 - Upgrade to Python version 3.9.13
* GLS-407 - Remove International EU exit form

### Fixed bugs

## [2.4.0](https://github.com/uktrade/directory-cms/releases/tag/2.4.0)
[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.3.3...2.4.0)
### Implemented enhancements
* GLS-316 - Add functionality to store a hero CTA title and URL for the investment atlas landing page.

## [2.3.3](https://github.com/uktrade/directory-cms/releases/tag/2.3.3)
[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.3.2...2.3.3)

Expand Down
2 changes: 1 addition & 1 deletion core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def set_required_for_language(form_class):
class WagtailAdminPageExclusivePageForm(WagtailAdminPageForm):

def __init__(self, *args, **kwargs):
if(
if (
hasattr(self._meta.model, 'slug_identity') and 'initial' not in kwargs
):
kwargs['initial'] = {
Expand Down
2 changes: 0 additions & 2 deletions core/serializer_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@

# Still used but old styles for content
# -------------------------------------
great_international.models.great_international.InternationalEUExitFormPage: great_international.serializers.InternationalEUExitFormPageSerializer, # NOQA
great_international.models.great_international.InternationalEUExitFormSuccessPage: great_international.serializers.InternationalEUExitFormSuccessPageSerializer, # NOQA
# 2 pages redirected, 1 with old style:
great_international.models.great_international.AboutDitServicesPage: great_international.serializers.AboutDitServicesPageSerializer, # NOQA

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2.28 on 2022-09-12 16:36

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('wagtailcore', '0059_apply_collection_ordering'),
('wagtailforms', '0004_add_verbose_name_plural'),
('great_international', '0155_auto_20220719_1025'),
]

operations = [
migrations.RemoveField(
model_name='internationaleuexitformsuccesspage',
name='page_ptr',
),
migrations.DeleteModel(
name='InternationalEUExitFormPage',
),
migrations.DeleteModel(
name='InternationalEUExitFormSuccessPage',
),
]
67 changes: 1 addition & 66 deletions great_international/models/great_international.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from core.fields import single_struct_block_stream_field_factory
from core.mixins import ServiceHomepageMixin
from core.model_fields import MarkdownField
from core.models import FormPageMetaClass, WagtailAdminExclusivePageMixin
from core.models import WagtailAdminExclusivePageMixin
from export_readiness import snippets
from great_international.blocks import great_international as blocks
from great_international.panels import great_international as panels
Expand Down Expand Up @@ -185,8 +185,6 @@ def allowed_subpage_models(cls):
return [
InternationalArticleListingPage,
InternationalTopicLandingPage,
InternationalEUExitFormPage,
InternationalEUExitFormSuccessPage,
investment_atlas_models.InvestmentAtlasLandingPage,
fas_models.InternationalTradeHomePage,
]
Expand Down Expand Up @@ -477,69 +475,6 @@ class InternationalTopicLandingPage(panels.InternationalTopicLandingPagePanels,
)


class InternationalEUExitFormPage(
WagtailAdminExclusivePageMixin,
BaseInternationalPage,
metaclass=FormPageMetaClass
):
# metaclass creates <fild_name>_label and <field_name>_help_text
form_field_names = [
'first_name',
'last_name',
'email',
'organisation_type',
'company_name',
'country',
'city',
'comment',
]

full_path_override = '/eu-exit-news/contact/'
slug_identity = slugs.EUEXIT_INTERNATIONAL_FORM

subpage_types = [
'great_international.InternationalEUExitFormSuccessPage']

breadcrumbs_label = models.CharField(max_length=50)
heading = models.CharField(max_length=255)
body_text = MarkdownField()
submit_button_text = models.CharField(max_length=50)
disclaimer = models.TextField(max_length=500)

content_panels_before_form = \
panels.InternationalEUExitFormPagePanels.content_panels_before_form
content_panels_after_form = \
panels.InternationalEUExitFormPagePanels.content_panels_after_form
settings_panels = panels.InternationalEUExitFormPagePanels.settings_panels


class InternationalEUExitFormSuccessPage(
panels.InternationalEUExitFormSuccessPagePanels, WagtailAdminExclusivePageMixin, BaseInternationalPage,
):
full_path_override = '/eu-exit-news/contact/success/'
slug_identity = slugs.EUEXIT_FORM_SUCCESS

parent_page_types = ['great_international.InternationalEUExitFormPage']

breadcrumbs_label = models.CharField(max_length=50)
heading = models.CharField(
max_length=255,
verbose_name='Title'
)
body_text = models.CharField(
max_length=255,
verbose_name='Body text',
)
next_title = models.CharField(
max_length=255,
verbose_name='Title'
)
next_body_text = models.CharField(
max_length=255,
verbose_name='Body text',
)


class AboutDitServiceField(panels.AboutDitServiceFieldPanels, models.Model):
icon = models.ForeignKey(
'wagtailimages.Image',
Expand Down
51 changes: 0 additions & 51 deletions great_international/panels/great_international.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,57 +508,6 @@ class InternationalTopicLandingPagePanels:
)


class InternationalEUExitFormPagePanels:

content_panels_before_form = [
MultiFieldPanel(
heading='Hero',
children=[
FieldPanel('breadcrumbs_label'),
FieldPanel('heading'),
FieldPanel('body_text'),
]
),
]
content_panels_after_form = [
FieldPanel('disclaimer', widget=Textarea),
FieldPanel('submit_button_text'),
SearchEngineOptimisationPanel(),
]

settings_panels = [
FieldPanel('title_en_gb'),
FieldPanel('slug'),
]


class InternationalEUExitFormSuccessPagePanels:

content_panels = [
FieldPanel('breadcrumbs_label'),
MultiFieldPanel(
heading='heading',
children=[
FieldPanel('heading'),
FieldPanel('body_text'),
]
),
MultiFieldPanel(
heading='Next steps',
children=[
FieldPanel('next_title'),
FieldPanel('next_body_text'),
]
),
SearchEngineOptimisationPanel(),
]

settings_panels = [
FieldPanel('title_en_gb'),
FieldPanel('slug'),
]


class AboutDitServiceFieldPanels:

panels = [
Expand Down
25 changes: 0 additions & 25 deletions great_international/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
InternationalArticleListingPage,
InternationalArticlePage,
InternationalCampaignPage,
InternationalEUExitFormPage,
InternationalInvestmentSectorPage,
InternationalInvestmentSubSectorPage,
WhyInvestInTheUKPage,
Expand Down Expand Up @@ -446,30 +445,6 @@ def get_child_pages(self, obj):
return articles + campaigns + sectors


class EUExitGenericFormPageSerializer(BasePageSerializer):
breadcrumbs_label = serializers.CharField()
heading = serializers.CharField()
body_text = core_fields.MarkdownToHTMLField()
submit_button_text = serializers.CharField()
disclaimer = core_fields.MarkdownToHTMLField()


class InternationalEUExitFormPageSerializer(
EUExitGenericFormPageSerializer,
metaclass=FormPageSerializerMetaclass
):
class Meta:
model_class = InternationalEUExitFormPage


class InternationalEUExitFormSuccessPageSerializer(BasePageSerializer):
breadcrumbs_label = serializers.CharField()
heading = serializers.CharField()
body_text = serializers.CharField()
next_title = serializers.CharField()
next_body_text = serializers.CharField()


class MinimalPageSerializer(BasePageSerializer):
heading = serializers.CharField(max_length=255)

Expand Down
12 changes: 0 additions & 12 deletions great_international/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,6 @@ class InternationalTopicLandingPageTranslationOptions(BaseTranslationOptions):
)


@register(great_international.InternationalEUExitFormPage)
class InternationalEUExitFormPageTranslationOptions(BaseTranslationOptions):
fields = []


@register(great_international.InternationalEUExitFormSuccessPage)
class InternationalEUExitFormSuccessPageTranslationOptions(
BaseTranslationOptions
):
fields = []


@register(investment_atlas.ForeignDirectInvestmentFormPage)
class ForeignDirectInvestmentFormPageTranslationOptions(
BaseTranslationOptions
Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
applications:
- buildpacks:
- https://github.com/cloudfoundry/python-buildpack.git#v1.7.46
- https://github.com/cloudfoundry/python-buildpack.git#v1.7.58
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9.7
python-3.9.13
9 changes: 0 additions & 9 deletions tests/great_international/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ def test_models_hierarchy():
assert great_international.InternationalHomePage.allowed_subpage_models() == [
great_international.InternationalArticleListingPage,
great_international.InternationalTopicLandingPage,
great_international.InternationalEUExitFormPage,
great_international.InternationalEUExitFormSuccessPage,
investment_atlas.InvestmentAtlasLandingPage,
find_a_supplier.InternationalTradeHomePage,
]
Expand All @@ -37,13 +35,6 @@ def test_models_hierarchy():
assert great_international.InternationalCampaignPage.allowed_subpage_models() == [
great_international.InternationalArticlePage,
]
# EU Exit forms
assert great_international.InternationalEUExitFormPage.allowed_subpage_models() == [
great_international.InternationalEUExitFormSuccessPage,
]
assert great_international.InternationalEUExitFormSuccessPage.allowed_parent_page_models() == [
great_international.InternationalEUExitFormPage,
]
assert capital_invest.CapitalInvestContactFormPage.allowed_subpage_models() == [
capital_invest.CapitalInvestContactFormSuccessPage
]
Expand Down

0 comments on commit be93741

Please sign in to comment.