Skip to content

Commit

Permalink
Merge pull request #1074 from uktrade/release
Browse files Browse the repository at this point in the history
KLS 358 - Release to UAT/Prod
  • Loading branch information
timothyPatterson authored Mar 10, 2023
2 parents 97701da + ebaa9d2 commit 3ff657b
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ __pycache__/
staticfiles
BrowserStackLocal
node_modules/

venv/
.env
ENV/

Expand Down
30 changes: 26 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
# Changelog


## Upgraded Django version
-upgraded version to 3.2.18
## Pre-release
* KLS-205 - Upgrade django and wagtail
### Fixed bugs
* KLS-358 - Missing content on Investment Opportunity content editing panels
### Implemented enhancements

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

### Implemented enhancements
* KLS-249 - Add ability to get related investment opportunities by investment_type
* KLS-411 - Upgraded Cryptography to 39.0.1

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

### Implemented enhancements
* Upgraded Django version to 3.2.18
## [2.9.0](https://github.com/uktrade/directory-cms/releases/tag/2.9.0)
[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.8.0...2.9.0)
### Implemented enhancements
* KLS-288 patch django v3.2.16

### Fixed bugs
Fix for elastic apm failure in pipeline

## [2.8.0](https://github.com/uktrade/directory-cms/releases/tag/2.8.0)
[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.7.0...2.8.0)
### Implemented enhancements
* KLS-205 - Upgrade django and wagtail

## [2.7.0](https://github.com/uktrade/directory-cms/releases/tag/2.7.0)
[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.6.0...2.7.0)
### Implemented enhancements
* KLS-249 - Add ability to get related investment opportunities by investment_type

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

Expand Down
1 change: 1 addition & 0 deletions core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
('Advice', 'Advice'),
('Case study', 'Case study'),
('Campaign', 'Campaign'),
('Freeport landing', 'Freeport landing')
]
8 changes: 5 additions & 3 deletions great_international/blocks/great_international.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@

from core import blocks as core_blocks
from core.helpers import render_markdown
from core.widgets import MarkdownTextarea
from django.utils.safestring import mark_safe


class MarkdownBlock(blocks.FieldBlock):
def __init__(self, required=True, help_text=None, **kwargs):
def __init__(self, required=True, help_text=mark_safe(
'Enter content in Markdown format - <a href=https://stackedit.io/app# target=\'_blank\'> Guide </a>'),
**kwargs):
self.field = forms.CharField(
required=required,
help_text=help_text,
widget=MarkdownTextarea(),
widget=forms.Textarea(),
)
super().__init__(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Generated by Django 3.2.18 on 2023-02-28 16:53

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('wagtailmedia', '0003_copy_media_permissions_to_collections'),
('wagtailimages', '0023_add_choose_permissions'),
('great_international', '0158_add_get_related_opportunities_by_field'),
]

operations = [
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_ar',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_de',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_en_gb',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_es',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_fr',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_ja',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_pt',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_image_zh_hans',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_ar',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_de',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_en_gb',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_es',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_fr',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_ja',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_pt',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='hero_video_zh_hans',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailmedia.media'),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_ar',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_de',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_en_gb',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_es',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_fr',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_ja',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_pt',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AddField(
model_name='internationalarticlepage',
name='type_of_article_zh_hans',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
migrations.AlterField(
model_name='internationalarticlepage',
name='type_of_article',
field=models.TextField(blank=True, choices=[('Blog', 'Blog'), ('Advice', 'Advice'), ('Case study', 'Case study'), ('Campaign', 'Campaign'), ('Freeport landing', 'Freeport landing')], null=True),
),
]
21 changes: 18 additions & 3 deletions great_international/models/great_international.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from wagtail.core.blocks import PageChooserBlock
from wagtail.core.fields import StreamField
from wagtail.core.models import Orderable

from core.constants import ARTICLE_TYPES
from core.fields import single_struct_block_stream_field_factory
from core.mixins import ServiceHomepageMixin
Expand All @@ -13,7 +12,6 @@
from export_readiness import snippets
from great_international.blocks import great_international as blocks
from great_international.panels import great_international as panels

from . import find_a_supplier as fas_models
from .base import BaseInternationalPage

Expand Down Expand Up @@ -191,17 +189,34 @@ def allowed_subpage_models(cls):


class InternationalArticlePage(panels.InternationalArticlePagePanels, BaseInternationalPage):

parent_page_types = [
'great_international.InternationalArticleListingPage',
'great_international.InternationalCampaignPage',
'great_international.InternationalInvestmentSectorPage',
'great_international.WhyInvestInTheUKPage',
'great_international.InvestmentGeneralContentPage',
]

subpage_types = []

type_of_article = models.TextField(choices=ARTICLE_TYPES, null=True)
type_of_article = models.TextField(choices=ARTICLE_TYPES, null=True, blank=True)

hero_image = models.ForeignKey(
'wagtailimages.Image',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)

hero_video = models.ForeignKey(
'wagtailmedia.Media',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+',
)
article_title = models.TextField()
article_subheading = models.TextField(
blank=True,
Expand Down
7 changes: 5 additions & 2 deletions great_international/panels/great_international.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
MultiFieldPanel,
ObjectList,
PageChooserPanel,
StreamFieldPanel,
StreamFieldPanel
)

from wagtail.documents.edit_handlers import DocumentChooserPanel
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtailmedia.edit_handlers import MediaChooserPanel
from wagtailmedia.widgets import AdminMediaChooser

from core.helpers import make_translated_interface
from core.panels import SearchEngineOptimisationPanel

Expand Down Expand Up @@ -283,6 +283,9 @@ class InternationalArticlePagePanels:
content_panels = [
FieldPanel('title'),
FieldPanel('article_title'),
FieldPanel('type_of_article'),
ImageChooserPanel('hero_image'),
MediaChooserPanel('hero_video'),
MultiFieldPanel(
heading='Article content',
children=[
Expand Down
2 changes: 2 additions & 0 deletions great_international/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ class InternationalArticlePageSerializer(BasePageSerializer):
display_title = serializers.CharField(source='article_title')
article_title = serializers.CharField()
article_teaser = serializers.CharField()
hero_image = wagtail_fields.ImageRenditionField('original')
hero_video = core_fields.VideoField()
article_subheading = serializers.CharField()

article_image = wagtail_fields.ImageRenditionField('original')
Expand Down
3 changes: 3 additions & 0 deletions great_international/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class InternationalArticlePageTranslationOptions(BaseTranslationOptions):
fields = (
'article_title',
'article_subheading',
'hero_image',
'hero_video',
'type_of_article',
'article_teaser',
'article_body_text',
'cta_title',
Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ requests[security]==2.27.1
markdown==2.*
bleach==3.*
bleach-whitelist==0.*
wagtail==2.16.*
wagtail==2.15.*
wagtail-modeltranslation==0.11.0
django-modeltranslation==0.18.2
urllib3==1.26.*
Expand All @@ -36,7 +36,7 @@ notifications-python-client==6.3.*
num2words==0.5.10
pycountry==19.8.18
elastic-apm>6.0
gevent==21.8.0
gevent==22.10.*
psycogreen==1.0.2
wagtailmedia==0.5.0
cryptography==39.*
Expand Down
Loading

0 comments on commit 3ff657b

Please sign in to comment.