Skip to content

Commit

Permalink
Merge pull request #607 from uktrade/release
Browse files Browse the repository at this point in the history
Production release 15th August
  • Loading branch information
eadpearce authored Aug 15, 2019
2 parents 7be430f + e752ee7 commit 5df777f
Show file tree
Hide file tree
Showing 17 changed files with 569 additions and 28 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
## Pre-release

### Implemented enhancements
- No ticket - Make teaser field optional in international articles
- No ticket - Add featured industries to Invest home page
- CI-321 - About UK landing page
- CI-276 - Added `CapitalInvestContactFormPage` and `CapitalInvestContactFormSuccessPage`
- CI-429 - Tree based breadcrumbs can now use `breadcrumbs_label` if available

### Fixed Bugs
- CI-426 - Added pdf document upload to why choose uk page for ebook section
Expand Down
2 changes: 2 additions & 0 deletions core/serializer_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
great_international.models.capital_invest.CapitalInvestRegionPage: great_international.serializers.CapitalInvestRegionPageSerializer, # NOQA
great_international.models.capital_invest.CapitalInvestOpportunityListingPage: great_international.serializers.CapitalInvestOpportunityListingSerializer, # NOQA
great_international.models.capital_invest.CapitalInvestOpportunityPage: great_international.serializers.CapitalInvestOpportunityPageSerializer, # NOQA
great_international.models.capital_invest.CapitalInvestContactFormPage: great_international.serializers.CapitalInvestContactFormPageSerializer, # NOQA
great_international.models.capital_invest.CapitalInvestContactFormSuccessPage: great_international.serializers.CapitalInvestContactFormSuccessPageSerializer, # NOQA
great_international.models.invest.InvestInternationalHomePage: great_international.serializers.InvestInternationalHomePageSerializer, # NOQA
great_international.models.invest.InvestHighPotentialOpportunityFormSuccessPage: great_international.serializers.InvestHighPotentialOpportunityFormSuccessPageSerializer, # NOQA
great_international.models.invest.InvestHighPotentialOpportunityFormPage: great_international.serializers.InvestHighPotentialOpportunityFormPageSerializer, # NOQA
Expand Down
15 changes: 14 additions & 1 deletion core/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class PageTitleAndUrlSerializer(serializers.Serializer):
url = serializers.CharField()


class PageBreadcrumbsAndUrlSerializer(serializers.Serializer):
title = serializers.CharField(source='breadcrumbs_label')
url = serializers.CharField()


class BasePageSerializer(serializers.Serializer):
id = serializers.IntegerField()
seo_title = serializers.CharField()
Expand All @@ -27,7 +32,15 @@ def get_tree_based_breadcrumbs(self, instance):
breadcrumbs = [
page.specific for page in instance.specific.ancestors_in_app]
breadcrumbs.append(instance)
return PageTitleAndUrlSerializer(breadcrumbs, many=True).data
serialized = []

for crumb in breadcrumbs:
if hasattr(crumb, 'breadcrumbs_label'):
serialized.append(PageBreadcrumbsAndUrlSerializer(crumb).data)
else:
serialized.append(PageTitleAndUrlSerializer(crumb).data)

return serialized

def get_page_type(self, instance):
return instance.__class__.__name__
Expand Down
189 changes: 170 additions & 19 deletions db_template.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
-- PostgreSQL database dump
--

-- Dumped from database version 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)
-- Dumped by pg_dump version 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)
-- Dumped from database version 9.6.14
-- Dumped by pg_dump version 11.3

SET statement_timeout = 0;
SET lock_timeout = 0;
Expand All @@ -12,23 +12,10 @@ SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


SET default_tablespace = '';

SET default_with_oids = false;
Expand Down Expand Up @@ -2988,6 +2975,82 @@ CREATE TABLE public.great_international_aboutukwhychoosetheukpage (
);


--
-- Name: great_international_capitalinvestcontactformpage; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.great_international_capitalinvestcontactformpage (
page_ptr_id integer NOT NULL,
service_name character varying(100),
uses_tree_based_routing boolean NOT NULL,
breadcrumbs_label character varying(255) NOT NULL,
breadcrumbs_label_en_gb character varying(255),
breadcrumbs_label_de character varying(255),
breadcrumbs_label_ja character varying(255),
breadcrumbs_label_zh_hans character varying(255),
breadcrumbs_label_fr character varying(255),
breadcrumbs_label_es character varying(255),
breadcrumbs_label_pt character varying(255),
breadcrumbs_label_ar character varying(255),
heading character varying(255) NOT NULL,
heading_en_gb character varying(255),
heading_de character varying(255),
heading_ja character varying(255),
heading_zh_hans character varying(255),
heading_fr character varying(255),
heading_es character varying(255),
heading_pt character varying(255),
heading_ar character varying(255),
intro text NOT NULL,
intro_en_gb text,
intro_de text,
intro_ja text,
intro_zh_hans text,
intro_fr text,
intro_es text,
intro_pt text,
intro_ar text,
cta_text character varying(255) NOT NULL,
cta_text_en_gb character varying(255),
cta_text_de character varying(255),
cta_text_ja character varying(255),
cta_text_zh_hans character varying(255),
cta_text_fr character varying(255),
cta_text_es character varying(255),
cta_text_pt character varying(255),
cta_text_ar character varying(255)
);


--
-- Name: great_international_capitalinvestcontactformsuccesspage; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.great_international_capitalinvestcontactformsuccesspage (
page_ptr_id integer NOT NULL,
service_name character varying(100),
uses_tree_based_routing boolean NOT NULL,
large_text character varying(255) NOT NULL,
large_text_en_gb character varying(255),
large_text_de character varying(255),
large_text_ja character varying(255),
large_text_zh_hans character varying(255),
large_text_fr character varying(255),
large_text_es character varying(255),
large_text_pt character varying(255),
large_text_ar character varying(255),
small_text text NOT NULL,
small_text_en_gb text,
small_text_de text,
small_text_ja text,
small_text_zh_hans text,
small_text_fr text,
small_text_es text,
small_text_pt text,
small_text_ar text
);


--
-- Name: great_international_capitalinvesthomesinenglandcardfieldssu8d44; Type: TABLE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -12566,6 +12629,14 @@ COPY public.auth_permission (id, name, content_type_id, codename) FROM stdin;
475 Can change invest region page 112 change_investregionpage
476 Can delete invest region page 112 delete_investregionpage
477 Can view invest region page 112 view_investregionpage
478 Can add capital invest contact form page 120 add_capitalinvestcontactformpage
479 Can change capital invest contact form page 120 change_capitalinvestcontactformpage
480 Can delete capital invest contact form page 120 delete_capitalinvestcontactformpage
481 Can view capital invest contact form page 120 view_capitalinvestcontactformpage
482 Can add capital invest contact form success page 121 add_capitalinvestcontactformsuccesspage
483 Can change capital invest contact form success page 121 change_capitalinvestcontactformsuccesspage
484 Can delete capital invest contact form success page 121 delete_capitalinvestcontactformsuccesspage
485 Can view capital invest contact form success page 121 view_capitalinvestcontactformsuccesspage
\.


Expand Down Expand Up @@ -12773,6 +12844,8 @@ COPY public.django_content_type (id, app_label, model) FROM stdin;
118 great_international aboutuklandingpage
119 great_international aboutukarticlesfields
112 great_international investregionpage
120 great_international capitalinvestcontactformpage
121 great_international capitalinvestcontactformsuccesspage
\.


Expand Down Expand Up @@ -13140,6 +13213,8 @@ COPY public.django_migrations (id, app, name, applied) FROM stdin;
357 great_international 0063_auto_20190807_1504 2019-08-08 10:30:16.491643+01
358 great_international 0064_merge_20190808_0928 2019-08-08 10:30:16.542222+01
359 great_international 0065_auto_20190808_1032 2019-08-08 11:37:15.180475+01
360 great_international 0066_capitalinvestcontactformpage_capitalinvestcontactformsuccesspage 2019-08-09 09:15:15.500538+01
361 great_international 0067_auto_20190814_0940 2019-08-14 10:42:44.256149+01
\.


Expand Down Expand Up @@ -13495,6 +13570,22 @@ COPY public.great_international_aboutukwhychoosetheukpage (page_ptr_id, service_
\.


--
-- Data for Name: great_international_capitalinvestcontactformpage; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.great_international_capitalinvestcontactformpage (page_ptr_id, service_name, uses_tree_based_routing, breadcrumbs_label, breadcrumbs_label_en_gb, breadcrumbs_label_de, breadcrumbs_label_ja, breadcrumbs_label_zh_hans, breadcrumbs_label_fr, breadcrumbs_label_es, breadcrumbs_label_pt, breadcrumbs_label_ar, heading, heading_en_gb, heading_de, heading_ja, heading_zh_hans, heading_fr, heading_es, heading_pt, heading_ar, intro, intro_en_gb, intro_de, intro_ja, intro_zh_hans, intro_fr, intro_es, intro_pt, intro_ar, cta_text, cta_text_en_gb, cta_text_de, cta_text_ja, cta_text_zh_hans, cta_text_fr, cta_text_es, cta_text_pt, cta_text_ar) FROM stdin;
\.


--
-- Data for Name: great_international_capitalinvestcontactformsuccesspage; Type: TABLE DATA; Schema: public; Owner: -
--

COPY public.great_international_capitalinvestcontactformsuccesspage (page_ptr_id, service_name, uses_tree_based_routing, large_text, large_text_en_gb, large_text_de, large_text_ja, large_text_zh_hans, large_text_fr, large_text_es, large_text_pt, large_text_ar, small_text, small_text_en_gb, small_text_de, small_text_ja, small_text_zh_hans, small_text_fr, small_text_es, small_text_pt, small_text_ar) FROM stdin;
\.


--
-- Data for Name: great_international_capitalinvesthomesinenglandcardfieldssu8d44; Type: TABLE DATA; Schema: public; Owner: -
--
Expand Down Expand Up @@ -14153,7 +14244,7 @@ SELECT pg_catalog.setval('public.auth_group_permissions_id_seq', 20, true);
-- Name: auth_permission_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.auth_permission_id_seq', 477, true);
SELECT pg_catalog.setval('public.auth_permission_id_seq', 485, true);


--
Expand Down Expand Up @@ -14216,14 +14307,14 @@ SELECT pg_catalog.setval('public.django_admin_log_id_seq', 1, false);
-- Name: django_content_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.django_content_type_id_seq', 119, true);
SELECT pg_catalog.setval('public.django_content_type_id_seq', 121, true);


--
-- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.django_migrations_id_seq', 359, true);
SELECT pg_catalog.setval('public.django_migrations_id_seq', 361, true);


--
Expand Down Expand Up @@ -15124,6 +15215,22 @@ ALTER TABLE ONLY public.great_international_aboutukwhychoosetheukpage
ADD CONSTRAINT great_international_aboutukwhychoosetheukpage_pkey PRIMARY KEY (page_ptr_id);


--
-- Name: great_international_capitalinvestcontactformpage great_international_capitalinvestcontactformpage_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.great_international_capitalinvestcontactformpage
ADD CONSTRAINT great_international_capitalinvestcontactformpage_pkey PRIMARY KEY (page_ptr_id);


--
-- Name: great_international_capitalinvestcontactformsuccesspage great_international_capitalinvestcontactformsuccesspage_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.great_international_capitalinvestcontactformsuccesspage
ADD CONSTRAINT great_international_capitalinvestcontactformsuccesspage_pkey PRIMARY KEY (page_ptr_id);


--
-- Name: great_international_capitalinvesthomesinenglandcardfieldssu8d44 great_international_capitalinvesthomesinenglandcardfieldss_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -18635,6 +18742,20 @@ CREATE INDEX great_international_aboutuklandingpage_hero_image_id_6da7f8a1 ON pu
CREATE INDEX great_international_aboutuklandingpage_service_name_441d14f1 ON public.great_international_aboutuklandingpage USING btree (service_name);


--
-- Name: great_international_capi_service_name_04b98f69_like; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX great_international_capi_service_name_04b98f69_like ON public.great_international_capitalinvestcontactformsuccesspage USING btree (service_name varchar_pattern_ops);


--
-- Name: great_international_capi_service_name_0867015e_like; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX great_international_capi_service_name_0867015e_like ON public.great_international_capitalinvestcontactformpage USING btree (service_name varchar_pattern_ops);


--
-- Name: great_international_capi_service_name_a0c9c921_like; Type: INDEX; Schema: public; Owner: -
--
Expand Down Expand Up @@ -19958,6 +20079,20 @@ CREATE INDEX great_international_capita_sector_icon_pt_id_bf4f43c2 ON public.gre
CREATE INDEX great_international_capita_sector_icon_zh_hans_id_65d6dab1 ON public.great_international_capitalinvestopportunitypage USING btree (sector_icon_zh_hans_id);


--
-- Name: great_international_capita_service_name_04b98f69; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX great_international_capita_service_name_04b98f69 ON public.great_international_capitalinvestcontactformsuccesspage USING btree (service_name);


--
-- Name: great_international_capita_service_name_0867015e; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX great_international_capita_service_name_0867015e ON public.great_international_capitalinvestcontactformpage USING btree (service_name);


--
-- Name: great_international_capita_service_name_a0c9c921; Type: INDEX; Schema: public; Owner: -
--
Expand Down Expand Up @@ -39690,6 +39825,14 @@ ALTER TABLE ONLY public.great_international_investhighpotentialopportunityformsu
ADD CONSTRAINT great_international__page_ptr_id_4e2e59c3_fk_wagtailco FOREIGN KEY (page_ptr_id) REFERENCES public.wagtailcore_page(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: great_international_capitalinvestcontactformpage great_international__page_ptr_id_4f703dde_fk_wagtailco; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.great_international_capitalinvestcontactformpage
ADD CONSTRAINT great_international__page_ptr_id_4f703dde_fk_wagtailco FOREIGN KEY (page_ptr_id) REFERENCES public.wagtailcore_page(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: great_international_internationaleuexitformpage great_international__page_ptr_id_6d7c3ad3_fk_wagtailco; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -39866,6 +40009,14 @@ ALTER TABLE ONLY public.great_international_internationalhomepage
ADD CONSTRAINT great_international__page_ptr_id_e94f663f_fk_wagtailco FOREIGN KEY (page_ptr_id) REFERENCES public.wagtailcore_page(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: great_international_capitalinvestcontactformsuccesspage great_international__page_ptr_id_f96df5cc_fk_wagtailco; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.great_international_capitalinvestcontactformsuccesspage
ADD CONSTRAINT great_international__page_ptr_id_f96df5cc_fk_wagtailco FOREIGN KEY (page_ptr_id) REFERENCES public.wagtailcore_page(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: great_international_capitalinvestregioncardfieldssummary great_international__page_zh_hans_id_0c11ab1c_fk_great_int; Type: FK CONSTRAINT; Schema: public; Owner: -
--
Expand Down
2 changes: 2 additions & 0 deletions great_international/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def ready(self):
cache.AboutDitServicesPageSubscriber.subscribe()
cache.AboutUkLandingPageSubscriber.subscribe()
cache.AboutUkWhyChooseTheUkPageSubscriber.subscribe()
cache.CapitalInvestContactFormPageSubscriber.subscribe()
cache.CapitalInvestContactFormSuccessPageSubscriber.subscribe()
# tags inheritance signals
post_save.connect(
receiver=signals.inherit_tags_from_parent,
Expand Down
23 changes: 22 additions & 1 deletion great_international/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class InternationalHomePageOldSubscriber(AbstractDatabaseCacheSubscriber):

class InternationalArticlePageSubscriber(AbstractDatabaseCacheSubscriber):
model = great_international.InternationalArticlePage
subscriptions = []
subscriptions = [
great_international.InternationalSectorPage
]


class InternationalCampaignPageSubscriber(AbstractDatabaseCacheSubscriber):
Expand Down Expand Up @@ -239,3 +241,22 @@ class AboutUkWhyChooseTheUkPageSubscriber(
):
model = great_international.AboutUkWhyChooseTheUkPage
subscriptions = []


class CapitalInvestContactFormPageSubscriber(
AbstractDatabaseCacheSubscriber
):
model = capital_invest.CapitalInvestContactFormPage
subscriptions = [
capital_invest.InternationalCapitalInvestLandingPage
]


class CapitalInvestContactFormSuccessPageSubscriber(
AbstractDatabaseCacheSubscriber
):
model = capital_invest.CapitalInvestContactFormSuccessPage
subscriptions = [
capital_invest.InternationalCapitalInvestLandingPage,
capital_invest.CapitalInvestContactFormPage
]
Loading

0 comments on commit 5df777f

Please sign in to comment.