Skip to content

Commit

Permalink
Revert "Release 8.5.0 (#743)"
Browse files Browse the repository at this point in the history
This reverts commit 3f5388b.
  • Loading branch information
LeeGordon83 committed Jul 15, 2024
1 parent 3f5388b commit f84d945
Show file tree
Hide file tree
Showing 15 changed files with 2,527 additions and 1,038 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.5.0",
"version": "8.4.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.13",
"node-html-parser": "^6.1.11",
"nodemon": "^3.0.1",
"proxyquire": "^2.1.3"
}
Expand Down
27 changes: 0 additions & 27 deletions release-docs/CFF-8.5.0.md

This file was deleted.

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

class ViewModel {
constructor ({ q, location, place, floods = [], station, canonical, error }) {
constructor ({ location, place, floods, station, error }) {
Object.assign(this, {
q,
station,
q: location,
map: station ? 'map-station' : 'map',
placeName: place?.name || '',
placeBbox: place?.bbox2k || [],
placeCentre: place?.center || [],
station: station || null,
placeName: place ? place.name : '',
placeBbox: place ? place.bbox2k : [],
placeCentre: place ? place.center : [],
timestamp: Date.now(),
metaCanonical: canonical,
canonicalUrl: canonical,
error: !!error,
error: error ? true : null,
displayGetWarningsLink: true,
displayLongTermLink: true,
isEngland: place?.isEngland?.is_england,
isDummyData: floods?.isDummyData,
isEngland: place ? place.isEngland.is_england : null,
isDummyData: floods ? floods.isDummyData : false,
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?.length ?? 0
this.floods = floods?.groups?.map(item => item)
this.countFloods = floods ? floods.floods.length : 0
this.floods = floods
? floods.groups.map(item => item)
: []

this.expose = {
station: this.station,
Expand Down
12 changes: 5 additions & 7 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, canonical, q }) {
function placeViewModel ({ location, place, stations = [], queryGroup }) {
let distStatement, title, description

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

if (location && isEngland) {
title = `${place.name ?? location} - ${pageTitle}`
title = `${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 = place ? `${place.name} - ${pageTitle}` : pageTitle
title = location ? `${location} - ${pageTitle}` : pageTitle
description = metaDescription
}

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

Expand Down
Loading

0 comments on commit f84d945

Please sign in to comment.