Skip to content

Commit 9dc6c56

Browse files
authored
feat(DTFS2-7093): Update Crown logo to Tudor logo (#2983)
1 parent c78d96c commit 9dc6c56

32 files changed

+204
-103
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Digital Trade Finance Service :briefcase:
2+
23
This repository contains the code for the UK Export Finance Trade Finance Service.
34
This documentation provides a comprehensive overview of the UKEF Digital TradeFinance Service (DTFS), including prerequisites, technology stack, setup instructions, testing procedures, deployment guidelines, and other essential information for the developers.
45

@@ -89,6 +90,7 @@ npm run stop
8990
## Different docker compose files
9091

9192
There are 3 different docker compose files right now.
93+
9294
- docker-compose.yml is used for local development
9395
- docker-compose.gha.yml is used for the pipelines to run our tests against
9496
- docker-compose.replica-set.yml is used when you need a replica set enabled on your local database, e.g. when working with the mongodb change stream
@@ -184,7 +186,18 @@ These CSS and JS files are built from SCSS and JS source files using a tool call
184186

185187
The developer should run `npm run build` inside the service in question to recompile the CSS and JS in the `public` folder after making any changes to the source files or their dependencies.
186188

187-
IMPORTANT: When recompiling JS files, the developer should ensure that they update the `integrity` attribute in any HTML/Nunjucks `script` tags that use the file to reflect the new hash of the recompiled file (a good place to check for these `script` tags is the `templates/index.njk` file in the service). An easy way of finding the new hash is to render a template that uses the script in a browser; a console error should give you the hash of the recompiled file.
189+
### Sub-resource integrity [(SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
190+
191+
Client side JavaScript files are protected by SRI security feature which allows the browser to verify the authenticity of the JavaScript files in use.
192+
193+
:warning: If a client side JavaScript file is changed and recompiled during `npm run build`, a new file hash will need to be generated. Otherwise, the script will not be executed.
194+
195+
This can be done by updating the `integrity` attribute in any HTML/Nunjucks `script` tags that use the file to reflect the new hash of the recompiled file (a good place to check for these `script` tags is the `templates/index.njk` file in the service).
196+
197+
There are two ways to update these:
198+
199+
1. (Preferred) Render a template that uses the script in a browser; a console error should give you the hash of the recompiled file.
200+
2. Run `cat FILENAME.js | openssl dgst -sha512 -binary | openssl base64 -A` on each. Note -- GEF UI references Portal UI's javascript files when using the reverse proxy, so use the hashes from Portal UI's `.js` files in GEF-UI.
188201

189202
## Linting :mag_right:
190203

gef-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"express-session": "1.17.3",
5454
"filesize": "9.0.11",
5555
"form-data": "4.0.0",
56-
"govuk-frontend": "4.6.0",
56+
"govuk-frontend": "^4.8.0",
5757
"http-errors": "^2.0.0",
5858
"imask": "^6.6.3",
5959
"joi": "^17.12.3",

gef-ui/public/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gef-ui/public/js/govukFrontend.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gef-ui/public/js/govukFrontend.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gef-ui/server/generateApp.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@ const routes = require('./routes');
1313
const supportingInformationUploadRoutes = require('./routes/supporting-information-upload');
1414
const healthcheck = require('./healthcheck');
1515
const configureNunjucks = require('./nunjucks-configuration');
16-
const {
17-
csrfToken,
18-
copyCsrfTokenFromQueryToBody,
19-
security,
20-
seo,
21-
createRateLimit,
22-
} = require('./middleware');
16+
const { csrfToken, copyCsrfTokenFromQueryToBody, security, seo, createRateLimit } = require('./middleware');
2317

2418
dotenv.config();
2519

@@ -104,11 +98,16 @@ const generateApp = () => {
10498
watch: true,
10599
});
106100

107-
app.use(morgan('dev', {
108-
skip: (req) => req.url.startsWith('/assets') || req.url.startsWith('/main.js'),
109-
}));
101+
app.use(
102+
morgan('dev', {
103+
skip: (req) => req.url.startsWith('/assets') || req.url.startsWith('/main.js'),
104+
}),
105+
);
110106

111-
app.use('/assets', express.static(path.join(__dirname, '..', 'public')));
107+
app.use(
108+
'/assets',
109+
express.static(path.join(__dirname, '..', 'public')),
110+
);
112111

113112
app.use(createRateLimit());
114113

gef-ui/templates/includes/header.njk

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
11
<header class="govuk-header " role="banner" data-module="govuk-header" data-cy="header">
22
<div class="govuk-header__container govuk-width-container">
33
<div class="govuk-header__logo">
4-
<a href="https://www.gov.uk" class="govuk-header__link govuk-header__link--homepage" title="Go to the GOV.UK homepage" data-cy="gov-home-link-header">
5-
<span class="govuk-header__logotype">
4+
<a
5+
href="https://www.gov.uk"
6+
class="govuk-header__link govuk-header__link--homepage"
7+
title="Go to the GOV.UK homepage"
8+
data-cy="gov-home-link-header">
9+
<span
10+
class="govuk-header__logotype">
611
<!--[if gt IE 8]><!-->
7-
<svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132 97" height="30" width="36" data-cy="gov-crown-svg-header">
12+
<svg
13+
aria-hidden="true"
14+
focusable="false"
15+
class="govuk-header__logotype-crown"
16+
xmlns="http://www.w3.org/2000/svg"
17+
viewBox="0 0 32 30"
18+
height="30"
19+
width="32"
20+
data-cy="gov-crown-svg-header">
821
<title data-cy="gov-crown-svg-title-header">GOVUK logo</title>
9-
<path fill="currentColor" fill-rule="evenodd" d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5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-1.4 0-2.7l-2.9.9C1.3 23 2.6 25.5 3.7 30c3.7-.5 7.9-.8 12.3-.8"></path>
1038
</svg>
1139
<!--<![endif]-->
12-
<!--[if IE 8]>
13-
<img src="/assets/images/govuk-logotype-crown.png" class="govuk-header__logotype-crown-fallback-image" alt="GOVUK logo" width="36" height="32">
14-
<![endif]-->
40+
<!-- [if IE 8]> <img src="/assets/images/govuk-logotype-tudor-crown.png"
41+
class="govuk-header__logotype-crown-fallback-image" width="32" height="30" alt=""> <![endif] -->
1542
<span class="govuk-header__logotype-text">
1643
GOV.UK
1744
</span>
@@ -24,15 +51,20 @@
2451
</a>
2552
{% if user %}
2653
<nav aria-label="Menu" class="govuk-header__navigation" data-cy="navigation-header">
27-
<button type="button" class="govuk-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide menu">Menu</button>
54+
<button
55+
type="button"
56+
class="govuk-header__menu-button govuk-js-header-toggle"
57+
aria-controls="navigation"
58+
aria-label="Show or hide menu">Menu</button>
2859
<ul id="navigation" class="govuk-header__navigation-list">
2960
<li class="govuk-header__navigation-item govuk-header__navigation-item--active">
30-
<a class="govuk-header__link" href="/user/{{user._id}}" data-cy="username-header">
31-
{{user.firstname}} {{user.surname}}
61+
<a class="govuk-header__link" href="/user/{{ user._id }}" data-cy="username-header">
62+
{{ user.firstname }}
63+
{{ user.surname }}
3264
</a>
3365
</li>
3466
<li class="govuk-header__navigation-item">
35-
<a class="govuk-header__link" href="/user/{{user._id}}" data-cy="profile-header">
67+
<a class="govuk-header__link" href="/user/{{ user._id }}" data-cy="profile-header">
3668
Profile
3769
</a>
3870
</li>
@@ -46,6 +78,4 @@
4678
{% endif %}
4779
</div>
4880
</div>
49-
</header>
50-
51-
81+
</header>

gef-ui/templates/index.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
{% include "includes/footer.njk" %}
4747
<script src="/gef/assets/js/main.js" type="text/javascript" integrity="sha512-FzbNufq1YfgPho6SYcKW4eZ4wBHJEPnFN50f/9WNFwLltqksUhSAJ93AP+7AQdYfTCSLPD79pjUai2fvfasFPg==" crossorigin="anonymous"></script>
48-
<script src="/assets/js/govukFrontend.js" type="text/javascript" integrity="sha512-I1Jdj+zpeRra1n0yK5AnISUZ4vJugD+b4LOtOkYEn9flOvVx/QjW11FmwOGEP+KBYk/mwTqQ1MDFvpBmXeKJqw==" crossorigin="anonymous"></script>
48+
<script src="/assets/js/govukFrontend.js" type="text/javascript" integrity="sha512-FCYqqgwMLyRhD+3K520tAkikpg9RfGv3VUQzUqo5CVwjlRxo/Ol56fxOlRhKGRxZ1LvhwYGAkyamg1Y5pX6VFg==" crossorigin="anonymous"></script>
4949
<script src="/assets/js/mojFrontend.js" type="text/javascript" integrity="sha512-Ap7qengYJPIRuxlVyln9ThfoCD/SIeefliy26hN7ZG1ywrC9y2YL9o3kpKHAXT5S2gcUOuMi/GkfYLJtAaIJig==" crossorigin="anonymous"></script>
5050
<script src="/assets/js/maskedInputs.js" type="text/javascript" integrity="sha512-4XTH3IT3oQN/60lRAdBZWXMXq4/L1n5kUoGEftu+nY0Bba/7T0RDIZ62es6v+dCyNJ+uaYZTjWl3nPYv0rR6WA==" crossorigin="anonymous"></script>
5151
{% block scripts %}{% endblock %}

gef-ui/webpack.common.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
resolve: {
2727
// resolves paths in library files that we don't control, pointing them to the root hoisted dependencies
2828
alias: {
29-
'node_modules/govuk-frontend': path.resolve(__dirname, '../node_modules/govuk-frontend/dist'),
29+
'node_modules/govuk-frontend': path.resolve(__dirname, '../node_modules/govuk-frontend'),
3030
'node_modules/@ministryofjustice': path.resolve(__dirname, '../node_modules/@ministryofjustice'),
3131
},
3232
},

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"express-rate-limit": "^6.11.2",
5050
"express-session": "1.17.3",
5151
"form-data": "4.0.0",
52-
"govuk-frontend": "4.6.0",
52+
"govuk-frontend": "^4.8.0",
5353
"http-errors": "^2.0.0",
5454
"imask": "^6.6.3",
5555
"joi": "^17.12.3",

portal/public/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal/public/js/govukFrontend.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal/public/js/govukFrontend.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)