From 4ec15aaf213d02d18fc14fdb2f51c4fe6dee45c4 Mon Sep 17 00:00:00 2001 From: John Shields Date: Fri, 6 Aug 2021 14:29:57 +0100 Subject: [PATCH] Beta Release 3.14.0 (#226) * Amend feedback links - FSR-310 (#217) * FSR-310: Amend feedback survey links. * FSR-310: Only display feedback link fo active warnings/alerts. Co-authored-by: John Shields * Feature/error test (#218) * Adding test error route * sonarcloud * slightly updating error logic for joi validations * sonarcloud * test for getError in server * spliting error log between log and error files * removing detail from log error * Fix json for mocked external location search. (#221) Co-authored-by: John Shields * Feature/fsr 332 (#219) * added route and service data in broswer * added data for FFOI stations * fixed linting issues * sorted array of values * fine tuning * added unit tests and size of file on html * Sonar.....Cloud * made changes based on feedback from show and tell * removed unneeded npm package * removed code smells * Feature/fsr 333 fix (#222) * removed forecast values not shown on the map * csv now only has data shown on the graph * fixed failing unit-tests * fixed failing unit tests again * refactor for sonar cloud * refactored * Feature/fsr 333 (#223) * Accessibility amendments following from DAC review https://eaflood.atlassian.net/browse/FSR-333 * DAC-1 - Aside fix * DAC-2 Form label * DAC-4 - Visual headings * DAC-9 - Alt text removed * DAC-12 - Bleed through * DAC-16 - Title removed * DAC-18 - Visual only * OL-1 - Heading hidden and empty p tag removed * LST 1-4 - Predictable inpout and status message * LST 5-6 - Aria controls and urlencode * ST-4-7 - Station page * DAC-16 - mAOD fix * OL-1 - Empty p tag fix * NAV-3 - Repeatable content * DAC-1 - Aside fix * DAC-2 Form label * DAC-4 - Visual headings * DAC-9 - Alt text removed * DAC-12 - Bleed through * DAC-16 - Title removed * DAC-18 - Visual only * OL-1 - Heading hidden and empty p tag removed * LST 1-4 - Predictable inpout and status message * LST 5-6 - Aria controls and urlencode * ST-4-7 - Station page * DAC-16 - mAOD fix * OL-1 - Empty p tag fix * NAV-3 - Repeatable content * removal of back button * removed CS script casuing 404 * trying to stop sonar cloud seeing duplication * removing text in alt tag * removed duplicate block out to a partial * replaced partial with different part of page * added partial to second page to cut duplication * Changes to address testing feedback * updated unit test to look for historic river levels button * linting * added line at the end of file Co-authored-by: danleech-defra Co-authored-by: John Shields * Release 3.14.0 prep (#225) * Release 3.14.0 prep * Update version number in release doc. Co-authored-by: John Shields Co-authored-by: John Shields Co-authored-by: Tedd Co-authored-by: nikiwycherley Co-authored-by: danleech-defra --- mock/location/find.json | 16 +- package-lock.json | 2 +- package.json | 2 +- release-docs/beta-3.14.0.txt | 39 + server/models/views/find-location.js | 5 + server/models/views/location.js | 2 +- server/models/views/national.js | 2 +- server/models/views/station.js | 2 +- server/models/views/target-area.js | 2 +- server/plugins/error-pages.js | 9 +- server/plugins/router.js | 4 +- server/routes/error.js | 7 + server/routes/station-csv.js | 98 ++ server/services/flood.js | 4 + .../src/js/components/toggle-list-display.js | 1 - server/src/js/core.js | 22 +- server/src/js/pages/alerts-and-warnings.js | 3 - server/src/js/pages/find-location.js | 2 - server/src/js/pages/impacts.js | 3 - server/src/js/pages/location.js | 3 - server/src/js/pages/river-and-sea-levels.js | 3 - server/src/js/pages/station.js | 5 +- server/src/js/pages/target-area.js | 3 - server/src/sass/application.scss | 1 + server/src/sass/components/_flood-list.scss | 6 +- .../sass/components/_flood-location-link.scss | 8 + server/src/sass/components/_flood-tabs.scss | 6 +- .../src/sass/components/_related-items.scss | 4 + server/src/sass/objects/_buttons.scss | 58 +- server/views/about-levels.html | 6 +- server/views/alerts-and-warnings.html | 12 +- server/views/find-location.html | 24 +- server/views/layout.html | 1 - server/views/location-error.html | 11 - server/views/location-not-found.html | 11 - server/views/location.html | 23 +- server/views/national.html | 4 +- server/views/partials/back-button.html | 7 - server/views/partials/feedback.html | 2 +- .../partials/outlook-region-messages.html | 1 - server/views/partials/outlook-region.html | 38 +- server/views/partials/related-content.html | 4 +- .../three-levels-releated-content.html | 28 + server/views/plan-ahead-for-flooding.html | 77 +- server/views/privacy-notice.html | 4 +- server/views/recovering-after-a-flood.html | 4 +- server/views/river-and-sea-levels.html | 304 ++-- server/views/start-page.html | 103 +- server/views/station.html | 25 +- server/views/target-area.html | 10 +- server/views/terms-and-conditions.html | 4 +- server/views/what-happens-after-a-flood.html | 6 +- server/views/what-to-do-in-a-flood.html | 32 +- test/data/csvForecastData.json | 1475 +++++++++++++++++ test/routes/error.js | 60 + test/routes/station-csv.js | 239 +++ test/routes/station.js | 4 + test/services/flood.js | 15 + webpack.config.js | 3 +- 59 files changed, 2388 insertions(+), 471 deletions(-) create mode 100644 release-docs/beta-3.14.0.txt create mode 100644 server/routes/error.js create mode 100644 server/routes/station-csv.js delete mode 100644 server/src/js/pages/find-location.js create mode 100644 server/src/sass/components/_flood-location-link.scss delete mode 100644 server/views/partials/back-button.html create mode 100644 server/views/partials/three-levels-releated-content.html create mode 100644 test/data/csvForecastData.json create mode 100644 test/routes/error.js create mode 100644 test/routes/station-csv.js diff --git a/mock/location/find.json b/mock/location/find.json index ebb39e74f..29727b31c 100644 --- a/mock/location/find.json +++ b/mock/location/find.json @@ -1,11 +1,17 @@ { "name": "London", "center": [ -0.12623600661754608, 51.500152587890625 ], - "bbox": [ - -1.0282469032939199, - 51.1557550552987, - 0.8240108759451693, - 51.880039887087904 + "bbox2k": [ + -1.03198533837149, + 51.1534935075975, + 0.8275523144418941, + 51.88222730734423 + ], + "bbox10k": [ + -1.1484905162767916, + 51.0815544369866, + 0.9440574923471953, + 51.9541663063661 ], "address": "London, London", "isEngland": { "is_england": true }, diff --git a/package-lock.json b/package-lock.json index ab3bbc9bc..e13158d3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "flood-app", - "version": "3.13.0", + "version": "3.14.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9dddf0edf..9032ee3f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flood-app", - "version": "3.13.0", + "version": "3.14.0", "description": "Flood risk app", "main": "index.js", "repository": "github:defra/flood-app", diff --git a/release-docs/beta-3.14.0.txt b/release-docs/beta-3.14.0.txt new file mode 100644 index 000000000..94f8ab048 --- /dev/null +++ b/release-docs/beta-3.14.0.txt @@ -0,0 +1,39 @@ +# Service refresh release 3.14.0 Tuesday 10th August 2021 + +# Tickets + +https://eaflood.atlassian.net/projects/FSR/versions/15493/tab/release-report-all-issues + + +## Release notes taken from Jira + +# Release notes - FIS Service Refresh - Version Release 7 + +### Bug + +[FSR-397] (https://eaflood.atlassian.net/browse/FSR-397) Prod issue - share links not working in live as expected + +### Story + +[FSR-310] (https://eaflood.atlassian.net/browse/FSR-310) Amendments to surveys on Beta service + +[FSR-332] (https://eaflood.atlassian.net/browse/FSR-332) Ability to download .csv output for river/sea/groundwater page + +[FSR-333] (https://eaflood.atlassian.net/browse/FSR-333) Accessibility amendments following from DAC review + +[FSR-334] (https://eaflood.atlassian.net/browse/FSR-334) Amendments to river/coastal/groundwater station page to meet accessibility + +[FSR-335] (https://eaflood.atlassian.net/browse/FSR-335) Amendments to river/sea/groundwater list page to meet accessibility + +[FSR-352] (https://eaflood.atlassian.net/browse/FSR-352) Amendments to navigation links on Beta service + +[FSR-353] (https://eaflood.atlassian.net/browse/FSR-353) Amendment to Outlook regional view + +[FSR-399] (https://eaflood.atlassian.net/browse/FSR-399) Accessibility - removing back button logic from the Beta + + +# Webops Instructions + +Execute job: LFW_{stage}_04_UPDATE_FLOOD_APP_AND_SERVICE_PIPELINE + +Confirm with developers that deployment was successful. diff --git a/server/models/views/find-location.js b/server/models/views/find-location.js index 58eaeeda7..5106a9a05 100644 --- a/server/models/views/find-location.js +++ b/server/models/views/find-location.js @@ -19,6 +19,11 @@ class ViewModel { this.locationInput = { label: { + text: 'Where do you want to check?', + classes: 'govuk-label--l', + isPageHeading: true + }, + hint: { text: 'Town, city or postcode in England' }, id: 'location', diff --git a/server/models/views/location.js b/server/models/views/location.js index 77207352d..1fbde5c32 100644 --- a/server/models/views/location.js +++ b/server/models/views/location.js @@ -20,7 +20,7 @@ class ViewModel { metaDescription: `Nearby flood alerts and warnings; latest river and sea levels and flood risk advice for residents living in the ${title} area.`, floodFisUrl, dateFormatted: 'Up to date as of ' + moment.tz('Europe/London').format('h:mma') + ' on ' + moment.tz('Europe/London').format('D MMMM YYYY'), - feedback: true, + feedback: false, dataError }) diff --git a/server/models/views/national.js b/server/models/views/national.js index dd15464e0..77ca33579 100644 --- a/server/models/views/national.js +++ b/server/models/views/national.js @@ -23,7 +23,7 @@ class ViewModel { highestSeverityId: floods.highestSeverityId, dateFormatted: `${moment().tz(tz).format('h:mma')} on ${moment().tz(tz).format('D MMMM YYYY')}`, dateUTC: moment().tz(tz).format(), - feedback: true, + feedback: false, hasWarningsRemoved: floods._groups[3].name === 4 && floods._groups[3].count > 0, bingMaps: bingKeyMaps, outlookTimestamp: `${formatDate(outlook._timestampOutlook, 'h:mma')} on ${formatDate(outlook._timestampOutlook, 'D MMMM YYYY')}`, diff --git a/server/models/views/station.js b/server/models/views/station.js index 575e23a5e..1b6d6ddab 100644 --- a/server/models/views/station.js +++ b/server/models/views/station.js @@ -25,7 +25,7 @@ class ViewModel { */ Object.assign(this, { - feedback: true, + feedback: false, bingMaps: config.bingKeyMaps }) // Group warnings/alerts by severity level diff --git a/server/models/views/target-area.js b/server/models/views/target-area.js index 8778ad84f..e994bdee1 100644 --- a/server/models/views/target-area.js +++ b/server/models/views/target-area.js @@ -62,7 +62,7 @@ class ViewModel { parentAreaAlert: parentAreaAlert, areaDescription: areaDescription, targetArea: area.code, - feedback: true, + feedback: false, mapTitle, bingMaps: bingKeyMaps }, options) diff --git a/server/plugins/error-pages.js b/server/plugins/error-pages.js index 061e698d8..23e9fcec6 100644 --- a/server/plugins/error-pages.js +++ b/server/plugins/error-pages.js @@ -20,14 +20,17 @@ module.exports = { return h.view('404').code(404) } + // gets captured in pm2 log file, details sent to error file below request.log('error', { statusCode: statusCode, - data: response.data, situation: response.message }) - // Normally a joi request query param validation error - if (statusCode === 400) { + // gets captured in pm2 error file + console.error(response) + + // 400 && params input is joi error + if (statusCode === 400 && response.message === 'Invalid request params input') { return h.view('404').code(404) } diff --git a/server/plugins/router.js b/server/plugins/router.js index 293d10460..16a1392ba 100644 --- a/server/plugins/router.js +++ b/server/plugins/router.js @@ -26,7 +26,9 @@ const routes = [].concat( require('../routes/privacy-notice'), require('../routes/status'), require('../routes/stations-overview'), - require('../routes/about-levels') + require('../routes/about-levels'), + require('../routes/error'), + require('../routes/station-csv') ) module.exports = { diff --git a/server/routes/error.js b/server/routes/error.js new file mode 100644 index 000000000..c7fe14e19 --- /dev/null +++ b/server/routes/error.js @@ -0,0 +1,7 @@ +const floodService = require('../services/flood') + +module.exports = { + method: 'GET', + path: '/error', + handler: () => floodService.getError() +} diff --git a/server/routes/station-csv.js b/server/routes/station-csv.js new file mode 100644 index 000000000..ca0e258c9 --- /dev/null +++ b/server/routes/station-csv.js @@ -0,0 +1,98 @@ +const floodService = require('../services/flood') +const moment = require('moment-timezone') + +module.exports = { + method: 'GET', + path: '/station-csv/{id}/{direction?}', + handler: async (request, h) => { + const { id } = request.params + let { direction } = request.params + + direction = direction === 'downstream' ? 'd' : 'u' + + const station = await floodService.getStationById(id, direction) + + const stationName = station.external_name.replace(/\s/g, '-') + + const [telemetry, thresholds] = await Promise.all([ + floodService.getStationTelemetry(id, direction), + floodService.getStationForecastThresholds(id) + ]) + + this.telemetry = telemetry + + this.telemetry.forEach(function (item) { + item.type = 'observed' + item.ts = moment.utc(item.ts).format() + }) + + // Forecast station + if (thresholds.length) { + const values = await floodService.getStationForecastData(station.wiski_id) + + const forecast = values.SetofValues[0].Value + + const forecastData = forecast.map(item => { + const itemDate = item.$.date + const itemTime = item.$.time + const date = moment(`${itemDate} ${itemTime}`).format('YYYY-MM-DDTHH:mm') + 'Z' + return { ts: date, _: item._, type: 'forecast' } + }) + + // Truncate forecast data to be 36 hours from forecast creation + const forecastStart = moment(this.telemetry[0].ts) + + this.truncateDate = moment(forecastStart).add(36, 'hours') + + forecastData.forEach(function (value) { + value.ts = moment(value.ts) + + if (value.ts.isBefore(forecastStart) || value.ts.isAfter(this.truncateDate)) { + return + } + value.ts = moment.utc(value.ts).format() + + this.telemetry.push(value) + }, this) + } + + this.telemetry.sort(function (a, b) { + return new Date(a.ts) - new Date(b.ts) + }) + + if (thresholds.length) { + this.csvString = [ + [ + 'Timestamp (UTC)', + 'Height (m)', + 'Type(observed/forecast)' + ], + ...this.telemetry.map(item => [ + item.ts, + item._, + item.type + ]) + ] + .map(e => e.join(',')) + .join('\n') + } else { + this.csvString = [ + [ + 'Timestamp (UTC)', + 'Height (m)' + ], + ...this.telemetry.map(item => [ + item.ts, + item._ + ]) + ] + .map(e => e.join(',')) + .join('\n') + } + + const response = h.response(this.csvString) + response.type('text/csv') + response.header('Content-disposition', `attachment; filename=${stationName}-height-data.csv`) + return response + } +} diff --git a/server/services/flood.js b/server/services/flood.js index a9aeca78c..0cd80d885 100644 --- a/server/services/flood.js +++ b/server/services/flood.js @@ -193,5 +193,9 @@ module.exports = { getStationsByRadius (x, y, rad) { const param3 = rad ? `/${rad}` : '' return util.getJson(`${serviceUrl}/stations-by-radius/${x}/${y}${param3}`) + }, + + getError () { + return util.getJson(`${serviceUrl}/error`) } } diff --git a/server/src/js/components/toggle-list-display.js b/server/src/js/components/toggle-list-display.js index 026ddffdb..030eb8d1e 100644 --- a/server/src/js/components/toggle-list-display.js +++ b/server/src/js/components/toggle-list-display.js @@ -15,7 +15,6 @@ const ToggleListDisplay = (container, options) => { const toggleDisplay = () => { // Toggle Button button.innerText = `${isExpanded ? 'Hide' : 'Show'} ${options.btnText}` - button.setAttribute('aria-expanded', isExpanded) // Toggle list forEach(items, (item) => { item.style.display = isExpanded ? 'block' : 'none' diff --git a/server/src/js/core.js b/server/src/js/core.js index 013be6878..c65fd7d93 100755 --- a/server/src/js/core.js +++ b/server/src/js/core.js @@ -46,20 +46,14 @@ window.flood = { const v = window.location.search.match(new RegExp('(?:[?&]' + name + '=)([^&]+)')) return v ? v[1] : null }, - addBrowserBackButton: () => { - const container = document.getElementById('browserBackContainer') - if (container) { - const hyperlink = document.createElement('a') - hyperlink.href = document.referrer - hyperlink.href = hyperlink.pathname + hyperlink.search - hyperlink.innerText = 'Back' - hyperlink.className = 'govuk-back-link govuk-!-margin-bottom-7 govuk-!-margin-right-2' - hyperlink.addEventListener('click', function (e) { - e.preventDefault() - window.history.back() - }) - container.appendChild(hyperlink) - } + getCookie: (name) => { + const v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)') + return v ? v[2] : null + }, + setCookie: (name, value, days) => { + const d = new Date() + d.setTime(d.getTime() + 24 * 60 * 60 * 1000 * days) + document.cookie = name + '=' + value + ';path=/;expires=' + d.toGMTString() } } } diff --git a/server/src/js/pages/alerts-and-warnings.js b/server/src/js/pages/alerts-and-warnings.js index 9cf27768a..4077b7f1d 100644 --- a/server/src/js/pages/alerts-and-warnings.js +++ b/server/src/js/pages/alerts-and-warnings.js @@ -7,9 +7,6 @@ import '../components/map/layers' import '../components/map/container' import '../components/map/live' -// Add browser back button -window.flood.utils.addBrowserBackButton() - if (document.getElementById('map')) { // Create LiveMap window.flood.maps.createLiveMap('map', { diff --git a/server/src/js/pages/find-location.js b/server/src/js/pages/find-location.js deleted file mode 100644 index c631733fa..000000000 --- a/server/src/js/pages/find-location.js +++ /dev/null @@ -1,2 +0,0 @@ -// Add browser back button -window.flood.utils.addBrowserBackButton() diff --git a/server/src/js/pages/impacts.js b/server/src/js/pages/impacts.js index 6b27bf444..1fd52dfad 100644 --- a/server/src/js/pages/impacts.js +++ b/server/src/js/pages/impacts.js @@ -6,6 +6,3 @@ import '../components/map/styles' import '../components/map/layers' import '../components/map/container' import '../components/map/live' - -// Add browser back button -window.flood.utils.addBrowserBackButton() diff --git a/server/src/js/pages/location.js b/server/src/js/pages/location.js index 02119712d..fed0884d9 100644 --- a/server/src/js/pages/location.js +++ b/server/src/js/pages/location.js @@ -8,9 +8,6 @@ import '../components/map/container' import '../components/map/live' import '../components/map/outlook' -// Add browser back button -window.flood.utils.addBrowserBackButton() - // Create LiveMap if (document.getElementById('map')) { window.flood.maps.createLiveMap('map', { diff --git a/server/src/js/pages/river-and-sea-levels.js b/server/src/js/pages/river-and-sea-levels.js index e151d8fcd..f36735481 100644 --- a/server/src/js/pages/river-and-sea-levels.js +++ b/server/src/js/pages/river-and-sea-levels.js @@ -9,9 +9,6 @@ import '../components/map/live' import '../components/filter' import '../components/top-link' -// Add browser back button -window.flood.utils.addBrowserBackButton() - // Create LiveMap if (document.getElementById('map')) { window.flood.maps.createLiveMap('map', { diff --git a/server/src/js/pages/station.js b/server/src/js/pages/station.js index 7bceea899..9e3b853ff 100644 --- a/server/src/js/pages/station.js +++ b/server/src/js/pages/station.js @@ -8,8 +8,7 @@ import '../components/map/layers' import '../components/map/container' import '../components/map/live' import '../components/toggle-list-display' -// Add browser back button -window.flood.utils.addBrowserBackButton() + // Create LiveMap window.flood.maps.createLiveMap('map', { btnText: 'View map', @@ -61,7 +60,7 @@ if (chart) { // Add threshold buttons Array.from(document.querySelectorAll('.defra-flood-impact-list__value')).forEach(value => { const button = document.createElement('button') - button.innerHTML = 'Show on chart' + button.innerHTML = 'Show on chart (Visual only)' button.className = 'defra-button-text-s' button.addEventListener('click', function (e) { lineChart.addThreshold({ diff --git a/server/src/js/pages/target-area.js b/server/src/js/pages/target-area.js index 6166acdb8..e995e9a5f 100644 --- a/server/src/js/pages/target-area.js +++ b/server/src/js/pages/target-area.js @@ -7,9 +7,6 @@ import '../components/map/layers' import '../components/map/container' import '../components/map/live' -// Add browser back button -window.flood.utils.addBrowserBackButton() - // Create LiveMap window.flood.maps.createLiveMap('map', { btnText: `View map of the flood ${window.flood.model.area.code.slice(4, 5).toLowerCase() === 'w' ? 'warning' : 'alert'} area`, diff --git a/server/src/sass/application.scss b/server/src/sass/application.scss index 16ab7d08f..9b8064d02 100644 --- a/server/src/sass/application.scss +++ b/server/src/sass/application.scss @@ -57,6 +57,7 @@ $govuk-breakpoints: ( @import "components/context-footer"; @import "components/feedback"; @import "components/top-link"; +@import "components/flood-location-link"; @import "components/toggle-list-display"; @import "components/social"; diff --git a/server/src/sass/components/_flood-list.scss b/server/src/sass/components/_flood-list.scss index c34d2181d..aebdef231 100644 --- a/server/src/sass/components/_flood-list.scss +++ b/server/src/sass/components/_flood-list.scss @@ -14,6 +14,7 @@ margin: 0px; } &__group { + padding-top:0px; border-bottom:1px solid govuk-colour('black'); &:last-child { border:none; @@ -24,9 +25,10 @@ margin-top: 20px; margin-bottom: 5px; @include govuk-font($size: 24, $weight: bold); - span { + & + p { @include govuk-font($size: 19); - display:block; + margin-top: -5px; + margin-bottom: 0px; } } &__title-column { diff --git a/server/src/sass/components/_flood-location-link.scss b/server/src/sass/components/_flood-location-link.scss new file mode 100644 index 000000000..9cd14332b --- /dev/null +++ b/server/src/sass/components/_flood-location-link.scss @@ -0,0 +1,8 @@ +.defra-flood-location-link { + @extend .govuk-back-link; + padding-left: 0px; + &:before { + border: 0px; + display: none; + } +} \ No newline at end of file diff --git a/server/src/sass/components/_flood-tabs.scss b/server/src/sass/components/_flood-tabs.scss index b9f317858..48f2680c4 100644 --- a/server/src/sass/components/_flood-tabs.scss +++ b/server/src/sass/components/_flood-tabs.scss @@ -20,7 +20,11 @@ display: none; } .govuk-tabs__title { - @include defra-visually-hidden(); + display: none; + @include mq ($from: tablet) { + display: block; + @include defra-visually-hidden(); + } } border-bottom:1px solid $govuk-border-colour; margin-bottom:10px; diff --git a/server/src/sass/components/_related-items.scss b/server/src/sass/components/_related-items.scss index 6b3d35cf7..33ffd6a39 100755 --- a/server/src/sass/components/_related-items.scss +++ b/server/src/sass/components/_related-items.scss @@ -1,6 +1,10 @@ .defra-related-items { border-top: 2px solid govuk-colour("blue"); padding-top: govuk-spacing(3); + margin-top: 20px; + @include mq ($from: tablet) { + margin-top: 0px; + } } .defra-related-items .govuk-list > li { diff --git a/server/src/sass/objects/_buttons.scss b/server/src/sass/objects/_buttons.scss index ca8befb12..c69ff1f41 100644 --- a/server/src/sass/objects/_buttons.scss +++ b/server/src/sass/objects/_buttons.scss @@ -11,7 +11,6 @@ top:-1px; width:13px; height:15px; - background: transparent; background-image: svg-url(''); background-color:transparent; background-size:13px 15px; @@ -73,13 +72,9 @@ top: 3px; } } - &:hover:before { + &:hover:not(:active):not(:focus):before { background-image: svg-url(''); } - &:focus:before, - &:active:before { - background-image: svg-url(''); - } &-s { @extend .defra-button-map; padding-left:17px; @@ -90,14 +85,9 @@ } &-s:before { top:0px; - background-size:12px 16px; - height:16px; - width:12px; - @include mq ($from: tablet) { - background-size:13.5px 18px; - height:18px; - width:13.5px; - } + background-size:13.5px 18px; + height:18px; + width:13.5px; } span { display: inline-block; @@ -114,3 +104,43 @@ } } +// Download button +.defra-button-download { + @extend .defra-button-text; + position:relative; + display:inline-block; + padding-left:21px; + &:before { + content: ""; + position: absolute; + top:0px; + left:1px; + background-image: svg-url(''); + background-color:transparent; + background-size:13px 17px; + background-repeat: no-repeat; + background-position: top left; + height:17px; + width:13px; + @include mq ($from: tablet) { + top: 1px; + } + } + &:hover:before { + background-image: svg-url(''); + } + &:focus:before, + &:active:before { + background-image: svg-url(''); + } + &-s { + @extend .defra-button-download; + @include govuk-font($size: 16); + } + &-s:before { + top:0px; + @include mq ($from: tablet) { + top: 1px; + } + } +} diff --git a/server/views/about-levels.html b/server/views/about-levels.html index b9bc60f71..425f39a03 100644 --- a/server/views/about-levels.html +++ b/server/views/about-levels.html @@ -2,8 +2,6 @@ {% block content %} {% set metaNoIndex = true %} -{% include "partials/back-button.html" %} -

@@ -62,7 +60,7 @@

What 'low', 'normal' and 'hig

Low, normal and high are shown when the latest level is below, within or above this range.

- +
{% endblock %} diff --git a/server/views/alerts-and-warnings.html b/server/views/alerts-and-warnings.html index 9cebc79ef..905d680c1 100644 --- a/server/views/alerts-and-warnings.html +++ b/server/views/alerts-and-warnings.html @@ -5,12 +5,6 @@ {% block content %} -{% if model.referer %} -
-
-
-{% endif %} -

@@ -65,10 +59,10 @@

{{ model.countFloods }} result{% if mode {% for group in model.floods %} {% if group.count > 0 %}
  • - +

    {{ group.count }} {% if group.count != 1 %}{{ group.severity.pluralisedTitle | lower }}{% else %}{{ group.severity.title | lower }}{% endif %} - {{ group.severity.subTitle }} - +

    +

    {{ group.severity.subTitle }}

      {% for item in group.floods %} {{ item.html | safe }} diff --git a/server/views/find-location.html b/server/views/find-location.html index baf78bcc2..ecf8a4755 100644 --- a/server/views/find-location.html +++ b/server/views/find-location.html @@ -5,32 +5,16 @@ {% block content %} -{% if model.referer %} -
      -
      -
      -{% endif %} -
      - - {% if model.locationInput.errorMessage %} - {{ govukErrorSummary(model.errorSummary) }} - {% endif %} - -

      Where do you want to check?

      + {% if model.locationInput.errorMessage %} + {{ govukErrorSummary(model.errorSummary) }} + {% endif %} {{ govukInput(model.locationInput) }}
      -

      - See all flooding in England -

      +

      See all flooding in England

      {% endblock %} - -{% block bodyEnd %} -{{ super() }} - -{% endblock %} \ No newline at end of file diff --git a/server/views/layout.html b/server/views/layout.html index 08e60e8e9..526def226 100644 --- a/server/views/layout.html +++ b/server/views/layout.html @@ -68,7 +68,6 @@ {% block header %} {{ govukHeader({ homepageUrl: "https://www.gov.uk/", - containerClasses: "govuk-width-container", serviceName: serviceName, serviceUrl: "/find-location" }) }} diff --git a/server/views/location-error.html b/server/views/location-error.html index 141bf99a0..49bbe76a3 100644 --- a/server/views/location-error.html +++ b/server/views/location-error.html @@ -2,12 +2,6 @@ {% block content %} -{% if model.referer %} -
      -
      -
      -{% endif %} -

      Sorry, there is a problem with the service

      @@ -17,8 +11,3 @@

      Sorry, there is a problem w

      {% endblock %} - -{% block bodyEnd %} -{{ super() }} - -{% endblock %} diff --git a/server/views/location-not-found.html b/server/views/location-not-found.html index b3170fdd4..652b9e548 100644 --- a/server/views/location-not-found.html +++ b/server/views/location-not-found.html @@ -2,12 +2,6 @@ {% block content %} -{% if model.referer %} -
      -
      -
      -{% endif %} -

      @@ -28,8 +22,3 @@

      {% endblock %} - -{% block bodyEnd %} -{{ super() }} - -{% endblock %} diff --git a/server/views/location.html b/server/views/location.html index f67439397..0a270581a 100644 --- a/server/views/location.html +++ b/server/views/location.html @@ -1,15 +1,28 @@ {% extends 'layout.html' %} -{% block content %} +{% block beforeContent %} + +
      +

      + + + This is a new service – leave feedback to help us improve it, or {{liveServiceText}} + +

      +
      - +{% endblock %} + +{% block content %} +

      diff --git a/server/views/national.html b/server/views/national.html index 93a819fe0..a7c73ce06 100644 --- a/server/views/national.html +++ b/server/views/national.html @@ -86,7 +86,7 @@

      Sorry, there is
      -

    - +
  • diff --git a/server/views/partials/back-button.html b/server/views/partials/back-button.html deleted file mode 100644 index 2f8db15c9..000000000 --- a/server/views/partials/back-button.html +++ /dev/null @@ -1,7 +0,0 @@ -{% if model.referer %} -
    -
    - Back -
    -
    -{% endif %} \ No newline at end of file diff --git a/server/views/partials/feedback.html b/server/views/partials/feedback.html index 10e0682cb..0756c3aa8 100644 --- a/server/views/partials/feedback.html +++ b/server/views/partials/feedback.html @@ -1,5 +1,5 @@ diff --git a/server/views/partials/outlook-region-messages.html b/server/views/partials/outlook-region-messages.html index 209ab6d26..5e8e66ba9 100644 --- a/server/views/partials/outlook-region-messages.html +++ b/server/views/partials/outlook-region-messages.html @@ -1,5 +1,4 @@ {% switch messageId %} -{% case "1-i2-l2"%} {% case "2-i2-l3" %} It’s likely that {{ sources }} will flood low lying land and roads. {% case "2-i2-l4" %} diff --git a/server/views/partials/outlook-region.html b/server/views/partials/outlook-region.html index 36953899e..fee428652 100644 --- a/server/views/partials/outlook-region.html +++ b/server/views/partials/outlook-region.html @@ -42,11 +42,13 @@

    Today

    Today there's a {{ model.tabs.dailyRisk[0] | lower }} risk of flooding.

    - {% for messageId, sources in model.tabs.tab1 %} - {% if loop.first %}

    {% endif %} - {% include "partials/outlook-region-messages.html" %} - {% if loop.last %}

    {% endif %} - {% endfor %} + {% for messageId, sources in model.tabs.tab1 %} + {% if messageId !== '1-i2-l2' %} + {% if loop.first %}

    {% endif %} + {% include "partials/outlook-region-messages.html" %} + {% if loop.last %}

    {% endif %} + {% endif %} + {% endfor %} {% else %} @@ -61,11 +63,13 @@

    Tomorrow

    On {{ model.tabs.dayName[1] }} the risk of flooding {{ model.tabs.trend[1] }} {{ model.tabs.dailyRisk[1] | lower }}.

    - {% for messageId, sources in model.tabs.tab2 %} - {% if loop.first %}

    {% endif %} - {% include "partials/outlook-region-messages.html" %} - {% if loop.last %}

    {% endif %} - {% endfor %} + {% for messageId, sources in model.tabs.tab2 %} + {% if messageId !== '1-i2-l2' %} + {% if loop.first %}

    {% endif %} + {% include "partials/outlook-region-messages.html" %} + {% if loop.last %}

    {% endif %} + {% endif %} + {% endfor %} {% else %} @@ -82,12 +86,14 @@

    Outlook

    {% set dayNum = loop.index + 2 %}

    On {{ model.tabs.dayName[dayNum - 1] }} the risk of flooding {{ model.tabs.trend[dayNum - 1]}} {{ model.tabs.dailyRisk[dayNum - 1] | lower }}.

    - {% for messageId, sources in day %} - {% if loop.first %}

    {% endif %} - {% include "partials/outlook-region-messages.html" %} - {% if loop.last %}

    {% endif %} - {% endfor %} - + + {% for messageId, sources in day %} + {% if messageId !== '1-i2-l2' %} + {% if loop.first %}

    {% endif %} + {% include "partials/outlook-region-messages.html" %} + {% if loop.last %}

    {% endif %} + {% endif %} + {% endfor %} {% endfor %} {% else %} diff --git a/server/views/partials/related-content.html b/server/views/partials/related-content.html index 05fd269e4..84b0f048c 100644 --- a/server/views/partials/related-content.html +++ b/server/views/partials/related-content.html @@ -1,4 +1,4 @@ - + diff --git a/server/views/partials/three-levels-releated-content.html b/server/views/partials/three-levels-releated-content.html new file mode 100644 index 000000000..89cfe942f --- /dev/null +++ b/server/views/partials/three-levels-releated-content.html @@ -0,0 +1,28 @@ + +

    We issue 3 levels of flood warning:

    +

    + + Flood alert - Prepare +

    +
      +
    • prepare a bag that includes medicines and insurance documents
    • +
    • check flood warnings
    • +
    +

    + + Flood warning - Act +

    +
      +
    • turn off gas, water and electricity
    • +
    • move things upstairs or to safety
    • +
    • move family, pets and car to safety
    • +
    +

    + + Severe flood warning - Survive +

    +
      +
    • call 999 if in immediate danger
    • +
    • follow advice from emergency services
    • +
    • keep yourself and your family safe
    • +
    diff --git a/server/views/plan-ahead-for-flooding.html b/server/views/plan-ahead-for-flooding.html index 761f7cf46..ee0411a4d 100644 --- a/server/views/plan-ahead-for-flooding.html +++ b/server/views/plan-ahead-for-flooding.html @@ -1,5 +1,6 @@ {% extends 'layout.html' %} {% block content %} +

    @@ -14,33 +15,7 @@

    Sign up for flood warnings

    In many flood risk areas, you can sign up for flood warnings. These warn of the risk of flooding from rivers, the sea and groundwater. You’ll be alerted by phone, email or text when flooding is expected. Flood warnings and alerts are not available in all areas.

    Know what to do

    The best way to protect yourself from flooding is to know what to do in advance.

    -

    We issue 3 levels of flood warning:

    -

    - Flood alert symbol - Flood alert - Prepare -

    -
      -
    • prepare a bag that includes medicines and insurance documents
    • -
    • check flood warnings
    • -
    -

    - Flood warning symbol - Flood warning - Act -

    -
      -
    • turn off gas, water and electricity
    • -
    • move things upstairs or to safety
    • -
    • move family, pets and car to safety
    • -
    -

    - Severe flood warning symbol - Severe flood warning - Survive -

    -
      -
    • call 999 if in immediate danger
    • -
    • follow advice from emergency services
    • -
    • keep yourself and your family safe
    • -
    + {% include "partials/three-levels-releated-content.html" %}

    Save a copy of this simple flood plan (PDF, 139KB) so you’ll know what to do when there’s a flood warning in your area.

    You can also use templates to make your own personal flood plan for:

      @@ -81,30 +56,30 @@

      If you live near a watercourse

    {% endblock %} diff --git a/server/views/privacy-notice.html b/server/views/privacy-notice.html index 0df8d9aa0..c1f9e8bb5 100644 --- a/server/views/privacy-notice.html +++ b/server/views/privacy-notice.html @@ -84,7 +84,7 @@

    Following a link to GOV.UK from another website

    - +
    diff --git a/server/views/recovering-after-a-flood.html b/server/views/recovering-after-a-flood.html index b8011c7f0..d3e1787e8 100644 --- a/server/views/recovering-after-a-flood.html +++ b/server/views/recovering-after-a-flood.html @@ -42,7 +42,7 @@

    Apply for financial aid

    You may be able to get financial aid for flood recovery. Apply to your local council.

    - +
    {% endblock %} \ No newline at end of file diff --git a/server/views/river-and-sea-levels.html b/server/views/river-and-sea-levels.html index 85d4f8684..d8104156a 100644 --- a/server/views/river-and-sea-levels.html +++ b/server/views/river-and-sea-levels.html @@ -6,21 +6,15 @@ -{% if model.referer %}
    -
    -
    -{% endif %} - -
    -
    -

    - River, sea, groundwater and rainfall levels -

    - {% if model.subtitle %} -

    {{ model.subtitle }} Show all levels

    - {% endif %} -
    +
    +

    + River, sea, groundwater and rainfall levels +

    + {% if model.subtitle %} +

    {{ model.subtitle }} Show all levels

    + {% endif %} +
    {% if model.error %} @@ -36,131 +30,132 @@

    {% endif %} -{% if model.placeDescription %}
    +{% if model.placeDescription %} +
    -

    Showing levels within 5 miles of {{ model.placeDescription }}. Show all levels

    +

    Showing levels within 5 miles of {{ model.placeDescription }}. Show all levels

    {% endif %} -{% if model.originalStation %}
    +{% if model.originalStation %} +
    -

    Showing levels within 5 miles of {{ model.originalStation.external_name }}. Show all levels

    +

    Showing levels within 5 miles of {{ model.originalStation.external_name }}. Show all levels

    {% endif %} -
    - -
    -