diff --git a/config/index.js b/config/index.js index ed1168408..efc3303ea 100644 --- a/config/index.js +++ b/config/index.js @@ -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')) @@ -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) diff --git a/config/production.yaml b/config/production.yaml index 43f1dd15f..231112b36 100644 --- a/config/production.yaml +++ b/config/production.yaml @@ -10,4 +10,8 @@ redis: { host: 'production-pub-async-redis-eihmmv.serverless.euw2.cache.amazonaws.com', port: '6379' } -url: 'https://publish.digital-land.info/' \ No newline at end of file +url: 'https://publish.digital-land.info/' +smartlook: { + key: '6383ab27d6f6a02f043a518bea629cd232dc0131', + region: 'eu' +} \ No newline at end of file diff --git a/config/test.yaml b/config/test.yaml index 12b980b1c..eaf5428de 100644 --- a/config/test.yaml +++ b/config/test.yaml @@ -1,6 +1,7 @@ asyncRequestApi: { url: http://localhost:8001, - port: 8001 + port: 8001, + requestsEndpoint: 'requests' } aws: { region: eu-west-2, diff --git a/package.json b/package.json index a7861dd7f..6df70f73e 100644 --- a/package.json +++ b/package.json @@ -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", @@ -94,7 +93,8 @@ }, "standard": { "ignore": [ - "performance-test/" + "performance-test/", + "src/views/common/smartlook.js" ] } } diff --git a/src/routes/cookies.js b/src/routes/cookies.js new file mode 100644 index 000000000..211399868 --- /dev/null +++ b/src/routes/cookies.js @@ -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 diff --git a/src/routes/privacy.js b/src/routes/privacy.js new file mode 100644 index 000000000..e2f5a44a3 --- /dev/null +++ b/src/routes/privacy.js @@ -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 diff --git a/src/serverSetup/nunjucks.js b/src/serverSetup/nunjucks.js index 5a7a20e86..e273dbc84 100644 --- a/src/serverSetup/nunjucks.js +++ b/src/serverSetup/nunjucks.js @@ -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]) }) diff --git a/src/serverSetup/routes.js b/src/serverSetup/routes.js index 7d56e5d3a..5945061a1 100644 --- a/src/serverSetup/routes.js +++ b/src/serverSetup/routes.js @@ -3,6 +3,8 @@ 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) @@ -10,4 +12,6 @@ export function setupRoutes (app) { app.use('/accessibility', accessibility) app.use('/api', polling) app.use('/health', health) + app.use('/privacy-notice', privacy) + app.use('/cookies', cookies) } diff --git a/src/views/accessibility.html b/src/views/accessibility.html index a2c034a75..8265355eb 100644 --- a/src/views/accessibility.html +++ b/src/views/accessibility.html @@ -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 @@ -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 diff --git a/src/views/common/smartlook.js b/src/views/common/smartlook.js new file mode 100644 index 000000000..d4cdf752e --- /dev/null +++ b/src/views/common/smartlook.js @@ -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 }}' }) diff --git a/src/views/cookies.html b/src/views/cookies.html new file mode 100644 index 000000000..fce09ec25 --- /dev/null +++ b/src/views/cookies.html @@ -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: + + + + + + + + + + + + + + + + + + + + + +
NamePurposeExpires
cookies_preferences_setLets us know you've seen our cookie message1 year
cookies_policySaves your cookie choices1 year
+ + +### 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NamePurposeExpires
SL_C_23361dd035530_SIDLets us know you’re using the service13 months
SL_L_23361dd035530_SIDLets us know you’re using the service13 months
AWSELBMakes Smartlook quicker to load13 months
SL_C_23361dd035530_DOMAINTemporary cookie to identify our service; it’s removed as soon as our service is detectedAlmost immediately
SMARTLOOK_LS_QUEUED_CHUNKSSends data to Smartlook in small chunks13 months
+ +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 %} diff --git a/src/views/layouts/main.html b/src/views/layouts/main.html index 291d84888..1bb83db7d 100644 --- a/src/views/layouts/main.html +++ b/src/views/layouts/main.html @@ -19,6 +19,13 @@ {% block head %} + {% if smartlookKey %} + {% block smartlook %} + + {% endblock %} + {% endif %} {% endblock %} {% block header %} @@ -60,6 +67,16 @@

Get help

Accessibility + + {% endset %} diff --git a/src/views/privacy-notice.html b/src/views/privacy-notice.html new file mode 100644 index 000000000..4edca430a --- /dev/null +++ b/src/views/privacy-notice.html @@ -0,0 +1,149 @@ +{% 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 privacy notice + + +## Who we are + +Check planning and housing data for England ([check.planning.data.go.uk](check.planning.data.go.uk)) is provided by the Ministry of Housing, Communities and Local Government (MHCLG). + +MHCLG is the data controller for the service. + + +## What personal data we collect + +The personal data we collect from you includes: + + + +* your name and email address when you email a planning and housing dataset to us +* your name and email address if you send us feedback + + +## Other data we collect + +We also record how you use the service, including which pages you visit and what you click on. This helps us to improve the service experience and make sure it’s meeting your needs. No personal data is recorded. + + +## Why we need your personal data + +We collect your personal data to: + + + +* respond to any feedback you send us, if you have asked us to +* contact you with any feedback we have about a planning and housing dataset you have sent us + + +## Why our use of your personal data is lawful + +The legal basis for processing all personal data is that it’s necessary: + + + +* to perform a task in the public interest +* in the exercise of our functions as a government department + + +## How we use your personal data + +The personal data we collect may be shared with other government departments, agencies and public bodies. It may also be shared with our technology suppliers, for example our hosting provider. + +We will share your personal data if we are required to do so by law - for example, by court order, or to prevent fraud or other crime. + +We will not: + + + +* sell or rent your personal data to third parties +* share your personal data with third parties for marketing purposes + + +## How long we keep your personal data + +Personal data collected when you submit planning and housing data or a feedback form on the service is kept for as long as we need the personal data for the purposes of research, security or delivery of the service. + + +## Children’s privacy protection + +Our services are not designed for, or intentionally targeted at, children 13 years of age or younger. We do not intentionally collect or maintain personal data about anyone under the age of 13. + + +## Where your personal data is processed and stored + +We design, build and run our systems to make sure that your personal data is as safe as possible at all stages, both while it’s processed and when it’s stored. + +All personal data is stored in the [European Economic Area](https://www.gov.uk/eu-eea) (EEA). + +Where personal data processing happens in the US, suppliers need to meet the certification standards set out in the [UK-US data bridge](https://www.gov.uk/government/publications/uk-us-data-bridge-supporting-documents/uk-us-data-bridge-explainer) agreement. This facilitates flows of personal data to certified US companies that have opted in to the EU-US Data Privacy Framework. + + +## How we protect your personal data and keep it secure + +We are committed to doing all that we can to keep your personal data secure. We have set up systems and processes to prevent unauthorised access or disclosure of your personal data - for example, we protect your personal data using varying levels of encryption. + +We also make sure that any third parties that we deal with keep all personal data they process on our behalf secure. + + +## Your data protection rights + +You have the right to request: + + + +* information about how your personal data is processed +* a copy of that personal data +* that anything inaccurate in your personal data is corrected immediately + +You can also: + + + +* raise an objection about how your personal data is processed +* request that your personal data is erased if there is no longer a justification for it +* ask that the processing of your personal data is restricted in certain circumstances + +If you have any of these requests, get in contact with our Knowledge and Information Access Team. + +[Read the MHCLG personal information charter](https://www.gov.uk/government/organisations/ministry-of-housing-communities-local-government/about/personal-information-charter). + + +## Contact us or make a complaint + +Contact the Knowledge and Information Access team if you: + + + +* have a question about anything in this privacy notice +* think that your personal data has been misused or mishandled + +Knowledge and Information Access Team \ +[dataprotection@levellingup.gov.uk](mailto:dataprotection@levellingup.gov.uk) \ +Ministry of Housing, Communities and Local Government \ +2nd floor NW, Fry Building \ +2 Marsham Street \ +London \ +SW1P 4DF \ +United Kingdom + +You can also make a complaint to the independent regulator the Information Commissioner's Office (ICO) at [https://ico.org.uk/make-a-complaint/](https://ico.org.uk/make-a-complaint/) + + +## Keeping our privacy notice up to date + +We may change this privacy notice. Any changes will apply to you and your personal data immediately. You should regularly review this notice. + +This notice was last updated on 21 June 2024. + + +{% endset %} + +{% block content %} + + {{markdownContent | govukMarkdown(headingsStartWith="xl") | safe}} + +{% endblock content %}