Skip to content

Commit

Permalink
Merge pull request #1774 from uktrade/release
Browse files Browse the repository at this point in the history
Prod Release 2.7.0
  • Loading branch information
froddd authored Apr 25, 2022
2 parents 8f8fc95 + 5941ba2 commit b934152
Show file tree
Hide file tree
Showing 141 changed files with 3,385 additions and 3,139 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,27 @@

### Bugs fixed

- GLS-126 - remove unused CampaignPage model

### Enhancements

- GLS-97 - fix and make header styles more consistent
- GLS-124 - new homepage banner
- NOTICKET - retire Enzyme and cleanup tests output
- GLS-152 - Add CTA banner to homepage
- GLS-180 - Add trade visualisations to Country guide pages
- GLS-189 - Add feature flag for brand homepage banner
- GLS-180 - Extend visualisations to top 5 most visited market guides

## [2.6.0](https://github.com/uktrade/great-cms/releases/tag/2.6.0)

[Full Changelog](https://github.com/uktrade/great-cms/compare/2.5.0...2.6.0)

### Enhancements

- GLS-102 - update Signup page styling
- General tidy-up of front-end assets

## [2.5.0](https://github.com/uktrade/great-cms/releases/tag/2.5.0)

[Full Changelog](https://github.com/uktrade/great-cms/compare/2.4.1...2.5.0)
Expand All @@ -17,7 +36,6 @@
- GLS-113 - add extra items and heading to Country Guide CTA links
- GLS-113 - add command to update factsheets links from govuk content API
- GLS-112 - add Trade barriers and Duties and customs content
- GLS-102 - update Signup page styling

## [2.4.1](https://github.com/uktrade/great-cms/releases/tag/2.4.1)

Expand Down
3 changes: 2 additions & 1 deletion config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@
'domestic.CountryGuidePage',
'domestic.ArticlePage',
'domestic.ArticleListingPage',
'domestic.CampaignPage',
'domestic.GuidancePage',
'domestic.PerformanceDashboardPage',
'domestic.TradeFinancePage',
Expand Down Expand Up @@ -749,6 +748,8 @@
FEATURE_COMPARE_MARKETS_TABS = env.str('FEATURE_COMPARE_MARKETS_TABS', '{ }')
FEATURE_SHOW_REPORT_BARRIER_CONTENT = env.bool('FEATURE_SHOW_REPORT_BARRIER_CONTENT', False)
FEATURE_SHOW_MARKET_GUIDE_BAU_LINKS = env.bool('FEATURE_SHOW_MARKET_GUIDE_BAU_LINKS', False)
FEATURE_SHOW_MARKET_GUIDE_VISUALISATIONS = env.bool('FEATURE_SHOW_MARKET_GUIDE_VISUALISATIONS', False)
FEATURE_SHOW_BRAND_BANNER = env.bool('FEATURE_SHOW_BRAND_BANNER', False)
FEATURE_SHOW_MAGNA_LINKS_IN_HEADER = env.bool('FEATURE_SHOW_MAGNA_LINKS_IN_HEADER', False)
FEATURE_SHOW_INTERNATIONAL_FOOTER_LINK = env.bool('FEATURE_SHOW_INTERNATIONAL_FOOTER_LINK', False)
FEATURE_SHOW_CASE_STUDY_RANKINGS = env.bool('FEATURE_SHOW_CASE_STUDY_RANKINGS', False)
Expand Down
16 changes: 16 additions & 0 deletions contact/migrations/0011_delete_contactpagecontentsnippet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 2.2.27 on 2022-03-31 07:55

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('contact', '0010_data_bootstrap_remaining_guidance_snippets'),
]

operations = [
migrations.DeleteModel(
name='ContactPageContentSnippet',
),
]
26 changes: 13 additions & 13 deletions core/components/sass/components/statistics/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ $offset: calc(0px - .55em - 30px);
background: $white;
padding: 60px 30px;

& .statistic-heading {
margin-bottom: 0.5em;
}

& .statistic-number {
margin-bottom: 0;
font-family: $brand-font;
}

& .statistic-smallprint {
color: $mid-grey;
}

& .flex-grid {
flex-direction: row;
flex-wrap: wrap;
Expand Down Expand Up @@ -77,6 +64,19 @@ $offset: calc(0px - .55em - 30px);
}
}

.statistic-heading {
margin-bottom: 0.5em;
}

.statistic-number {
margin: .75rem 0;
line-height: 1.25;
font-family: $brand-font;
}

.statistic-smallprint {
color: $mid-grey;
}

.statistics-card-cta {
margin: $offset 0 0 0;
Expand Down
2 changes: 2 additions & 0 deletions core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def migration_support_vars(request):
'BREADCRUMBS_ROOT_URL': settings.BREADCRUMBS_ROOT_URL,
'FEATURE_SHOW_REPORT_BARRIER_CONTENT': settings.FEATURE_SHOW_REPORT_BARRIER_CONTENT,
'FEATURE_SHOW_MARKET_GUIDE_BAU_LINKS': settings.FEATURE_SHOW_MARKET_GUIDE_BAU_LINKS,
'FEATURE_SHOW_MARKET_GUIDE_VISUALISATIONS': settings.FEATURE_SHOW_MARKET_GUIDE_VISUALISATIONS,
'FEATURE_SHOW_BRAND_BANNER': settings.FEATURE_SHOW_BRAND_BANNER,
'FEATURE_SHOW_MAGNA_LINKS_IN_HEADER': settings.FEATURE_SHOW_MAGNA_LINKS_IN_HEADER,
'FEATURE_SHOW_INTERNATIONAL_FOOTER_LINK': settings.FEATURE_SHOW_INTERNATIONAL_FOOTER_LINK,
}
Expand Down
19 changes: 16 additions & 3 deletions core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
MALE = 'xy'
FEMALE = 'xx'


logger = getLogger(__name__)


Expand All @@ -47,7 +46,7 @@ def age_group_mapping(target_ages):
if start >= 100:
out.append('100+')
else:
out.append(f'{start}-{start+4}')
out.append(f'{start}-{start + 4}')
start += 5
return out

Expand Down Expand Up @@ -125,7 +124,6 @@ def is_fuzzy_match(label_a, label_b):


class CompanyParser(great_components.helpers.CompanyParser):

INDUSTRIES = great_components.helpers.CompanyParser.INDUSTRIES

SIC_CODES = dict(choices.SIC_CODES)
Expand Down Expand Up @@ -395,6 +393,21 @@ def get_trade_barrier_data(countries_list, sectors_list):
return response.json()


def get_total_trade_data_by_country(iso2):
response = api_client.dataservices.get_total_trade_data_by_country(iso2=iso2)
return response.json()


def get_trade_in_services_data_by_country(iso2):
response = api_client.dataservices.get_trade_in_service_data_by_country(iso2=iso2)
return response.json()


def get_commodity_exports_data_by_country(iso2):
response = api_client.dataservices.get_commodity_exports_data_by_country(iso2=iso2)
return response.json()


def get_country_data(countries, fields):
response = api_client.dataservices.get_country_data_by_country(countries=countries, fields=fields)
return response.json()
Expand Down
1 change: 1 addition & 0 deletions core/js/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('great-styles/src/js/Reveal')
79 changes: 79 additions & 0 deletions core/js/pages/country-guide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import Plotly from 'plotly.js-dist-min'

const initTradeChart = () => {
const config = {
displayModeBar: false,
responsive: true,
locale: 'en-GB',
}

const layout = {
yaxis: {
fixedrange: true,
rangemode: 'tozero',
},
xaxis: {
fixedrange: true,
showgrid: false,
showticklabels: true,
tickmode: 'linear',
showspikes: true,
spikethickness: 2,
spikemode: 'across',
},
font: {
family: 'Roboto, sans-serif',
size: 18,
},
legend: {
orientation: 'h',
},
colorway: ['#006ccc', '#ef5f56', '#00A699', '#666666'],
margin: {
b: 0,
t: 0,
l: 50,
r: 0,
pad: 10,
},
}

const lines = [
{
title: 'Total trade',
key: 'total',
},
{
title: 'Imports',
key: 'imports',
},
{
title: 'Exports',
key: 'exports',
},
]

const sourceData = JSON.parse(
document.getElementById('market-trends-data').textContent
)

const years = sourceData.map((x) => {
return x.year
})

const data = lines.map((line) => {
return {
name: line.title,
x: years,
y: sourceData.map((x) => {
return x[line.key]
}),
type: 'scatter',
hovertemplate: `${line.title} in %{x}: £%{y}<extra></extra>`,
}
})

Plotly.newPlot('plotly-market-trends', data, layout, config)
}

window.addEventListener('DOMContentLoaded', initTradeChart)
11 changes: 11 additions & 0 deletions core/sass/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,14 @@
margin-bottom: 0;
}
}

// TODO: Remove once ported to great-styles
// For some odd reason there is a double selector for this in great-styles.
.select__list.select__list {
display: block;
max-height: 0;
transition: max-height .25s ease-out;
}
.select__list.select__list[aria-expanded="true"] {
max-height: 270px;
}
Loading

0 comments on commit b934152

Please sign in to comment.