Skip to content

Commit

Permalink
Release 8.5.0 (#743)
Browse files Browse the repository at this point in the history
* find place searching on alerts and warnings

* sonar fix 1

* path var

* sonar fixes 3

* sonar fixes 4

* code tidy

* sonar fixes 5

* sonar fixes 6

* sonar fixes 6

* add not found location route test

* add not found location route test

* add not found location route test

* tidy up tests

* remove unused query param option

* add test for /england

* test tidy

* test coverage for failAction

* FSR-1207 | remove commented out code

* Add support for 'religiousstructure' type in bingResultsParser

* Add support for 'roadblock' type in bingResultsParser

* FSR-1207 | update page title to use place name

* sonar fix

* Bump node-html-parser from 6.1.12 to 6.1.13 (#658)

Bumps [node-html-parser](https://github.com/taoqf/node-fast-html-parser) from 6.1.12 to 6.1.13.
- [Release notes](https://github.com/taoqf/node-fast-html-parser/releases)
- [Changelog](https://github.com/taoqf/node-html-parser/blob/main/CHANGELOG.md)
- [Commits](taoqf/node-html-parser@v6.1.12...v6.1.13)

---
updated-dependencies:
- dependency-name: node-html-parser
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* FSR-1208 | river and sea levels search redirects (#723)

* FSR-1208 | river and sea levels search redirects

* FSR-1208 | river and sea levels search redirects

* sonar fixes 1

* sonar fixes 2

* sonar fixes 3

* move duplicate functions to lib/utils

* sonar fix

* sonar fixes

* sonar fix undo

* add util funcitons

* remove commented code

* remove locationHandler fn

* Refactor locationRouteHandler in river-and-sea-levels.js

* Refactor locationRouteHandler else clause

* remove comment and use util func

* redirect on non-england locations

* remove uneeded test

* add fakeGetJson to test

* sonar fix

* fix response behaviour

* fix single character search result

* remove flakey test

* refactored tests to be inline with alerts-and-warnings

* test coverage

* typo

* test coverage

* add script encode test

---------

Co-authored-by: Ash <[email protected]>
Co-authored-by: nikiwycherley <[email protected]>

* Bump version number (8.5.0)

* Add release notes (8.5.0)

* Update CFF-8.5.0.md

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Ash <[email protected]>
Co-authored-by: Ash <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <[email protected]>
Co-authored-by: Lee Gordon <[email protected]>
  • Loading branch information
6 people committed Jul 15, 2024
1 parent 80e4766 commit 3f5388b
Show file tree
Hide file tree
Showing 15 changed files with 1,157 additions and 2,646 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flood-app",
"version": "8.4.0",
"version": "8.5.0",
"description": "Flood risk app",
"main": "index.js",
"repository": "github:defra/flood-app",
Expand Down Expand Up @@ -96,7 +96,7 @@
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"mockdate": "^3.0.5",
"node-html-parser": "^6.1.11",
"node-html-parser": "^6.1.13",
"nodemon": "^3.0.1",
"proxyquire": "^2.1.3"
}
Expand Down
27 changes: 27 additions & 0 deletions release-docs/CFF-8.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Check For Flooding Release

* Version: 8.5.0
* Proposed Release Date: 17th July 2024
* Jira Release Overview: https://eaflood.atlassian.net/projects/FSR/versions/17136/tab/release-report-all-issues


## Tickets


* FSR-1208 | river and sea levels search redirects (#723)

* FSR-1207 | update page title to use place name



## Instructions


1 - Execute LFW_{STAGE}_04_UPDATE_FLOOD_APP_AND_SERVICE_PIPELINE


Execute smoke tests and forward results

## Related Infrastructure Changes Required

* None
41 changes: 22 additions & 19 deletions server/models/views/alerts-and-warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,39 @@ const { bingKeyMaps } = require('../../config')
const config = require('../../config')

class ViewModel {
constructor ({ location, place, floods, station, error }) {
constructor ({ q, location, place, floods = [], station, canonical, error }) {
Object.assign(this, {
q: location,
q,
station,
map: station ? 'map-station' : 'map',
station: station || null,
placeName: place ? place.name : '',
placeBbox: place ? place.bbox2k : [],
placeCentre: place ? place.center : [],
placeName: place?.name || '',
placeBbox: place?.bbox2k || [],
placeCentre: place?.center || [],
timestamp: Date.now(),
error: error ? true : null,
metaCanonical: canonical,
canonicalUrl: canonical,
error: !!error,
displayGetWarningsLink: true,
displayLongTermLink: true,
isEngland: place ? place.isEngland.is_england : null,
isDummyData: floods ? floods.isDummyData : false,
isEngland: place?.isEngland?.is_england,
isDummyData: floods?.isDummyData,
floodRiskUrl: config.floodRiskUrl
})

if (this.station && this.station.agency_name) {
this.pageTitle = `${this.station.agency_name} - flood alerts and warnings`
} else {
const pageTitle = place?.name ?? location

this.pageTitle = `${pageTitle ? pageTitle + ' - f' : 'F'}lood alerts and warnings`
}

if (error) {
this.pageTitle = 'Sorry, there is currently a problem searching a location'
} else {
if (this.station && this.station.agency_name) {
this.pageTitle = `${this.station.agency_name} - flood alerts and warnings`
} else {
this.pageTitle = `${location ? location + ' - f' : 'F'}lood alerts and warnings`
}
}
this.countFloods = floods ? floods.floods.length : 0
this.floods = floods
? floods.groups.map(item => item)
: []

this.countFloods = floods?.floods?.length ?? 0
this.floods = floods?.groups?.map(item => item)

this.expose = {
station: this.station,
Expand Down
12 changes: 7 additions & 5 deletions server/models/views/river-and-sea-levels.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function referencedStationViewModel (referencePoint, stations) {
}
}

function placeViewModel ({ location, place, stations = [], queryGroup }) {
function placeViewModel ({ location, place, stations = [], queryGroup, canonical, q }) {
let distStatement, title, description

const isEngland = place ? place.isEngland.is_england : true
Expand All @@ -128,10 +128,10 @@ function placeViewModel ({ location, place, stations = [], queryGroup }) {
deleteUndefinedProperties(stations)

if (location && isEngland) {
title = `${location} - ${pageTitle}`
title = `${place.name ?? location} - ${pageTitle}`
description = `Find river, sea, groundwater and rainfall levels in ${location}. Check the last updated height, trend and state recorded by the measuring station.`
} else {
title = location ? `${location} - ${pageTitle}` : pageTitle
title = place ? `${place.name} - ${pageTitle}` : pageTitle
description = metaDescription
}

Expand All @@ -141,13 +141,15 @@ function placeViewModel ({ location, place, stations = [], queryGroup }) {
filters,
floodRiskUrl,
distStatement,
q: location,
q: q || location,
clientModel: getClientModel(isEngland ? place.bbox10k : []),
queryGroup: activeFilter,
placeAddress: place.address,
...getDataJourneyClickStrings(),
pageTitle: title,
metaDescription: description
metaDescription: description,
metaCanonical: canonical,
canonicalUrl: canonical
}
}

Expand Down
Loading

0 comments on commit 3f5388b

Please sign in to comment.