Skip to content

Commit

Permalink
Merge branch 'main' into rosado/logging
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGoodall authored Jul 15, 2024
2 parents 9376d17 + 87ef556 commit 8c3c154
Show file tree
Hide file tree
Showing 13 changed files with 334 additions and 8 deletions.
3 changes: 1 addition & 2 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import HmpoConfig from 'hmpo-config'
import yaml from 'js-yaml'
import fs from 'fs'
import _ from 'lodash'

const readConfig = (config) => {
return yaml.load(fs.readFileSync(`./config/${config}.yaml`, 'utf8'))
Expand All @@ -20,7 +19,7 @@ const getConfig = () => {

const customConfig = readConfig(environment)

const combinedConfig = _.merge({}, defaultConfig, customConfig)
const combinedConfig = Object.assign({}, defaultConfig, customConfig)

const config = new HmpoConfig()
config.addConfig(combinedConfig)
Expand Down
6 changes: 5 additions & 1 deletion config/production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ redis: {
host: 'production-pub-async-redis-eihmmv.serverless.euw2.cache.amazonaws.com',
port: '6379'
}
url: 'https://publish.digital-land.info/'
url: 'https://publish.digital-land.info/'
smartlook: {
key: '6383ab27d6f6a02f043a518bea629cd232dc0131',
region: 'eu'
}
3 changes: 2 additions & 1 deletion config/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
asyncRequestApi: {
url: http://localhost:8001,
port: 8001
port: 8001,
requestsEndpoint: 'requests'
}
aws: {
region: eu-west-2,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"hmpo-form-wizard": "^13.0.0",
"hmpo-i18n": "^6.0.1",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"maplibre-gl": "^4.1.0",
"multer": "^1.4.5-lts.1",
"notifications-node-client": "^8.2.0",
Expand All @@ -94,7 +93,8 @@
},
"standard": {
"ignore": [
"performance-test/"
"performance-test/",
"src/views/common/smartlook.js"
]
}
}
11 changes: 11 additions & 0 deletions src/routes/cookies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import express from 'express'
import nunjucks from 'nunjucks'

const router = express.Router()

router.get('/', (req, res) => {
const cookiesPage = nunjucks.render('cookies.html', {})
res.send(cookiesPage)
})

export default router
11 changes: 11 additions & 0 deletions src/routes/privacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import express from 'express'
import nunjucks from 'nunjucks'

const router = express.Router()

router.get('/', (req, res) => {
const privacyPage = nunjucks.render('privacy-notice.html', {})
res.send(privacyPage)
})

export default router
5 changes: 5 additions & 0 deletions src/serverSetup/nunjucks.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export function setupNunjucks ({ app, dataSubjects }) {
feedbackLink: config.feedbackLink
}

if ('smartlook' in config) {
globalValues.smartlookKey = config.smartlook.key
globalValues.smartlookRegion = config.smartlook.region
}

Object.keys(globalValues).forEach((key) => {
nunjucksEnv.addGlobal(key, globalValues[key])
})
Expand Down
4 changes: 4 additions & 0 deletions src/serverSetup/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import endpointSubmissionFormFormWisard from '../routes/form-wizard/endpoint-sub
import accessibility from '../routes/accessibility.js'
import polling from '../routes/api.js'
import health from '../routes/health.js'
import privacy from '../routes/privacy.js'
import cookies from '../routes/cookies.js'

export function setupRoutes (app) {
app.use('/', checkFormWizard)
app.use('/submit', endpointSubmissionFormFormWisard)
app.use('/accessibility', accessibility)
app.use('/api', polling)
app.use('/health', health)
app.use('/privacy-notice', privacy)
app.use('/cookies', cookies)
}
4 changes: 2 additions & 2 deletions src/views/accessibility.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This accessibility statement applies to the check planning and housing data for England service (publish.development.digital-land.info).

This service is run by the Department for Levelling Up, Housing and Communities (DLUHC). We want as many people as possible to be able to use this service. For example, that means you should be able to:
This service is run by the Ministry of Housing, Communities and Local Government (MHCLG). We want as many people as possible to be able to use this service. For example, that means you should be able to:

- change colours, contrast levels and fonts using browser or device settings
- zoom in up to 400% without the text spilling off the screen
Expand Down Expand Up @@ -40,7 +40,7 @@

## Technical information about this service's accessibility

The Department for Levelling Up, Housing and Communities (DLUHC) is committed to making this service accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.
The Ministry of Housing, Communities and Local Government (MHCLG) is committed to making this service accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.

### Compliance status

Expand Down
6 changes: 6 additions & 0 deletions src/views/common/smartlook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
window.smartlook || (function (d) {
var o = smartlook = function () { o.api.push(arguments) }; const h = d.getElementsByTagName('head')[0]
const c = d.createElement('script'); o.api = new Array(); c.async = true; c.type = 'text/javascript'
c.charset = 'utf-8'; c.src = 'https://web-sdk.smartlook.com/recorder.js'; h.appendChild(c)
})(document)
smartlook('init', '{{ smartlookKey }}', { region: '{{ smartlookRegion }}' })
119 changes: 119 additions & 0 deletions src/views/cookies.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{% extends "layouts/main.html" %}

{% set pageName = 'Accessibility statement for check planning and housing data for England' %}

{% set markdownContent %}

# Check planning and housing data for England cookies notice

The Check planning and housing data for England service puts cookies onto your computer to collect information about how you use the service. This helps us to:



* update and improve the service based on your needs
* remember the notifications you’ve seen so that we do not show them to you again

We do not collect any personal information that could be used to identify you. Read our [privacy notice](/privacy-notice/) to see what personal information we do collect.


## Essential cookies

Essential cookies are needed for the service to work. We do not need to ask for permission to use them.


## How cookies are used on the Check planning and housing data for England service


### Our cookie banner (essential)

When you first visit the Check planning and housing data for England service, you will see a banner asking if you accept cookies. We’ll store a cookie to remember which option you selected. You can always change your mind and change your choice on this page.

Next time you visit the site, we will remember your preference and not show the banner again.

To do this, the Check planning and housing data for England service sets the following cookies:

<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Name</th>
<th scope="col" class="govuk-table__header">Purpose</th>
<th scope="col" class="govuk-table__header">Expires</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">cookies_preferences_set</th>
<td class="govuk-table__cell">Lets us know you've seen our cookie message</td>
<td class="govuk-table__cell">1 year</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">cookies_policy</th>
<td class="govuk-table__cell">Saves your cookie choices</td>
<td class="govuk-table__cell">1 year</td>
</tr>
</tbody>
</table>


### Smartlook cookies (optional)

We use Smartlook to measure how you use the Check planning and housing data for England service. This helps us to improve the service experience and make sure it’s meeting your needs. No personal data will be stored in the cookies.

Smartlook sets cookies that store information about:



* which parts of the service you visit
* how long you spend on each part
* what you click on the service

The cookies do not store any information you add to the service.


<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Name</th>
<th scope="col" class="govuk-table__header">Purpose</th>
<th scope="col" class="govuk-table__header">Expires</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">SL_C_23361dd035530_SID</th>
<td class="govuk-table__cell">Lets us know you’re using the service</td>
<td class="govuk-table__cell">13 months</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">SL_L_23361dd035530_SID</th>
<td class="govuk-table__cell">Lets us know you’re using the service</td>
<td class="govuk-table__cell">13 months</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">AWSELB</th>
<td class="govuk-table__cell">Makes Smartlook quicker to load</td>
<td class="govuk-table__cell">13 months</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">SL_C_23361dd035530_DOMAIN</th>
<td class="govuk-table__cell">Temporary cookie to identify our service; it’s removed as soon as our service is detected</td>
<td class="govuk-table__cell">Almost immediately</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">SMARTLOOK_LS_QUEUED_CHUNKS</th>
<td class="govuk-table__cell">Sends data to Smartlook in small chunks</td>
<td class="govuk-table__cell">13 months</td>
</tr>
</tbody>
</table>

You can [opt out](https://help.smartlook.com/docs/opt-out-of-smartlook) of Smartlook.


{% endset %}

{% block content %}

{{markdownContent | govukMarkdown(headingsStartWith="xl") | safe}}

{% endblock content %}
17 changes: 17 additions & 0 deletions src/views/layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@

{% block head %}
<link rel="stylesheet" href="/public/stylesheets/index.css">
{% if smartlookKey %}
{% block smartlook %}
<script type='text/javascript'>
{% include "common/smartlook.js" %}
</script>
{% endblock %}
{% endif %}
{% endblock %}

{% block header %}
Expand Down Expand Up @@ -60,6 +67,16 @@ <h2 class="govuk-heading-m">Get help</h2>
Accessibility
</a>
</li>
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/privacy-notice">
Privacy
</a>
</li>
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="/cookies">
Cookies
</a>
</li>
</ul>
{% endset %}

Expand Down
Loading

0 comments on commit 8c3c154

Please sign in to comment.