-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
activated page not found route, ni poscode entry in uk location.
- Loading branch information
1 parent
d661459
commit ee27692
Showing
7 changed files
with
71 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
const searchLocationController = { | ||
import { LOCATION_NOT_FOUND } from '~/src/server/data/constants' | ||
import { english } from '~/src/server/data/en/en.js' | ||
|
||
const locationNotFoundController = { | ||
handler: (request, h) => { | ||
const { query } = request | ||
return h.view('location-not-found/index', { | ||
pageTitle: 'Check air quality - GOV.UK', | ||
heading: 'Check air quality', | ||
page: 'location', | ||
serviceName: 'Check air quality', | ||
searchParams: { | ||
label: { | ||
text: 'Where do you want to check?', | ||
classes: 'govuk-label--l govuk-!-margin-bottom-6', | ||
isPageHeading: true | ||
}, | ||
hint: { | ||
text: 'Enter a location or postcode' | ||
}, | ||
id: 'location', | ||
name: 'location' | ||
}, | ||
lang: query.lang | ||
const locationData = request.yar.get('locationDataNotFound') || [] | ||
const { locationNameOrPostcode, lang } = locationData | ||
const { | ||
notFoundLocation, | ||
home, | ||
footerTxt, | ||
phaseBanner, | ||
backlink, | ||
cookieBanner | ||
} = english | ||
return h.view(LOCATION_NOT_FOUND, { | ||
userLocation: locationNameOrPostcode, | ||
serviceName: notFoundLocation.heading, | ||
paragraph: notFoundLocation.paragraphs, | ||
pageTitle: `${notFoundLocation.paragraphs.a} ${locationNameOrPostcode} - ${home.pageTitle}`, | ||
footerTxt, | ||
phaseBanner, | ||
backlink, | ||
cookieBanner, | ||
lang | ||
}) | ||
} | ||
} | ||
|
||
export { searchLocationController } | ||
export { locationNotFoundController } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
const searchLocationController = { | ||
import { LOCATION_NOT_FOUND } from '~/src/server/data/constants' | ||
import { english } from '~/src/server/data/en/en.js' | ||
|
||
const locationNotFoundController = { | ||
handler: (request, h) => { | ||
return h.view('location-not-found/index', { | ||
pageTitle: 'Check air quality - GOV.UK', | ||
heading: 'Check air quality', | ||
page: 'location', | ||
serviceName: 'Check air quality', | ||
searchParams: { | ||
label: { | ||
text: 'Where do you want to check?', | ||
classes: 'govuk-label--l govuk-!-margin-bottom-6', | ||
isPageHeading: true | ||
}, | ||
hint: { | ||
text: 'Enter a location or postcode' | ||
}, | ||
id: 'location', | ||
name: 'location' | ||
}, | ||
lang: request.query.lang | ||
const locationData = request.yar.get('locationDataNotFound') || [] | ||
const { locationNameOrPostcode, lang } = locationData | ||
const { | ||
notFoundLocation, | ||
home, | ||
footerTxt, | ||
phaseBanner, | ||
backlink, | ||
cookieBanner | ||
} = english | ||
return h.view(LOCATION_NOT_FOUND, { | ||
userLocation: locationNameOrPostcode, | ||
serviceName: notFoundLocation.heading, | ||
paragraph: notFoundLocation.paragraphs, | ||
pageTitle: `${notFoundLocation.paragraphs.a} ${locationNameOrPostcode} - ${home.pageTitle}`, | ||
footerTxt, | ||
phaseBanner, | ||
backlink, | ||
cookieBanner, | ||
lang | ||
}) | ||
} | ||
} | ||
|
||
export { searchLocationController } | ||
export { locationNotFoundController } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { searchLocationController } from '~/src/server/search-location/controller' | ||
import { locationNotFoundController } from '~/src/server/location-not-found/cy/controller' | ||
|
||
const searchLocationCy = { | ||
const locationNotFoundCy = { | ||
plugin: { | ||
name: 'lleoliad', | ||
name: 'lleoliad-heb-ei-ganfod', | ||
register: async (server) => { | ||
server.route([ | ||
{ | ||
method: 'POST', | ||
path: '/lleoliad{id}', | ||
...searchLocationController | ||
method: 'GET', | ||
path: '/lleoliad-heb-ei-ganfod/cy', | ||
...locationNotFoundController | ||
} | ||
]) | ||
} | ||
} | ||
} | ||
|
||
export { searchLocationCy } | ||
export { locationNotFoundCy } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { searchLocationController } from '~/src/server/search-location/controller' | ||
import { locationNotFoundController } from '~/src/server/location-not-found/controller' | ||
|
||
const searchLocation = { | ||
const locationNotFound = { | ||
plugin: { | ||
name: 'location', | ||
name: 'location-not-found', | ||
register: async (server) => { | ||
server.route([ | ||
{ | ||
method: 'POST', | ||
path: '/location{id}', | ||
...searchLocationController | ||
method: 'GET', | ||
path: '/location-not-found', | ||
...locationNotFoundController | ||
} | ||
]) | ||
} | ||
} | ||
} | ||
|
||
export { searchLocation } | ||
export { locationNotFound } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters