Skip to content

Commit

Permalink
Merge pull request #1080 from uktrade/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
bsabhilash authored Apr 18, 2023
2 parents 3ff657b + 30e2c17 commit 344b4e4
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 74 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:
command: |
. venv/bin/activate
mkdir test-reports
TESTFILES=$(circleci tests glob "tests/**/*.py")
ENV_FILES=test,dev pytest ${TESTFILES} --cov=. --cov-config=.coveragerc --cov-report html --cov-report term --junitxml=test-reports/junit.xml
codecov
make pytest_codecov -- --codecov-token=${CODECOV_TOKEN}
- run: mkdir -p workspace
- run: echo "export TARGET_CIRCLE_BUILD_NUM=$CIRCLE_BUILD_NUM" >> workspace/new-env-vars
- store_test_results:
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@

## Pre-release
### Fixed bugs
* KLS-358 - Missing content on Investment Opportunity content editing panels

### Implemented enhancements

## [2.9.3](https://github.com/uktrade/directory-cms/releases/tag/2.9.3)
[Full Changelog](https://github.com/uktrade/directory-cms/compare/2.9.2...2.9.3)
### Implemented enhancements
* KLS-247 - Add hero_image and hero_video to article page for freeports work
### Fixed bugs
* KLS-358 - Missing content on Investment Opportunity content editing panels

## [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)
Expand Down
3 changes: 1 addition & 2 deletions great_international/panels/great_international.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class InternationalArticlePagePanels:
content_panels = [
FieldPanel('title'),
FieldPanel('article_title'),
FieldPanel('type_of_article'),
FieldPanel('type_of_article', widget=Select),
ImageChooserPanel('hero_image'),
MediaChooserPanel('hero_video'),
MultiFieldPanel(
Expand Down Expand Up @@ -312,7 +312,6 @@ class InternationalArticlePagePanels:
]

settings_panels = [
FieldPanel('type_of_article', widget=Select),
FieldPanel('slug'),
FieldPanel('tags', widget=CheckboxSelectMultiple)
]
Expand Down
16 changes: 16 additions & 0 deletions great_international/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@ class InternationalArticlePageSerializer(BasePageSerializer):

tags = core_fields.TagsListField()

freeport_data = serializers.SerializerMethodField()

def get_freeport_data(self, instance):
if instance.type_of_article == 'Freeport landing':
queryset = InvestmentOpportunityPage.objects.live().public().filter(investment_type__name='Freeport')
if not queryset:
return []

serializer = InvestmentOpportunityForListPageSerializer(
queryset,
many=True,
allow_null=True,
context=self.context
)
return serializer.data


class GreatMediaSerializer(serializers.Serializer):
title = serializers.CharField()
Expand Down
9 changes: 9 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ pytest:
--cov=. \
$(ARGUMENTS)

pytest_codecov:
ENV_FILES='test,dev' \
pytest \
--junitxml=test-reports/junit.xml \
--cov-config=.coveragerc \
--cov-report=term \
--cov=. \
--codecov \
$(ARGUMENTS)

flake8:
flake8 . \
Expand Down
35 changes: 27 additions & 8 deletions pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
To do (delete all that do not apply):

- [ ] Change has a jira ticket that has the correct status.
- [ ] Changelog entry added.
- [ ] (if there are vulnerable requirements) Upgraded any vulnerable dependencies.
- [ ] (if updating requirements) Requirements have been compiled.
- [ ] (if adding env vars) Added any new environment variable to vault.
- [ ] (if adding feature flags) Cleaned up old flags
(Please add a sentence or two explaining the context of this PR. Reviewers can go to the ticket for detail.)
CONTEXT: This changeset adds/removes/updates [summary of feature/area/code] so that [summary of benefit].

_Tick or delete as appropriate:_

### Workflow

- [ ] Ticket exists in Jira https://uktrade.atlassian.net/browse/TICKET_ID_HERE
- [ ] Jira ticket has the correct status.
- [ ] A clear/description pull request messaged added.

### Reviewing help

- [ ] Explains how to test locally, including how to set up appropriate data
- [ ] Includes screenshot(s) - ideally before and after, but at least after

### Housekeeping

- [ ] Added all new environment variables to Vault.
- [ ] Cleaned up old feature flags
- [ ] Upgraded any vulnerable dependencies.
- [ ] I have updated security dependencies
- [ ] Python requirements have been re-compiled.

### Merging

- [x] This PR can be merged by reviewers. (If unticked, please leave for the author to merge)
6 changes: 3 additions & 3 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ html2text==2020.*
wagtailmedia==0.*
pytube==9.2.2
django-filter>=2.4.0
django-redis==5.2.0
celery[redis]==5.2.2
django-redis
celery[redis]
django-celery-beat==2.2.1
kombu==5.2.3
requests[security]==2.27.1
Expand All @@ -40,4 +40,4 @@ gevent==22.10.*
psycogreen==1.0.2
wagtailmedia==0.5.0
cryptography==39.*
oauthlib==3.2.*
oauthlib==3.2.*
46 changes: 25 additions & 21 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

amqp==5.1.1
# via kombu
anyascii==0.3.1
anyascii==0.3.2
# via wagtail
asgiref==3.6.0
# via django
attrs==22.2.0
async-timeout==4.0.2
# via redis
attrs==23.1.0
# via jsonschema
beautifulsoup4==4.9.3
# via
Expand All @@ -34,7 +36,7 @@ botocore==1.27.96
# s3transfer
bump2version==1.0.1
# via wagtail-modeltranslation
celery[redis]==5.2.2
celery[redis]==5.2.7
# via
# -r requirements.in
# django-celery-beat
Expand Down Expand Up @@ -69,9 +71,9 @@ directory-constants==22.0.2
# via
# -r requirements.in
# directory-components
directory-healthcheck==3.0.2
directory-healthcheck==3.0.4
# via -r requirements.in
dj-database-url==1.2.0
dj-database-url==1.3.0
# via -r requirements.in
django==3.2.18
# via
Expand Down Expand Up @@ -127,7 +129,7 @@ django-taggit==1.5.1
# via wagtail
django-timezone-field==4.2.3
# via django-celery-beat
django-treebeard==4.6.1
django-treebeard==4.7
# via wagtail
djangorestframework==3.14.0
# via
Expand Down Expand Up @@ -158,7 +160,7 @@ html5lib==1.1
# via wagtail
idna==3.4
# via requests
importlib-metadata==6.0.0
importlib-metadata==6.4.1
# via
# keyring
# twine
Expand Down Expand Up @@ -192,25 +194,25 @@ oauthlib==3.2.2
# via
# -r requirements.in
# requests-oauthlib
openpyxl==3.1.1
openpyxl==3.1.2
# via tablib
packaging==23.0
packaging==23.1
# via bleach
pillow==9.4.0
pillow==9.5.0
# via wagtail
pkginfo==1.9.6
# via twine
prompt-toolkit==3.0.38
# via click-repl
psycogreen==1.0.2
# via -r requirements.in
psycopg2==2.9.5
psycopg2==2.9.6
# via -r requirements.in
pycountry==19.8.18
# via -r requirements.in
pycparser==2.21
# via cffi
pygments==2.14.0
pygments==2.15.0
# via readme-renderer
pyjwt==2.6.0
# via notifications-python-client
Expand All @@ -224,7 +226,7 @@ python-dateutil==2.8.2
# python-crontab
pytube==9.2.2
# via -r requirements.in
pytz==2022.7.1
pytz==2023.3
# via
# celery
# django
Expand All @@ -234,7 +236,7 @@ pytz==2022.7.1
# l18n
readme-renderer==37.3
# via twine
redis==3.5.3
redis==4.5.4
# via
# celery
# django-redis
Expand All @@ -254,7 +256,7 @@ rfc3986==2.0.0
# via twine
s3transfer==0.6.0
# via boto3
sentry-sdk==1.16.0
sentry-sdk==1.19.1
# via -r requirements.in
sigauth==5.1.1
# via -r requirements.in
Expand All @@ -270,19 +272,21 @@ six==1.16.0
# mohawk
# python-dateutil
# w3lib
soupsieve==2.4
soupsieve==2.4.1
# via beautifulsoup4
sqlparse==0.4.3
sqlparse==0.4.4
# via django
tablib[xls,xlsx]==3.3.0
tablib[xls,xlsx]==3.4.0
# via wagtail
telepath==0.3
# via wagtail
tqdm==4.65.0
# via twine
twine==3.8.0
# via wagtail-modeltranslation
urllib3==1.26.14
typing-extensions==4.5.0
# via dj-database-url
urllib3==1.26.15
# via
# -r requirements.in
# botocore
Expand Down Expand Up @@ -320,15 +324,15 @@ wrapt==1.15.0
# via elastic-apm
xlrd==2.0.1
# via tablib
xlsxwriter==3.0.8
xlsxwriter==3.1.0
# via wagtail
xlwt==1.3.0
# via tablib
zipp==3.15.0
# via importlib-metadata
zope-event==4.6
# via gevent
zope-interface==5.5.2
zope-interface==6.0
# via gevent

# The following packages are considered to be unsafe in a requirements file:
Expand Down
3 changes: 2 additions & 1 deletion requirements_test.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ factory-boy==2.*
wagtail-factories==2.0.1
django-debug-toolbar==3.2.*
pip-tools
codecov
pytest-codecov
GitPython
Loading

0 comments on commit 344b4e4

Please sign in to comment.